Repository navigation
fix: codex / claude-over-Responses instructions drift migrates the persona anchor instead of forking (#2250) - #2271
Conversation
…claude-over-Responses instructions lanes (#2250) An instructions drift mid-conversation (model switch, AGENTS.md edit, -c override, codex upgrade reassembly) forked the main lane off its raw key onto |sub:<fp> — zero compression state, refs re-minted (#2241 exposure shape). The drift now MIGRATES the anchor when the replayed input continues the raw key's prefix-affinity chain; a genuinely fresh task reusing the id (#150) still forks. Kernel subagentNamespace swap at the responses call site; dsh lanes unchanged (already #2247); fork id format identical.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2377-pr.2271.eaa062eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2271.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 结论:可合并。逐项核验如下(不只读 diff,关键路径都拉代码对过、测试本地跑过)。 ① 是什么问题:codex 主会话(root thread / 老 build)与 claude-over-Responses 的身份是 ② 什么原因导致的:内核 ③ 怎么修复的:复用 #2247 的 dsh continuity resolver 并通用化( ④ 是否有回归问题:逐项清点触碰路径的既有行为——
⑤ 是否破坏缓存:不破坏。migrate 只改 key 归属,不改消息字节;raw key 保住后 head 反而更稳(不再因 fork 换锚)。持久化 / snapshot 格式未变。 ⑥ 是否改了设计方向:没有。复用 #2247 机制,无新架构;身份派生仍是 per-client 证据白名单门控( ⑦ 是否引入新配置:无。 验证证据(PR 描述里的测试结果我都独立复验过):
身份逻辑属 §7.4 human-gated 范畴,方向已在 #2250 floor 5 拍板。收工判定:可合并,等你合:#2271 |
…ift migrate; claude-over-Responses drift variant
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.85-master.d451570 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2250. 乘 #2247/#2241 之势:把 dsh 专属的 continuity persona resolver 通用化到 codex 线。
问题
codex 主会话(root thread / 老 build)与 claude-over-Responses 的身份 =
id + hash(instructions)(内核subagentNamespace首见锚)。同一 id 下 instructions 中途一变(切模型 / 编辑 AGENTS.md /-c覆盖 / codex 升级改拼装)→ 主 lane fork 到<id>|sub:<fp>→ 压缩状态全丢、refs 重编(#2241 同款:266,966 pendingT1 / 0 folds / 38 min)。修法
src/persona-anchor.ts:dshPersonaNamespace→ 协议中立personaNamespace(resolvePersonaKey 本就中立,直接复用);空白载体 passthrough(对齐内核语义);migrate 日志一条。src/server.tsresponses 指纹分支(instructionsFingerprintApplies 门控不变、sideRequestLike 旁路不变):subagentNamespace(id, instructions)→personaNamespace(id, instructions, parsed.input, log)。instructions是顶层字段,不在被哈希的input数组里(affinityMessageList 取 parsed.input)→ 纯 instructions 漂移不破链 →chainContinues命中 → migrate 保 raw key + 压缩状态;真正历史不连续(新任务复用同 id,Codex 集成:guardian 审批请求进入压缩管线,导致明确授权无法被识别 #150)→ 不命中 → fork(隔离保留)。fork id 格式与内核逐字节相同(<id>|sub:<sha256[0..16]>),[PR] fix: follow the live persona fork when a host-stamped dsh id hits a frozen anchor (#2241) #2244/dsh 回归防护:泳道判定真值表 + 侧请求不变量 + dsh e2e lane + 运行时金丝雀 + lane-guard(5 项) #2170 消费方不受影响。行为矩阵(相对现状,仅第 2 行变化 = 预期修复)
测试
tests/responses-instructions-drift.test.ts:Codex 集成:guardian 审批请求进入压缩管线,导致明确授权无法被识别 #150 用例的合成 payload 原本两任务字节相同——在连续性语义下同字节+新 instructions = 同对话演化(会 migrate),已改为真正不同内容(契约不变:仍 2 会话 fork);新增 codex 线 responses 身份仍走 instructions-hash subagentNamespace:同 id 下 instructions 中途变更会 fork 主 lane 丢压缩(#2241 同款暴露,未审计) #2250 e2e:instructions 漂移 + 全量重放连续 → 恰 1 会话、raw key、无 |sub:。缓存
不破坏:migrate 只改 key 归属不改消息字节;raw key 保住后 head 反而更稳(不再因 fork 换锚)。