-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Closed
Description
Bug
isReasoningTagProvider() in src/utils/provider-utils.ts does not match the google provider (used by gemini-api-key auth), only google-gemini-cli and google-generative-ai. This causes reasoning/thinking output to leak directly to the end user instead of being filtered.
Steps to reproduce
- Authenticate with
gemini-api-key(creates auth profilegoogle:defaultwithmode: "api_key") - Set default model to
google/gemini-3-pro-preview(the value fromGOOGLE_GEMINI_DEFAULT_MODEL) - Send a message with thinking enabled (e.g.
thinking=low) - The user receives raw
<think>reasoning output instead of only the<final>response
Root cause
The model string google/gemini-3-pro-preview yields provider=google. But isReasoningTagProvider only checks for google-gemini-cli (OAuth) and google-generative-ai (API type, not provider ID):
// src/utils/provider-utils.ts
if (normalized === "google-gemini-cli" || normalized === "google-generative-ai") {
return true;
}This means:
reasoningTagHintisfalse— no<think>/<final>tag instructions in the system promptenforceFinalTagisfalse— no output filtering for<final>blocks- The model's thinking output passes through unfiltered to the user
Impact
enforceFinalTagis not set →<final>tag filtering is skipped (get-reply-run.ts:495,agent-runner-utils.ts:146)reasoningTagHintis not set → system prompt omits<think>/<final>formatting instructions (system-prompt.ts:340)- Affects both Telegram/channel delivery and embedded agent runs
Suggested fix
Add google to the provider check in isReasoningTagProvider:
if (normalized === "google-gemini-cli" || normalized === "google-generative-ai" || normalized === "google") {
return true;
}This aligns with:
gemini-api-keyauth creating profile withprovider: "google"(auth-choice.apply.api-providers.ts:568)GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3-pro-preview"(google-gemini-model-default.ts:4)- Model catalog tests using
providers: { google: { api: "google-generative-ai", ... } }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels