feat: thinking level validation and clamping - #12
Merged
Conversation
xfgong
force-pushed
the
feat/thinking-level-validation
branch
from
May 9, 2026 17:22
b0952cb to
75e8c11
Compare
Add per-model thinking level support via thinking_level_map on Model, and implement get_supported_thinking_levels() / clamp_thinking_level() / models_are_equal() utilities mirroring pi-agent-core. Both Anthropic and OpenAI providers now clamp the requested thinking level before making API calls, preventing unsupported levels from reaching the provider. Closes #4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prefer cheaper/lower intensity when clamping unsupported thinking levels. Return True when both models are None in models_are_equal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xfgong
force-pushed
the
feat/thinking-level-validation
branch
from
May 9, 2026 17:59
b6ca34a to
7409173
Compare
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.
Closes #4
Summary
thinking_level_mapfield toModelfor per-model thinking level supportget_supported_thinking_levels()andclamp_thinking_level()utilities mirroring pi-agent-coremodels_are_equal()comparison utilitycubepi.providersTest plan
🤖 Generated with Claude Code