mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
* fix(providers): use native reasoning mode for direct Gemini API, keep CLI tagged Gemini 2.5+ delivers reasoning via native thinkingParts (thinkingConfig. includeThoughts). Having tagged mode active at the same time injects a <think>…</think>/<final>…</final> directive into the system prompt; the model opens a <think> block before a tool call, never closes it, and returns an empty post-tool turn (content:[], payloads=0 error, #69220). Fix: override resolveReasoningOutputMode in buildGoogleProvider() only — not in the shared GOOGLE_GEMINI_PROVIDER_HOOKS. The Gemini CLI backend (google-gemini-cli) runs gemini --output-format json and parses a text response field, not native thought parts; it must stay on tagged mode. A regression test confirms google-gemini-cli remains "tagged". Also remove the dead BUILTIN_REASONING_OUTPUT_MODES entry keyed on "google-generative-ai" from provider-utils.ts — that string is only ever the transport model.api value, never the provider id passed to resolveReasoningOutputMode, so the map was unreachable. Fixes #69220 * docs: clarify Gemini reasoning output modes * fix(google): keep Antigravity reasoning tagged * fix(google): default direct reasoning checks to native * fix(google): import reasoning context from plugin entry --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>