feat: add configurable effort levels for thinking budget#105
Open
guidan-nick wants to merge 5 commits into
Open
feat: add configurable effort levels for thinking budget#105guidan-nick wants to merge 5 commits into
guidan-nick wants to merge 5 commits into
Conversation
Add native Kiro effort parameter support to control thinking/reasoning depth.
Kiro ignores Anthropic's budget_tokens/max_thinking_length and instead uses
its own effort levels (low/medium/high/xhigh/max) passed via
additionalModelRequestFields.output_config.effort.
Changes:
- Add effort and auto_effort_mapping config options to schema
- Add effort.ts with budget-to-effort mapping logic
- Modify sdk-client to inject additionalModelRequestFields via middleware
- Update request pipeline to resolve and pass effort through
- Add unit tests for effort resolution
Effort levels:
- low: minimal reasoning
- medium: balanced (default, ~20k tokens)
- high: deeper reasoning (~50k tokens)
- xhigh: extended (opus-4.7/4.8 only, ~80k tokens)
- max: maximum depth (128k tokens on opus-4.7/4.8)
Usage in kiro.json:
{ "effort": "max" } // explicit effort level
{ "auto_effort_mapping": true } // map OpenCode budget to effort (default)
Fixes thinking budget being capped at 20k regardless of OpenCode settings.
OpenCode sends thinkingBudget in body.thinkingConfig (not body.providerOptions.thinkingConfig). Update budget extraction to check both locations. Also update budget-to-effort mapping to align with OpenCode's standard variant values: - 8192 (low) -> effort low - 16384 (medium) -> effort medium - 24576 (high) -> effort high - 32768 (max) -> effort max
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.
Summary
Add native Kiro effort parameter support to control thinking/reasoning depth. This fixes the issue where OpenCode's thinking budget settings are ignored because Kiro uses its own
effortlevels instead of Anthropic'sbudget_tokens/max_thinking_length.Problem
When using thinking models (e.g.,
claude-opus-4-8-thinking) through the Kiro auth plugin, the thinking budget is capped at ~20k tokens regardless of OpenCode'smaxthinking setting. This is because Kiro ignores Anthropic's native thinking parameters and instead requires effort to be passed viaadditionalModelRequestFields.output_config.effort.Solution
Inject the
additionalModelRequestFieldswith the resolved effort level into API requests via SDK middleware.Changes
effortandauto_effort_mappingconfig optionsadditionalModelRequestFieldsvia middleware when effort is setEfforttype and extendSdkPreparedRequestEffort Levels
Configuration
Testing
npm run build)References
/effortcommand: low, medium, high, xhigh, max