Merge pull request #23 from deepseek-ai/fix/agent-loop-tool-result-callid

fix(agent-loop): log tool/result under the originating call.id
This commit is contained in:
Tianyi Cui
2026-06-15 22:09:32 +08:00
committed by GitHub
2 changed files with 55 additions and 1 deletions
+7 -1
View File
@@ -423,7 +423,13 @@ async function runStep(
})
session.append('tool/result', {
turn, step,
callId: result.callId,
// The correlation id MUST be the loop's authoritative call.id (the
// model-transcript id that deriveMessages turns into toolCallId), NOT
// result.callId — a tools/execute waterfall listener returning a
// mismatched id would otherwise orphan the call↔result pairing in the
// next model request. A listener-internal id, if ever needed, belongs in
// a separate diagnostic field, never overloaded onto callId.
callId: call.id,
content: result.content,
isError: result.isError,
...result.error ? { error: result.error } : {},