Repository navigation
session/list returns SESSION_QUERY_SOURCE_CONFLICT when a live session re-creates a stored id, leaving the Web sidebar empty #6564
Unanswered
sweet-boby
asked this question in
Q&A
Replies: 1 comment
|
感谢这份非常完整的报告——你贴的机制与行号我们已逐条对着 master 核实,全部属实。 机制确认:
今天的缓解办法:报错消息会指名冲突的 id(你例子里是 team-board)。把该 id 的陈旧持久化档案 修复方向(维护侧):列表按会话容忍——捕获冲突 → 打一条 warning → 该实时会话以 未验证说明:以上为源码级核实,未在你的第三方插件组合上重跑;但 RPC 失败 → 侧栏空 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
A single
SESSION_QUERY_SOURCE_CONFLICTrejected the entiresession/listRPC, so the Web session list came back empty after a page refresh — the history looked erased even though every stored session was intact on disk. The trigger is a session id that is legitimately re-created in a later process: the live header gets a freshcreatedAt, which can never equal the durable one, andSessionCorpus.listSessions()treated that one disagreement as fatal for the whole listing.Reproduction
ctx.sessions.create(SessionId('team-board')).dsh weband call the session list RPC:{"type":"server-response","rpcId":"1","result":{"ok":false,"error":{ "code":"gateway/internal", "message":"session source headers conflict for session \"team-board\"","details":{}}}}Current behavior
SessionCorpus.listSessions()compares each attached session's live header with the stored header sharing its id and letsassertSessionHeadersCompatible()throw out of the whole call (packages/session-query/session-query/src/corpus.ts).createdAt, so this is a permanent condition, not a race, for that id.load) are fine; only the listing was all-or-nothing. Measured headers in the report below:{"version":3,"id":"team-board","createdAt":<current boot>,"isSeeded":false}sessions/_no-cwd/team-board/):{"version":0,"id":"team-board","createdAt":1787020788707,"delegationDepth":0}Expected behavior
One stale stored source should not hide the rest of the corpus:
listSessions()should stay live-preferred and exclude only the conflicting stored source, while exact reads of a non-live id may keep refusing withSESSION_QUERY_SOURCE_CONFLICT.Suggested fix (verified locally)
SessionCorpus.listSessions()catches the conflict, logs a warning, serves the live session aspersisted: false, and drops the stale stored row; everything else is untouched.Evidence:
gateway/internalfailure in an isolatedDSH_HOME, then confirmed the listing returnsok:truewith the original, unmodified artifact in place.createdAt;packages/session-query,packages/api/session-controller/tests, andpackages/subagent/subagentpass (1742 tests), plustsc -b, oxlint, markdown wrap, and the bilingual pairing gate.src/corpus.ts,tests/session-query.spec.ts,README.md+README.zh.md(docs for the listing semantics). Commit729c72d743onfix/session-list-source-conflict, based ondsh-v0.1.5-rc.2.Environment
0.1.5-rc.2, macOS (darwin, arm64), Node v24.15.0@deepseek-ai/dsh-base+@deepseek-ai/dsh-web-appand third-party plugins, including@dsh-suite/plugin-team-boardctx.sessionQueryserved by@deepseek-ai/dsh-session-query-sqlitewithopenAt: never(SQLite not opened; the JSONL corpus path above is what ran)中文
摘要
一次
SESSION_QUERY_SOURCE_CONFLICT让整个session/listRPC 失败,Web 会话列表在刷新后变成空列表——看起来像历史记录被清空,实际磁盘上每条会话都完好。触发条件是某个 session id 在后续进程中被合法地重新创建:实时 header 会拿到新的createdAt,永远不可能等于持久化那份,而SessionCorpus.listSessions()把这一个不一致当成了整个列表的致命错误。复现
ctx.sessions.create(SessionId('team-board'))。dsh web,调用会话列表 RPC(上面的 curl 示例,需带上签名的浏览器会话 cookie)。{"ok":false,"error":{"code":"gateway/internal","message":"session source headers conflict for session \"team-board\""}}。当前行为
listSessions()把每个实时会话的 header 与同 id 的持久化 header 比较,并让assertSessionHeadersCompatible()的异常直接抛出整个调用。createdAt,所以对该 id 来说这是常态而非竞态。load)不受影响,只有列表是"全有或全无"。期望行为
一条陈旧的持久化来源不应遮蔽其余语料:
listSessions()应保持 live-preferred,仅排除冲突的那一条持久化来源;对非实时 id 的精确读取仍可用SESSION_QUERY_SOURCE_CONFLICT拒绝。建议修复(已在本地验证)
SessionCorpus.listSessions()捕获该冲突、打一条 warning、把该实时会话按persisted: false返回并剔除那条陈旧记录,其余行保持不变。已在隔离的DSH_HOME中复现出完全一致的报错,并在放回原始未修改归档文件后确认列表恢复为ok:true;新增回归用例(固定 id 以新的createdAt重新创建);packages/session-query、packages/api/session-controller/tests、packages/subagent/subagent共 1742 个测试通过,tsc -b、oxlint、Markdown 换行与双语配对门禁均通过。环境
DeepSeek Harness
0.1.5-rc.2,macOS (arm64),Node v24.15.0;web profile 挂载dsh-base+dsh-web-app及第三方插件(含@dsh-suite/plugin-team-board);ctx.sessionQuery由dsh-session-query-sqlite(openAt: never)提供。All reactions