Replies: 2 comments
|
深有同感!我们今天排查 #7128 时,由于工具调度器在 完全同意楼主对于 关于受损会话(v3 jsonl.zstd)的抢救方案验证:
修复后调用 强烈支持楼主的建议: |
|
Thanks — your two-line window is exactly right ( The failing site has a sibling that already does the right thingTwenty lines below your path, So the helper and the machinery already exist one branch away, and at the moment
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
tool/call一旦落盘,若其后的调度prepare抛错,该调用永远不会得到tool/result。此后该会话的每次请求都会因 provider 侧配对校验失败而报
DeepSeek Messages tool calls need immediate results(INVALID_REQUEST),会话永久不可用。Reproduction
制造任意一次工具分发失败(例如 resolutionMode 那个 issue 引起的失败),然后向同一会话继续发言。
代码路径:
packages/core/agent-loop/src/tool-calls.ts的startCall中,异常冒泡至外层
catch后被 rethrow。该 call 既没有结果,也未进入inFlight,因此
commitReady()同样不会补。Current behavior
每次发言都如此。
packages/core/session/src/repair.ts不会介入:它以openTurn === null判定日志 balanced 并直接
return [](注释 "Balanced log (no crash mid-turn): nothing to close"),而此处 turn 已正常结束(
turn/end已写入)。也没有任何 CLI 或产品内恢复路径,用户只能放弃该会话。会话日志形态(实测):
Expected behavior
分发
prepare抛出时,应为已记录的tool/call追加一条错误tool/result(可直接复用
repair.ts已有的合成结果形状与TOOL_OUTCOME_UNKNOWN),使 transcript 始终provider-valid。
repair.ts也宜覆盖「turn 已结束但仍有未配对调用」的情形。Environment
ddefc45fbc(0.1.6-alpha.2)补充:本地已按
repair.ts的格式手工补合成结果恢复该会话——只需追加一条surfaceOp: 'append'的
tool/result;serialize 会合并连续的 user 消息并把 tool_result 重排到前,正好清掉 pending。All reactions