daoche_wuzui (X, v0.1.4095): magpie's Gemini route ignored Gemini's built-in
tools. A generateContent body's googleSearch/urlContext/codeExecution were
dropped in parseGemini, so the model never searched and no
groundingMetadata came back.
- ir.Request carries GoogleTools. parseGemini keeps googleSearch (and
google_search_retrieval), urlContext and codeExecution; chat's tools
read them in both shapes ({"googleSearch":{}} and {"type":"url_context"}).
- buildCodeAssistSent, shared by Code Assist, AI Studio, Vertex and plugins
spoken to on Code Assist, sends them when no function is declared
(Google refuses built-ins beside functionDeclarations), Gemini models only.
- A plugin whose API is googleapis.com (Antigravity) now searches itself
for Anthropic web_search, like the built-in Gemini accounts.
- The Gemini reply carries groundingMetadata (chunks + webSearchQueries),
streamed and not; executableCode/codeExecutionResult parts are read
as text instead of being lost.
Run:
- mote-run at 3dc1f13ed (before rebasing onto 27 newer commits):
go test -tags nogui ./internal/gateway ./internal/provider ok (916s, 139s);
go vet both; GOOS=windows go vet ./... ok; GOOS=linux go vet -tags nogui
./... ok; gofmt -l clean.
- At 80f1e05a3 (the rebase after it only took agent, claude and davsync commits): go vet and GOOS=windows go vet of gateway and provider ok; go test -run "Gemini|CodeAssist|Search|Google|Antigravity|AIStudio|Vertex|Chat|Plugin" ./internal/gateway ok (83s); go test ./internal/provider ok (136s).
- Broken by hand, each red: googleToolsFor, googlePlugin, the reply's
grounding, the ranCode decode, chatGoogleTool.
- Real account, sandbox HOME (Antigravity plugin, gemini-3.8-flash-low),
the plugin patched in the sandbox to log what magpie sent it:
- generateContent with googleSearch+urlContext+codeExecution: the three
tools reached the plugin, the reply had groundingMetadata (3 chunks,
webSearchQueries).
- streamGenerateContent: groundingMetadata in the stream.
- /v1/chat/completions with {"googleSearch":{}},{"type":"url_context"}:
both reached the plugin, a grounded answer came back.
- /v1/messages web_search_20250305: googleSearch sent, the reply had
server_tool_use + web_search_tool_result.
Not tried: an AI Studio key or Vertex account (unit tests only); the
Gemini CLI account (Google refuses individual Code Assist now); real
code-execution parts (Antigravity's model wrote code as text); whether
Antigravity honours urlContext (a fetch gave the same stale page with and
without it). Anthropic web_fetch is not mapped to urlContext. The full
./... suite is queued behind six runs on mote's suite.lock and had not
run when this was pushed.