Files
OmniRoute/tests
Diego Rodrigues de Sa e Souza 41fa3df7d1 fix(translator): merge consecutive same-role contents for Gemini (port from 9router#2191)
The OpenAI->Gemini request translator built result.contents without a
consecutive-same-role merge pass (unlike the Kiro and Claude request paths).
Client history with adjacent user turns — or a tool-result turn (mapped to
role:"user") immediately followed by a plain user turn — produced two adjacent
role:"user" entries, which Gemini-family endpoints (incl. Antigravity / Vertex)
reject with 400 INVALID_ARGUMENT "Request contains consecutive messages with the
same role". The empty-parts half was already guarded (if parts.length > 0).

Collapse adjacent same-role entries by concatenating their parts right after the
message-conversion loop. Regression guard reproduces both the two-user and the
tool-result-then-user cases and asserts a normal alternating conversation is
unchanged.

Reported-by: warelik (https://github.com/decolua/9router/issues/2191)
2026-06-30 14:57:46 -03:00
..
2026-06-17 19:26:32 -03:00
2026-05-23 01:46:59 -03:00
2026-06-20 07:09:43 -03:00
2026-06-19 06:49:01 -03:00
2026-06-10 13:49:08 -03:00
2026-06-30 06:54:29 -03:00
2026-06-13 17:27:40 -03:00