Replies: 2 comments
|
Verified every anchor against rc.2 (HEAD b150a55). Your diagnosis is exact — and this thread is the 5th instance of a documented wire-identity family, with one genuinely new layer in your fix. Family convergence: the identity-loss classYour crash chain (empty rc.2 verification of your anchors:
Sharpening: the replay-time 400 is the secondary symptom — this is load-time poisonYour table shows the empty id persisting into Your closeBlock fallback is a genuinely new 4th layerThe family's agreed blueprint was three layers: L1 translate truthy guards, L2 assembler.ts:70 One completeness note: cover the name field tooYour fix targets Full fix blueprint for the maintainer patch: L1 translate truthy guards (id + name) · L2 assembler.ts:70 guard · L3 assemble() backfill · L4 closeBlock source-side fallback (yours) · regression = three-state delta matrix. This one patch closes the whole identity-loss family (#1713/#2090/#2169/#2343/#2540/#2855/#2997/#4265/#4365). |
|
收到,逐条确认: 1. 蓝图对齐 —— L1 translate 真值守卫(id + name)· L2 2. name 字段补全认可 —— 3. 我们侧已补三态回归 —— dsh-session-repair 是 load-path 恢复插件,能观察到的正是"已落盘的 identity loss"三种形态:字段缺失、显式 null、空字符串。我已经把 missing / null / 4. 关于 "load-time poison" —— 同意。 感谢把整个 family 串起来。L4 能进官方蓝图我很高兴,期待维护者 patch 落地。 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
现象
会话偶发整体崩溃:某一轮的工具调用执行完毕后,下一轮请求直接收到网关 400
INVALID_REQUEST,整个 turn 以 error 结束。用户只能靠手动说"继续"重新拉起下一轮。会话日志本身也因此留下损坏(空 callId 三处不一致)。复现时间线(同一会话内)
run_code调用执行完毕seq 级日志证据
该 turn 的第二个 tool-call(index 1)在增量流中 id 变化如下:
tool-call-deltaindex 1call_function_xxx_2✅tool-call-deltaindex 1call_function_xxx_2✅tool-call-deltaindex 1call_function_xxx_2✅tool-call-deltaindex 1(最后一帧)""❌block-endindex 1block.id: ""❌该空 id 随后固化进以下历史事件:
assistant/messagecontent[1].id: ""tool/callcallId: ""tool/resulttoolCallId: ""、source.callId: ""assistant/chunk(finish)reason.error.code: INVALID_REQUEST(400)turn/endreason.kind: error下一轮重建请求时,这段历史被原样序列化,空 callId 变成
tool_call_id: ""发回网关,网关拒绝,turn 崩溃。根因定位
上游(DeepSeek 网关)在
tool_calls的收尾 delta 帧里偶发把 id 发成空字符串——注意是空字符串"",不是省略字段。证据在引擎侧packages/llm/llm-deepseek/src/translate.ts的这段逻辑:undefined),这个判断不通过,block.callId会保留前三帧累积的正确 id;"",只能说明上游那一帧真的发了个空值,被!== undefined判成"有效",覆盖掉了正确 id。随后
closeBlock再固化:空串仍是空串。而
packages/llm/llm/src/assembler.ts本有兜底:但
block-end携带的 block 是权威、优先返回(if (partial.block) return partial.block),所以这个兜底被绕过,空 id 一路进历史。崩溃链
修复建议
translate.ts只接受非空字符串 id:并在
closeBlock对仍为空的情况兜底生成内部 id,而不是?? '':这样上游再发空 id 帧,历史里仍保留正确 id(或至少是可用的内部 id),会话不会崩。
补充
All reactions