Repository navigation
fix(google): keep Claude tool results contiguous before images - #7303
yuanyuanlove wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
Scoped review at |
Summary
Fix image-bearing parallel tool-result serialization for Claude on Antigravity. Keep the complete
functionResponsebatch contiguous, followed by the existing image parts in the same user turn. Preserve all text, image bytes, call IDs and call order; do not serialize tool execution or drop images.A real Pi conversation reproducibly failed with HTTP 400 claiming that two tool results were missing, although all three results were present. A direct upstream A/B experiment used the same account and identical request parts (verified as a multiset), changing only their order:
result A, image A, result B, image B, result C: HTTP 400, missing results B/C.result A, result B, result C, image A, image B: HTTP 200, stream finished withSTOPand no error events.The experiment established protocol acceptance, not successful completion of the original UI review. No private conversation text, images, credentials or original request IDs are included in this PR. The running local installation is unchanged.
Verification
bun test tests/adapters/google/google-tool-result-adjacency.test.tsfailed on the unmodified implementation: 16 passed / 8 failed. All eight ordering cases turned green after the fix.bun test tests/adapters/google/{google-tool-result-adjacency,google-vertex-thought-signature,google-adapter,google-empty-content,google-claude-prefill-guard,google-antigravity-wire,google-antigravity-replay}.test.ts: 268 passed / 0 failed.STOP, no error events, both images preserved. No tool execution was performed.bun run typecheck: passed using a working Node executable on the test process PATH (the host Homebrew Node has a missing simdutf dynamic library).bun run privacy:scan,bun run structure:check,bun scripts/file-size-ratchet.ts,git diff --check: passed.bun run test:changedwith the repository-pinned Bun 1.4.3 selected 732 files: 17,797 passed / 34 skipped / 57 failed. The first attempt also encountered the broken host Node and inherited proxy variables. This broad run is not claimed green.HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY(and lowercase equivalents) removed only from the test process environment: 204 passed / 1 skipped / 1 failed across 10 files. The remaining failure istests/cli/cli-connect-readiness.test.ts, “a rejected preferred runtime falls back without rewriting the saved selection”: expected twodebug models --bundledprobes after--version, received only--version.8640c2f30edbd2fbb6947ed5c25e2793f5ae72a6: 26 passed / 1 skipped / 1 failed. It is not introduced by this patch. Keeping this PR draft, with that known baseline failure explicitly disclosed.Scope: only CCA routed
claude-*models change. Tests preserve CCA Gemini/other models, AI Studio, non-Argon Vertex sibling layout, and Vertex Argon nested image layout. No retries, permissions, authentication, execution scheduling, or configuration changes.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.