fix: bedrock reasoning double emission - #5388
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughBedrock request conversion now removes consumed reasoning fields from forwarded additional model request fields. Unit and provider harness tests cover Anthropic and Nova reasoning inputs across Converse, streaming, and native chat completion routes. ChangesBedrock reasoning deduplication
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "fix: bedrock reasoning double emission" | Re-trigger Greptile |
7834f85 to
dd9aa5f
Compare
6733b11 to
af654ad
Compare
dd9aa5f to
5e28f23
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/providers/bedrock/bedrock_test.go`:
- Around line 6917-6931: Update the reasoning-key assertions in the test case
around tc.wantKey to collect all three possible keys—thinking, reasoning_config,
and reasoningConfig—and assert that the emitted key list contains exactly and
only tc.wantKey. Remove the incomplete pairwise checks while preserving the
existing per-provider expected-key coverage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: afcae487-e71c-482c-8414-b22791722152
📒 Files selected for processing (3)
core/providers/bedrock/bedrock_test.gocore/providers/bedrock/responses.gotests/e2e/api/collections/provider-harness.json
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/e2e/api/collections/provider-harness.json
- core/providers/bedrock/responses.go
Merge activity
|
The base branch was changed.
af654ad to
d024282
Compare

Summary
Fixes a follow-on regression from #5108 where a reasoning key (
reasoning_config,thinking, or Nova'sreasoningConfig) consumed intoParams.Reasoningduring Bedrock Converse ingress was also forwarded verbatim viaadditionalModelRequestFieldPaths. This caused the Bedrock egress to carry two copies of the reasoning field — the re-synthesizedthinkingplus the passthrough — and Converse rejected the collision with"The additional field thinking/type conflicts with an existing field".Changes
ToBifrostResponsesRequest, whenParams.Reasoninghas been populated, the consumed reasoning keys (thinking,reasoning_config,reasoningConfig) are stripped from the clonedadditionalModelRequestFieldsbefore forwarding viaadditionalModelRequestFieldPaths. Non-reasoning fields likeoutput_configare left in place and continue to be deep-merged on egress.TestReasoningConfigNoDoubleEmissionOnEgresscovering all three reasoning key spellings (Anthropicreasoning_config, Anthropicthinking, and NovareasoningConfig) to assert that exactly one reasoning key appears on the egress wire and no collision occurs./bedrock converse,/bedrock converse-stream, and native/v1/chat/completionsentry points, asserting that Bedrock never returns a field-collision error.Type of change
Affected areas
How to test
Send a Bedrock Converse request with
reasoning_configinsideadditionalModelRequestFieldsto the/bedrock/model/<model>/converseroute and confirm the response does not contain"conflicts with an existing field"or"Remove thinking/".Breaking changes
Related issues
Closes #5108
Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines