You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
背景
核心 agent 循环的工具执行调度器存在一个中止路径下的状态不一致:
startCall先落盘tool/call事件再 awaitprepare,当prepare因中止/抛错失败时,留下孤儿tool/call无对应tool/result,重放/恢复时模型会看到未兑现的工具调用。问题 1:[低-中] 孤儿 tool/call 事件:prepare 中止/抛错时无对应 tool/result
位置:
packages/core/agent-loop/src/tool-calls.ts:164-196(startCall先appendToolCall再await prepare)+237-245(abort 路径只对group.slice(started)补合成结果)现象:
startCall里callSeqs[index] = appendToolCall(...)先落盘、started++,随后await ctx.tools[TOOL_RUNTIME_SCHEDULER].prepare(...)。若prepare因共享信号中止而拒绝,该异常被归为 scheduler failure(schedulerFailure ??= { error }),runGroup最终Promise.allSettled后抛错;但该 call 的tool/call事件已在日志中,group.slice(started)又把它排除在合成结果之外——于是留下一个无tool/result的孤儿tool/call。注释声明「scheduler failure 不伪造结果」是有意的,但中止导致的 prepare 拒绝恰好落进这个桶,而外层turn()的 catch 却按signal.aborted归类为 abort——两类语义打架,abort「记录合成结果保 replay 有效」的保证在此被破坏。复现:
prepare(或 tools runtime 的 prepare)在信号中止时拒绝实际结果:会话日志出现无对应
tool/result的tool/call事件;resume 后模型看到「发了工具调用却无结果」。建议:prepare 失败且信号已中止时,也按 abort 语义为该 call 补合成结果;或把 prepare 失败明确归类为调度器失败而非 abort,二者取其一并在代码注释中统一。
相关(已提交)
subagent 迟到
subagent-settled/subagent-report(wakeup 投递)在父代理空闲时逐个followup()开新回合,无合并机制——见 discussion #684(packages/subagent/subagent/src/continuation.ts:1439-1442+packages/core/agent/src/inbox.ts:71-78)。环境
dsh 0.1.0-rc(源码
pnpm dsh web),deepseek-v4-flash via deepseek-official,Windows 11。All reactions