Repository navigation
fix(antigravity-direct): carry tool_call ids on history parts for Claude targets (opencode#1550) - #5125
Merged
Conversation
…ude targets (opencode#1550)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of the opencode#1550 fix (the schema half was #5110)
Live verification of #5110 caught a second, distinct Claude-leaf 400 in the route ledger minutes after deploy: a
workhorsesession succeeded on the leaf at 20:20:02Z, then its next step 400'd at 20:20:18Z with a different Anthropic error:Root cause (reproduced + probed live)
Any request whose history contains an assistant tool call 400s on the Claude leaf. The door converted OpenAI tool calls to v1internal
functionCallparts with no id (Gemini pairs calls by name/order and never needed one). For Claude models the upstream's v1internal→Anthropic conversion emits onetool_useblock perfunctionCallpart — with no id — and Anthropic rejects it. Adding the id tofunctionCallmoved the error to the result side (tool_result.tool_use_id: Field required), confirming the proto'sidfield on both part kinds is the interop channel.Probed against a scratch instance of this door on the real upstream before merging: history with a single call, parallel calls, two full tool rounds, and streaming — all 400 before, all 200 after. First turns were never affected; every continuation was.
Fix
For Claude targets only (
anthropicflag from part 1):functionCallparts carry the client'stool_callid;functionResponseparts carry the matchingtool_call_id.tool_useids; replaying the same id keeps the round trip consistent) — the door's mintedcall_<uuid>shape remains the fallback.Gemini payloads are byte-identical to before (ids stay off that path).
Tests
node --test bin/antigravity-direct.test.mjs— 21/21 (19 + 2 new, same stub-upstream harness): Claude history reaches upstream with matching ids on both part kinds; Gemini history stays id-less.The fork twin lands in developing-today/opencode under the same issue.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.