Skip to content

fix(antigravity): restore inline image attachment and add GeminiCLI tests - #206

Open
warelik wants to merge 5 commits into
kaitranntt:mainfrom
warelik:ao/airouters-9-gemini-images-tests
Open

fix(antigravity): restore inline image attachment and add GeminiCLI tests#206
warelik wants to merge 5 commits into
kaitranntt:mainfrom
warelik:ao/airouters-9-gemini-images-tests

Conversation

@warelik

@warelik warelik commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restore collectFunctionResponsesWithSiblingInlineData in antigravity/gemini so inline image attachments that follow tool results are preserved and attached to the nearest functionResponse.
  • Port image-preservation tests for antigravity Gemini and OpenAI Responses translators.
  • Add unit tests for the GeminiCLI translator paths (claude/gemini-cli, gemini/gemini-cli, gemini-cli/gemini, gemini-cli/openai/responses, openai/gemini-cli) covering happy path, system instructions, tools, tool calls/responses, and usage fields.
  • Fix gemini-cli/gemini fixCLIToolResponse to also collect sibling inlineData/inline_data parts and attach them to the nearest functionResponse.
  • Restructure antigravity/gemini sibling image test to use explicit modelCalls and extraChecks table fields instead of name-keyed assertions.
  • Fix misplaced doc comments in gemini-cli/gemini helpers.

Verification

  • go test ./... passes.
  • go build -o test-output ./cmd/server && rm test-output succeeds.
  • gofmt -w . applied.

Claim

This PR is opened by @warelik and is ready for review.

@warelik

warelik commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Claimed by @warelik.

@warelik
warelik force-pushed the ao/airouters-9-gemini-images-tests branch from d90a3b1 to 46bbccc Compare August 21, 2026 15:52

@warelik warelik left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — no blocking findings (posted as COMMENT; GitHub rejects APPROVE on your own PR).

The fix restores collectFunctionResponsesWithSiblingInlineData and its helpers in internal/translator/antigravity/gemini. I verified the restored helpers and the full fixCLIToolResponse are byte-identical to the stock upstream implementation (router-for-me/CLIProxyAPI), so this is a true parity restore. The behavior change — sibling inline_data/inlineData parts are attached to the nearest functionResponse instead of being silently dropped with the rest of the content — is covered by six table cases, an end-to-end ConvertGeminiRequestToAntigravity test, and two OpenAI Responses → Antigravity tests (single and parallel tool calls). I traced each new GeminiCLI test assertion against the corresponding implementation (claude/gemini-cli, gemini-cli/gemini, gemini-cli/openai/responses, gemini/gemini-cli, openai/gemini-cli); all match actual behavior, and no existing test depends on the old dropping behavior.

Two non-blocking notes inline: (1) the new antigravity table test keys input construction and extra assertions off tt.name literals, so renaming a subtest silently skips checks; (2) the same sibling-image loss still exists in the fork-only gemini-cli/gemini grouping and is worth a follow-up.

Ready to merge from my side.

Comment thread internal/translator/antigravity/gemini/antigravity_gemini_request_test.go Outdated

@warelik warelik left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — both notes from the previous review are addressed.

  1. gemini-cli/gemini now ports the sibling-inlineData collector (normalizeInlineDataPart, attachInlineDataToFunctionResponse, collectFunctionResponsesWithSiblingInlineData); I verified the port matches the antigravity/stock logic exactly, and the new TestConvertGeminiRequestToGeminiCLI_PreservesSiblingToolImage traces correctly end to end (snake_case sibling absorbed into camelCase functionResponse.parts, grouping and id preserved). This also fixes the OpenAI Responses → GeminiCLI chain flagged before.
  2. The antigravity table test now uses explicit modelCalls / extraChecks fields — coverage is preserved case-for-case, and renaming a subtest no longer changes what runs.

One cosmetic should-fix inline: the helper insertion split the backfillFunctionResponseName doc comment, so a wrong description now sits on normalizeInlineDataPart and a dangling fragment above backfillFunctionResponseName. Not blocking — a one-line tidy before merge.

Ready from my side.

Comment thread internal/translator/gemini-cli/gemini/gemini-cli_gemini_request.go Outdated

@warelik warelik left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — the doc-comment placement flagged last round is fixed: normalizeInlineDataPart and attachInlineDataToFunctionResponse now carry accurate one/two-line docs, and the original backfillFunctionResponseName comment is restored intact. The delta since the already-approved b63c24e3 is comments-only, so prior verification stands: the antigravity restore is byte-identical to stock upstream, the gemini-cli/gemini port matches that logic, and the table-test refactor preserves coverage case-for-case.

Ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant