|
Environment: dsh 0.1.3-alpha.1 ( Problem: the upstream model returned the same and the whole session becomes unusable (every follow-up re-sends the same history). Evidence: session history contains Suggested fix: guarantee tool-call ids are unique across the session when appending assistant Related: #1593 (tool result referencing a missing call id also bricks a session with provider 400s). |
Replies: 1 comment
|
Checked both source claims against current master, both exact. message.ts:238 is really the verbatim passthrough: toolCallId: input.callId, no transformation. And assembler.ts:115 is really id: partial.toolCallId ?? brandString( Worth connecting this to #1593, which argszero investigated in depth: that one is the mirror case, a tool/result referencing a call id that was never emitted at all (orphan result instead of your duplicate/collision). Same underlying gap either way: nothing between history assembly and wire serialization checks that assistant tool_calls and the following tool messages actually correspond one-to-one. argszero's writeup there also names two more related threads (#1449, #1519) covering truncated/replayed tool-call arguments hitting the same seam. Four separate trigger paths into one missing validation is a stronger case for a real fix than any one report alone, might be worth linking your report into that family when raising it. Your fix direction (rewrite the later duplicate and remap the matching tool message before it reaches serialization) matches the pattern argszero suggested for the orphan case too: catch it at assembly/serialize time with a fail-fast or auto-correct pass, rather than only after a provider round-trips a 400. |
Checked both source claims against current master, both exact.
message.ts:238 is really the verbatim passthrough: toolCallId: input.callId, no transformation. And assembler.ts:115 is really id: partial.toolCallId ?? brandString(
call-${index}) — that fallback only fires when the model gives no id at all, so it genuinely can't be the source of a repeated id like you already ruled out. I also grepped the whole llm package tree for anything resembling a uniqueness check on tool call ids (a Set, a dedup pass, anything) and found nothing at all. So "no session-wide uniqueness guarantee" isn't just plausible, it's confirmed by absence.Worth connecting this to #1593, which argszero investigated …