Fix issues and refactor thinking efforts#2178
Merged
dgageot merged 2 commits intodocker:mainfrom Mar 19, 2026
Merged
Conversation
…dget When a user sets thinking_budget to "xhigh" or "max" on a Bedrock model, EffortTokens() returned (0, false) causing thinking to be silently disabled. Add mappings for both levels to 32768 tokens. Assisted-By: docker-agent
Extract all thinking-effort level definitions, validation, and per-provider mappings into a dedicated pkg/effort package. This eliminates duplicated effort strings across types.go, openai, anthropic, gemini, and bedrock providers. Adding a new effort level now requires changing one file. Assisted-By: docker-agent
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
This PR successfully refactors thinking effort levels by centralizing them into a new pkg/effort package. The refactoring:
✅ Preserves all existing behavior (no regressions)
✅ Provides comprehensive test coverage (210 test cases in effort_test.go)
✅ Improves code organization and maintainability
✅ Correctly maps provider-specific effort levels
The provider-specific mappings are correct:
- OpenAI: minimal, low, medium, high, xhigh (rejects max, none)
- Anthropic: minimal→low, low, medium, high, max (rejects xhigh, none)
- Gemini 3: minimal, low, medium, high (rejects xhigh, max, none)
- Bedrock: All levels mapped to token budgets (1024-32768)
No bugs found in the changed code.
rumpl
approved these changes
Mar 19, 2026
trungutt
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.