fix: Filter [REDACTED] placeholder in OpenRouter Gemini 3.0 Pro reasoning#2742
fix: Filter [REDACTED] placeholder in OpenRouter Gemini 3.0 Pro reasoning#2742wzyfromhust wants to merge 1 commit intochatboxai:mainfrom
Conversation
…ning Fix duplicate reasoning panel issue when using OpenRouter with google/gemini-3-pro-preview. Gemini 3.0 Pro returns encrypted reasoning summary at the end of response, which the OpenRouter SDK converts to [REDACTED] placeholder. This caused an extra reasoning panel to be displayed in the UI. The fix filters out [REDACTED] specifically for models containing 'gemini-3-pro' in their model ID.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fix: Filter [REDACTED] placeholder in OpenRouter Gemini 3.0 Pro reasoning
Problem
When using OpenRouter with
google/gemini-3-pro-previewmodel, two reasoning panels were displayed in the UI:[REDACTED]with 0.0s duration (should NOT be displayed)Root Cause
This issue is specific to OpenRouter's Gemini 3.0 Pro Preview model.
reasoning.encrypted)[REDACTED]placeholderInvestigation Details
Tested OpenRouter API directly and observed the response format:
The SDK converts
reasoning.encryptedto[REDACTED]as a placeholder for encrypted content.Solution
Modified
src/shared/models/abstract-ai-sdk.ts(lines 357-370) to filter out the[REDACTED]placeholder specifically for Gemini 3.0 Pro models:Model ID matching logic: The fix applies to any model ID containing
gemini-3-pro, which currently matches:google/gemini-3-pro-preview✅Impact
gemini-3-proin their model IDTesting
Verified with OpenRouter +
google/gemini-3-pro-preview:[REDACTED]placeholder no longer creates a visible panel