Skip to content

[PR] EN | docs(#5630): correct the dsh subagent session-id claim — children mint fresh ids - #5633

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-11-04_dsh-subagent-id-docs
Open

ranxianglei wants to merge 1 commit into
masterfrom
2026-11-04_dsh-subagent-id-docs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Refs #5630

What and why

#5630 independently verified the deepseek-harness source (@ tag dsh-v0.2.2-alpha.3, master HEAD 8bd073392e) and confirmed that every real dsh subagent spawn mints its own fresh session id:

  • packages/subagent/subagent-dsh-sdk/src/run.ts:296 — childSessionId = \session-${randomUUID().replaceAll('-','')}``
  • packages/subagent/subagent-codex/src/run.ts:432, subagent-acp/src/run.ts:341, subagent-claude-code/src/run.ts:572 — bare randomUUID()

Four doc passages still said the opposite for dsh ("claude/codex/dsh … share one session id across subagents or have no child-session concept at all"). The corrected statement keeps the original CONCLUSION (these lanes need no derivedFrom lineage signal here) but fixes dsh's REASON: claude/codex stamp the main id on child requests (separated by other proxy signals), while dsh children are already isolated by their own fresh ids.

Files: README.md, README.zh-CN.md, SESSION-IDENTITY.md, SESSION-IDENTITY.zh-CN.md (one sentence each).

Behavior change disclosure

None — documentation only, zero code change.

Tests

Docs-only PR; no test surface touched.

@ranxianglei ranxianglei changed the title EN | docs(#5630): correct the dsh subagent session-id claim — children mint fresh ids [PR] EN | docs(#5630): correct the dsh subagent session-id claim — children mint fresh ids Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-04_dsh-subagent-id-docs (8fdb040)

Latest build — install this exact version

npm install -g billion-context@0.0.8924-pr.5633.59ee64b

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
8fdb040 billion-context@0.0.8924-pr.5633.59ee64b build
3a750b8 billion-context@0.0.8068-pr.5633.b17ed29 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5633.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。按主题+失败签名(「dsh 子代理共享主会话 id」这一错误文档表述)检索了 open+closed 的 issue/PR,同主题的仅此 PR;相邻项机制与范围均不同:#5240(|sub: 命名空间不是 Claude 专属的文档)、#5473(dsh user-role 注入抢 last-user anchor)、#4774(claude code 无头子代理车道拆分)。

标签:dsh、scope/docs、p3(纯文档勘误——修正 dsh 车道的既有错误陈述,零代码变更,影响面极小)。

审核进行中,已独立完成的核查:

  1. 源码复核属实:对照 deepseek-harness @ dsh-v0.2.2-alpha.3 公开源码逐行验证——packages/subagent/subagent-dsh-sdk/src/run.ts:296 childSessionId = \session-${randomUUID().replaceAll('-','')}`,另三处 subagent-codex/src/run.ts:432、subagent-acp/src/run.ts:341、subagent-claude-code/src/run.ts:572 均为裸 randomUUID()`;行号与引用全部对上。「每次 spawn 铸新 id」成立。
  2. 残留扫描干净:旧表述在仓库里只有本 PR 触碰的 4 处(README en/zh、SESSION-IDENTITY en/zh),无其他遗漏点;修正后 en/zh 四份表述一致。
  3. claude/codex 侧新措辞有仓库内证据:"子代理也打主会话 id、代理用其他信号分隔"——codex 有 CHANGELOG Codex 集成:guardian 审批请求进入压缩管线,导致明确授权无法被识别 #150 记录(codex-style subagent replay 复用主 session id,task-lane key 靠骨架哈希分离);claude 有 x-claude-code-session-id 每会话单值 + [PR] fix(#5095): add per-run discriminator to the claude-anthropic derived-persona lane key #5163/[PR] fix: split header-less claude code subagents onto their own session lane (#4352) #4774 的车道拆分支撑。与 KDD release v0.1.2 #9 的 dsh classifyRisk 内联 persona(主 id + system-hash fork)不冲突——那是在线辅助 persona,不是从空历史起步的子会话。

CI 状态与完整八问结论随后补报。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

审核结论:可合(待 CI 全绿,预计分钟级)

纯文档勘误。我独立复核了源码证据、残留扫描、与当前 master 的交互、CI 状态,均无问题。单 commit / 4 文件 / 7 行,每一行都服务于本 PR 目的,diff 干净。

独立验证(不依赖 issue 结论):拉取 deepseek-harness @ dsh-v0.2.2-alpha.3 公开源码逐行对照——packages/subagent/subagent-dsh-sdk/src/run.ts:296 为 childSessionId = \session-${randomUUID().replaceAll('-','')}`,与 PR 描述引用逐字一致(含 replaceAll);另三处 subagent-codex/src/run.ts:432、subagent-acp/src/run.ts:341、subagent-claude-code/src/run.ts:572 均为裸 randomUUID(),行号全部对上。「每次 spawn 铸新 id」成立。(注:#5630 正文引用时省略了 replaceAll` 细节,不影响结论。)

结构化八问

  1. 是什么问题:文档说「claude/codex/dsh 的子 agent 共享同一会话 id,或根本没有子会话概念」——其中 dsh 一半是错的:dsh 每次 spawn 子代理都铸一个全新会话 id,子会话天然按 id 隔离;它不需要 derivedFrom 血缘信号,但原因和 claude/codex 不同(claude/codex 是子请求打主会话 id、靠其他信号分隔)。
  2. 什么原因导致的:该表述写于 dsh 源码核实之前,沿用了「共享 id」的旧假设;[Research][dsh] The dsh session ID drifts as follows: sub-agents/auto-reviews each issue their own new ID, auto-compacti | [研究][dsh] dsh 会话 id 是这样漂移的:子代理/自动评审各发各的新 id,自动压缩落地不换 id,裸中继线上没有任何显式 id #5630 从 deepseek-harness 源码钉出完整铸点清单并交叉线流量验证,证明假设不成立(SDK server 甚至明确拒绝 resume origin==='subagent' 的会话——子代理是一次性身份)。
  3. 影响范围与严重程度:仅文档,零用户行为影响,严重程度轻微(p3)。真正的风险是误导后续维护者基于错误前提动 dsh 侧代码(比如试图按主 id 归并 dsh 子会话)——正是 [Research][dsh] The dsh session ID drifts as follows: sub-agents/auto-reviews each issue their own new ID, auto-compacti | [研究][dsh] dsh 会话 id 是这样漂移的:子代理/自动评审各发各的新 id,自动压缩落地不换 id,裸中继线上没有任何显式 id #5630 要防的误判方向。
  4. 怎么修复的:保留原结论(这几条车道在此处不需要任何父信号),按车道拆开原因陈述:claude/codex 子代理打主会话 id、代理用其他信号分隔(codex 有 CHANGELOG Codex 集成:guardian 审批请求进入压缩管线,导致明确授权无法被识别 #150 task-lane 骨架哈希分离记录;claude 有 [PR] fix(#5095): add per-run discriminator to the claude-anthropic derived-persona lane key #5163/[PR] fix: split header-less claude code subagents onto their own session lane (#4352) #4774 车道拆分支撑);dsh 每 spawn 铸新 id、天然隔离。en/zh 四份同步。
  5. 是否有回归问题:审过的既有行为——旧表述在仓库中仅有本 PR 触碰的 4 处(残留扫描 share one session id / 共享同一个会话 id 全仓命中即这 4 处,无遗漏点);各文件其余内容零改动(单句替换,SESSION-IDENTITY.md 为 2 行拆 4 行);无语义漂移/阈值/时序/输出格式变化。KDD release v0.1.2 #9 的 dsh classifyRisk 内联辅助 persona(主 id + system-hash fork)与「从空历史起步的 spawn 子会话」是两套机制,新措辞不与之冲突。CLIENTS.md:257 的「subagent conversations get their own derived proxy sessions」属 kimi 车道,与本文无关。
  6. 是否破坏缓存:不涉及(未触任何运行时路径)。
  7. 是否改了设计方向:不涉及,纯勘误。
  8. 是否引入新配置:不涉及。

master 漂移核查:分支基点后 master 前进了若干 commit(notice surface、kiro lane、magpie 修复等,其中两个 README 有无关新增),但 4 处被修正句子在 master 上逐字未变,GitHub mergeable=true 无冲突,无需 rebase。

CI(镜像缓存读取):30 项 check——docs-coverage / kernel-guard / pi-subagents-guard / lock-sync / version-guard / mysql-contract 已绿,real-client e2e 各道按惯例 skip;13 个 test 分片 queued/in-progress,目前 0 失败。零代码变更,预期平凡转绿;若 CI 异常我再跟进。

收工判定:可合。

@ranxianglei
ranxianglei force-pushed the 2026-11-04_dsh-subagent-id-docs branch from 3a750b8 to 8fdb040 Compare November 10, 2026 09:33
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Merge conflict resolved and pushed. This run I rebased the PR branch onto current master, resolved all four conflicting files, and force-pushed (lease-guarded) to 2026-11-04_dsh-subagent-id-docs. New head 8fdb04099a sits directly on the master tip (4dea18eabf), ahead 1 / behind 0, working tree clean.

Why it was dirty: master moved SESSION-IDENTITY.md/.zh-CN.md into docs/session-identity*.md (root files are now one-line redirect stubs) and repointed the README links at docs/…, while this PR was still editing the old root paths and the old claim text. That produced modify-vs-stub + context-drift conflicts on rebase across all four files.

How I resolved it — kept the PR's intent (correcting the "dsh mints a fresh session id per subagent spawn" claim) but landed it where the content actually lives now:

  • README.md / README.zh-CN.md: kept master's updated docs/… links, applied the corrected sentence.
  • Root SESSION-IDENTITY.md / .zh-CN.md: left as master's redirect stubs (unchanged).
  • docs/session-identity.md / .zh-CN.md: relocated the paragraph correction here (replacing the same stale sentence that had moved with the doc).

Final diff is a single commit, 4 files, +7/-5 — identical scale to the original PR, original commit message preserved. CI will re-run on the new head; I have not yet observed those fresh results this run, so I'm not asserting green/red.


结构化八问(中文):

  1. 是什么问题:PR [PR] EN | docs(#5630): correct the dsh subagent session-id claim — children mint fresh ids #5633(修正 dsh 子代理会话 id 说法的 docs 改动)与其基线分支冲突(merge state dirty),无法合并。
  2. 什么原因导致的:master 在此期间把根目录 SESSION-IDENTITY.md/.zh-CN.md 整体迁到 docs/session-identity*.md(根目录只剩一行重定向占位),并把 README 链接改成 docs/…;而本 PR 基于旧 master 改的是旧路径的整份文档和旧的错误说法。两边对同一文件做了不兼容改动(modify-vs-stub + 上下文漂移),rebase 时四处全部冲突。
  3. 影响范围与严重程度:仅文档,零代码/行为影响。冲突只阻塞该 docs PR 合并,不影响任何运行时功能——属流程瑕疵级。
  4. 怎么修复的:把 PR 意图落到内容现在真正存在的位置——README 两处保留 master 已更新的 docs/… 链接并套用新说法;两份根 SESSION-IDENTITY 文件保持 master 的重定向占位不动,段落修正搬进 docs/session-identity*.md。最终单 commit、4 文件、+7/-5,与原 PR 同规模。
  5. 是否有回归问题:无。纯文档措辞修正,未触碰任何 src/kernel/config/persistence/wire;既有行为零变化。README 链接沿用 master 迁移后的 docs/… 目标(锚点 #derived-child-sessions-lineage-at-birth-1333-1362 在目标文档中存在),比原 PR 写的根路径更不易随占位删除而失效。
  6. 是否破坏缓存:不涉及(无缓存/重试/游标/去重键相关改动)。
  7. 是否改了设计方向:不涉及(纯文档勘误,无架构/数据流转向)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值)。

判定:merge conflict 已解决并推送,PR 现在干净地落在当前 master 之上,可进入正常 CI → 人工合并流程。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Done — merge conflict resolved and pushed. Full structured verdict (English + 中文八问) is the comment directly above this one; short recap here so the thread ends clean:

  • What I did: rebased the PR's single docs commit onto current master tip (4dea18eabf), resolved all four conflicting files, force-pushed (lease-guarded) to 2026-11-04_dsh-subagent-id-docs. New head 8fdb04099a, ahead 1 / behind 0, working tree clean, original commit message preserved.
  • Why it was dirty: master moved SESSION-IDENTITY{,.zh-CN}.md into docs/session-identity*.md (root files now redirect stubs) and repointed README links at docs/…, while this PR still edited the old root paths + old claim text → modify-vs-stub conflicts on all four files.
  • How fixed: kept the PR's intent (dsh mints a fresh session id per subagent spawn) but landed it where the content lives now — corrected sentence applied in both READMEs against master's docs/… links; paragraph correction relocated into docs/session-identity*.md; root stubs left untouched. Final diff: 1 commit, 4 files, +7/-5 (same scale as the original PR).
  • Verified: diff sanity, clean tree, zero conflict markers, remote branch confirmed live at 8fdb04099a.
  • Remaining / risk: none for the conflict itself. CI will re-run on the new head; fresh results were not observable this run, so I am not asserting green/red — docs-only change, expected trivially green.

判定:冲突已解决并推送,PR 干净地落在当前 master 之上,可进入正常 CI → 人工合并。无遗留决策项。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Re-review of current head 8fdb04099 (post-rebase): clean — verdict 可合. Fresh end-to-end review of the rebased head (floors 4 & 7 already cover the pre-rebase verdict and the conflict resolution). Per rule ⓪ I re-derived correctness independently, verifying the claude/codex half against IN-REPO source rather than secondary references:

Why it's still "awaiting review": a formal APPROVE cannot be posted from this lane — the only available credential is the PR author's (ranxianglei) and GitHub rejects approving one's own PR (Review Can not approve your own pull request). Verdict stands as 可合; a human reviewer or the owner needs to click Approve (or merge directly) — CI is green.

结构化八问(中文)

  1. 是什么问题: 文档四处写「claude/codex/dsh 的子 agent 共享同一会话 id,或根本没有子会话概念」,其中 dsh 一半与已核实源码矛盾——dsh 每次 spawn 子代理都铸一个全新会话 id。
  2. 什么原因导致的: 该表述写于 dsh 源码核实([Research][dsh] The dsh session ID drifts as follows: sub-agents/auto-reviews each issue their own new ID, auto-compacti | [研究][dsh] dsh 会话 id 是这样漂移的:子代理/自动评审各发各的新 id,自动压缩落地不换 id,裸中继线上没有任何显式 id #5630)之前,沿用了「共享 id」的旧假设;[Research][dsh] The dsh session ID drifts as follows: sub-agents/auto-reviews each issue their own new ID, auto-compacti | [研究][dsh] dsh 会话 id 是这样漂移的:子代理/自动评审各发各的新 id,自动压缩落地不换 id,裸中继线上没有任何显式 id #5630 从 deepseek-harness 源码钉出完整铸点清单并交叉线流量验证后,这句成了过时陈述。
  3. 影响范围与严重程度: 纯文档,零运行时/用户行为影响(p3)。风险仅在于误导后续维护者基于错误前提动 dsh 侧代码(例如按主 id 归并 dsh 子会话)。
  4. 怎么修复的: 保留原结论(这几条车道在此处不需要父信号),按车道拆开原因——claude/codex 子请求打主会话 id、代理用其他信号(fingerprint / turn-metadata / persona-order)分隔;dsh 每 spawn 铸新 id、天然按 id 隔离。en/zh 四份同步,rebase 后落到 docs/session-identity*.md。
  5. 是否有回归问题: 无。残留扫描确认旧措辞全仓仅存于本 PR 触碰的 4 处,无遗漏;未触任何 src/kernel/config/persistence/wire,零语义漂移、无 fail-fast→吞错类高危模式。claude/codex 侧措辞已对仓库内源码逐条核过(lane-decisions.ts:109-118 / :122-126、handle.ts:994-1001),并与 handle.ts:1764 的内部 lane 对象说法确认不冲突。
  6. 是否破坏缓存: 不涉及(未触任何运行时路径)。
  7. 是否改了设计方向: 不涉及,纯勘误。
  8. 是否引入了新的配置: 不涉及。

判定: 当前 head 8fdb04099 复核干净,可合。formal APPROVE 受 GitHub「不能批准自己的 PR」规则限制无法由本 lane 提交,需人工点 Approve 或直接合并(CI 绿)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Review-worker-r1 complete — PR #5633 (head 8fdb04099) re-reviewed end-to-end: 可合 / clean.

Done & verified (independent, not adopted from prior floors):

One blocker (out of agent control): GitHub rejects approving one's own PR — the only available credential is the author's (ranxianglei), so no formal APPROVE event can be posted from this lane. A human reviewer or the owner needs to click Approve (or merge directly); CI is green.

结构化八问(中文)

  1. 是什么问题: 文档四处写「dsh 子 agent 共享主会话 id」与已核实源码矛盾——dsh 每次 spawn 子代理都铸一个全新会话 id。
  2. 什么原因导致的: 该表述写于 [Research][dsh] The dsh session ID drifts as follows: sub-agents/auto-reviews each issue their own new ID, auto-compacti | [研究][dsh] dsh 会话 id 是这样漂移的:子代理/自动评审各发各的新 id,自动压缩落地不换 id,裸中继线上没有任何显式 id #5630 源码核实之前,沿用「共享 id」旧假设;[Research][dsh] The dsh session ID drifts as follows: sub-agents/auto-reviews each issue their own new ID, auto-compacti | [研究][dsh] dsh 会话 id 是这样漂移的:子代理/自动评审各发各的新 id,自动压缩落地不换 id,裸中继线上没有任何显式 id #5630 从 deepseek-harness 源码钉出铸点清单并交叉线流量验证后,该句成为过时陈述。
  3. 影响范围与严重程度: 纯文档,p3,零运行时/用户行为影响;风险仅在于误导后续维护者基于错误前提动 dsh 侧代码。
  4. 怎么修复的: 保留原结论(这几条车道此处不需要父信号)、按车道拆开原因陈述,en/zh 四份同步,rebase 后落到 docs/session-identity*.md。
  5. 是否有回归问题: 无——残留扫描确认旧措辞全仓仅存于本 PR 触碰的 4 处;未触任何 src/kernel/config/persistence/wire;claude/codex 侧措辞已对仓库内源码逐条核过,零语义漂移。
  6. 是否破坏缓存: 不涉及(未触任何运行时路径)。
  7. 是否改了设计方向: 不涉及,纯勘误。
  8. 是否引入了新的配置: 不涉及。

判定: 当前 head 8fdb04099 复核干净,可合;formal APPROVE 受 GitHub「不能批准自己的 PR」规则限制无法由本 lane 提交,需人工点 Approve 或直接合并(CI 绿)。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant