mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 11:43:10 +03:00
Newer Gemini endpoints reject a request ending on a model turn with HTTP 400 'Requests ending with a model turn are not supported' — the same rejection class Claude hits via Vertex. transformRequest() previously wired stripTrailingAntigravityAssistantTurn() only into the isClaude branch, so native Gemini models routed through Antigravity kept a trailing role:model entry and hit the 400. Extend the guarded strip (never empties contents) to native Gemini models too, gated by upstreamModel including "gemini". The Claude path is untouched (byte-identical), preserving PR #6114's live validation against Vertex Claude. Flips tests/unit/antigravity-claude-prefill-strip.test.ts test (b), which previously asserted the buggy pass-through, and adds (b2) for the gemini-3-flash-agent tier. Closes #10104