Skip to content

Fix issues and refactor thinking efforts#2178

Merged
dgageot merged 2 commits intodocker:mainfrom
dgageot:efforts
Mar 19, 2026
Merged

Fix issues and refactor thinking efforts#2178
dgageot merged 2 commits intodocker:mainfrom
dgageot:efforts

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 19, 2026

No description provided.

dgageot added 2 commits March 19, 2026 18:20
…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
@dgageot dgageot requested a review from a team as a code owner March 19, 2026 17:38
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dgageot dgageot merged commit 7311fc1 into docker:main Mar 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants