Repository navigation
Gemini 3 Bots finish a tool call on ADK, AG2, CrewAI, Langroid, Mastra and Strands - #2397
Merged
Merged
Conversation
…every engine A Bot on Gemini 3 or later on Google ADK, AG2, CrewAI, Langroid, Mastra or Strands stopped once a tool's result came back: Google refused the next request with "Function call is missing a thought_signature in functionCall parts". The call comes back from the thread without the signature Gemini gave it, and Gemini checks the first call of each step in the current turn. - CrewAI keeps the real signature, as the LangGraph engines do: it leaves on the call as its AG-UI encryptedValue in the run's snapshot, and goes back to Gemini from the thread. - ADK already keeps it within the process that made the call. - Where an engine cannot carry it (and for a thread that has none), the call goes with Google's documented placeholder, skip_thought_signature_validator: shared/gemini_signatures.py for the Python engines, at the HTTP request as run_model_key.py does, and a fetch on Mastra's compatible-endpoint model client. Only a Chat Completions request for a Gemini 3+ model, on Google's host or OpenBot's model gateway, is changed; a real signature is kept. First found by lorenzejay in #2365.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 28, 2026 20:05
…gnature # Conflicts: # CHANGELOG.md # agent-adk/Dockerfile # agent-ag2/Dockerfile # agent-crewai/Dockerfile # agent-langroid/Dockerfile # agent-mastra/src/mastra/index.test.ts # agent-mastra/src/mastra/index.ts # agent-strands/Dockerfile
…gnature # Conflicts: # agent-adk/Dockerfile # agent-crewai/Dockerfile # agent-langroid/Dockerfile # agent-strands/Dockerfile
…gnature # Conflicts: # CHANGELOG.md
10 tasks done
lorenzejay
added a commit
to lorenzejay/OpenBot
that referenced
this pull request
Dec 1, 2026
The CrewAI Bot's main.py takes this branch's side; the next commit carries main's Gemini thought signatures (CopilotKit#2397), progress reminders (CopilotKit#2436, CopilotKit#2443) and empty-turn rule (CopilotKit#2449) into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lorenzejay
added a commit
to lorenzejay/OpenBot
that referenced
this pull request
Dec 1, 2026
…ain's Gemini and reminder rules The conversational Agent now does what the Bot on main did: - A tool whose name CrewAI changes for the model (`showNote`, `askApproval`, `mcp__...`) is handed back under the server's name. The model calls it by `sanitize_tool_name`, and the hand-back looked it up by the server's name, so the turn answered "Handed to the caller to run." - A handed-back call leaves out the `null`s its own schema did not ask for. CrewAI offers tools in strict mode, so every optional field came back as `null`. - A `developer` message is kept as an instruction and left out of CrewAI's session, whose messages have no such role. It refused the whole run. - An empty `OPENAI_BASE_URL` or `ANTHROPIC_BASE_URL` is unset. The providers' own SDKs took `""` as the address, and every OpenAI run failed with `APIConnectionError`. - The model runs on CrewAI's own client for OpenAI, Anthropic and Google, whatever it is called. CrewAI sent a model it has not heard of (Gemini on the model gateway, `qwen/qwen3-8b`) to LiteLLM, which offered it no tools. - The words the model said in a step that called tools are the reply's content. CrewAI keeps that step with none, so a line on a long job never reached the person. From main: Gemini's thought signature goes out on the handed-back call's `encryptedValue` and back to Gemini, with Google's placeholder only for a call the thread has none for (CopilotKit#2397); the progress reminder after five silent steps (CopilotKit#2436, CopilotKit#2443), added to the latest result where CrewAI would take a note in the person's turn for the request; the empty-turn rule (CopilotKit#2449); `google` as `gemini/`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
What a person saw. A Bot on Gemini 3 or later (
gemini-3.8-flash, Gemini 4) on Google ADK, AG2,CrewAI, Langroid, Mastra or Strands stopped as soon as one of its tools returned. The tool ran, and
the next model call failed with Google's 400: "Function call is missing a thought_signature in
functionCall parts". That happens with a Gemini key saved in Settings or OpenBot Desktop (Google's
OpenAI-compatible endpoint) and on OpenBot Cloud's AI connection (the model gateway). The LangGraph
engines were fixed in #2334 and #2335.
Why. Gemini 3+ gives the first function call of each model step a thought signature and refuses
a request whose current turn holds a step whose first call comes back without it
(Google's thought signatures guide). OpenBot
runs the tool between two runs and hands the call back from the thread, and these engines sent it
back unsigned.
The fix, per engine, checked against what each framework does today:
encryptedValuein the run's snapshot, and sends it back from the thread asextra_content.google.thought_signature, to a Gemini model only.it).
ag_ui_adksends no signature out with a client tool's call, so a fresh process (a restart oranother replica) has none in the thread.
Mastra (
@ai-sdk/openai) not at all on an OpenAI-compatible endpoint. Checked on the latestreleases (AG2 1.3.4,
@ai-sdk/openai4.0.125,ag-ui-adk,strands-agents,ag-ui-langroid):no bump fixes it.
documented placeholder for a call whose signature is not available,
skip_thought_signature_validator. For the Python engines that isshared/gemini_signatures.py,applied at the HTTP request the way
run_model_key.pyputs a run's key in (each framework buildsits request its own way, and all send through
httpx). For Mastra it is afetchgiven to itscompatible-endpoint model client only.
Narrow on purpose. Only a POST to Chat Completions, on Google's own host or OpenBot's model
gateway, for a Gemini 3+ model, is touched, and only the first call of a step that has no signature.
A real signature is kept. Every other request to every other provider and model is sent as before.
Compared with #2365 this leaves out the
BOT_PROVIDER=googlemodel-name and AG2GeminiConfigchanges (and the
ag2[gemini]extra), the nativegenerateContentandaiohttpsigning (LiteLLMalready adds the placeholder on that path), the LlamaIndex and LangGraph changes, and the model check
script.
First found by lorenzejay in #2365.
Where it runs
call's
encryptedValue; the placeholder is decided from each request alone.the signature from the thread, and the other engines send the placeholder. Tested as a fresh
process.
Boundary and audit
changes.
API and database
api/, no app's requests, no database change and norelease-policy.json.Changelog
CHANGELOG.mdunderUnreleased.Proof
Regression tests, each red on
main's engine source and green on this branch. A fake Gemini atits OpenAI-compatible endpoint (
fake_geminiinshared/harness_contract.py) gives a signedlook_up_ordercall in run one and holds run two to Google's rule. Run two hands the call back theway the server does, to the same process and to a fresh one:
mainindex.test.ts)gpt-5.5request goes unchangedagent-adk/tests/test_gemini_signatures.pychecks the rule itself: which models, which hosts, areal signature kept, and other providers and Gemini 2.x left alone.
Full suites on this branch: ADK 57, AG2 28, CrewAI 29, Langroid 30, Strands 24, Mastra 40, all pass.
biome format,biome lintandtypecheckare clean.Live, on Google's OpenAI-compatible endpoint with
gemini-3.8-flash. A real call in run one,then its result handed to a fresh process: