Skip to content

fix(antigravity): drop messages whose parts become empty after thought filtering - #3366

Open
Lucifer07 wants to merge 1 commit into
decolua:masterfrom
Lucifer07:fix/antigravity-drop-empty-parts
Open

fix(antigravity): drop messages whose parts become empty after thought filtering#3366
Lucifer07 wants to merge 1 commit into
decolua:masterfrom
Lucifer07:fix/antigravity-drop-empty-parts

Conversation

@Lucifer07

Copy link
Copy Markdown

Problem

When an assistant message contains only reasoning/thought parts (no text, no tool calls), the part filter in open-sse/executors/antigravity.js strips every part, leaving parts: []. The Antigravity/Gemini API rejects this with HTTP 400 INVALID_ARGUMENT ("Request contains an invalid argument."), breaking long agent conversations that include thinking-only turns.

Fix

Filter out messages whose parts become empty after the thought-part filtering, so no empty-parts message is sent upstream.

}).filter(c => c.parts?.length > 0);

Verification

Reproduced the exact 400 through a live router, then confirmed the fix returns 200 with a valid stream for: thinking-only assistant turns, normal requests, and tool-call histories.

…t filtering

When an assistant message contains only reasoning/thought parts (no text,
no tool calls), the part filter strips every part, leaving parts: []. The
Antigravity/Gemini API rejects this with HTTP 400 INVALID_ARGUMENT
("Request contains an invalid argument."), breaking long agent
conversations that include thinking-only turns.

Filter out such messages after mapping contents so no empty-parts message
is sent upstream.
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