Commit Graph
1 Commits
Author SHA1 Message Date
yetone 7067fce5ec gateway: a turn's parallel tool calls split over two assistant messages keep their results on Chat, Cursor and Devin (#1275)
An Anthropic request may send one turn's tool_use blocks in consecutive
assistant messages, answered by one user message. buildChat's
pairToolMessages, cursorMessages and buildDevin each closed the first
message's calls at the second one: the calls were answered "interrupted"
and the real results went out as a stray user message (Chat) or were
dropped (Cursor, Devin). joinSplitCalls now joins an assistant message
onto an assistant message before it that made tool calls, as Anthropic
reads them, so the calls are pending together. Responses, Messages,
Kiro and Gemini/Code Assist already kept the results.

Tests (split_calls_test.go): Chat, Cursor and Devin split cases fail on
main and pass now; a truly unanswered call of a split turn still gets
the synthetic result; text after a call in its own message; two text-only
assistant messages unchanged; Responses guard.
2026-10-08 16:47:52 +08:00