Add Gemini 3 models with thought-signature support

Signatures ride the assistant message as a _gemini sidecar and are reattached in tool loops.
Thought-flagged parts are filtered from answer text; foreign sidecars stripped on the OpenAI wire.
Live-verified both Gemini 3 models end-to-end; without the echo they 400 on every tool loop.
This commit is contained in:
Rohit C Prasad
2026-07-22 14:05:23 -07:00
committed by Rohit P
parent 878b858ece
commit a63710ecfe
9 changed files with 247 additions and 22 deletions
+4
View File
@@ -896,6 +896,10 @@ def _assistant_message(turn: AssistantTurn) -> dict[str, Any]:
"content": turn.text or "",
"ts": time.time(),
}
if turn.extras:
# Provider-private sidecars (e.g. `_gemini` thought signatures) persist with the
# message; the owning provider reattaches them, the rest strip them (base.py).
message.update(turn.extras)
if turn.tool_calls:
message["tool_calls"] = [
{