mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
gemini-web is a stateless Web Cookie provider: it drives a real browser page and captures only the first StreamGenerate response, so it has no upstream conversation id to thread across turns. The no-tools path forwarded only the last user message (`messages.filter(m => m.role === "user").pop()`), so follow-up questions lost all prior context — e.g. "I am in Berlin" then "What should I wear today?" was answered without Berlin. Implement the issue's accepted fallback (b): flatten the full messages history into the single prompt typed into the web UI, emitting a labeled System / Previous conversation / Current user message transcript. Single-turn requests are preserved byte-for-byte (only the final user message is returned), keeping the #7286 no-tools regression guard intact. Applies uniformly to streaming and non-streaming since both derive from the same `prompt`. claude-web already threads context via its conversation cache (session.ts, #8230) and needs no change. Closes #8371