fix: clamp unsupported reasoning effort to highest supported tier - #70
Open
Michael J. Jabbour (michaeljabbour) wants to merge 1 commit into
Open
Conversation
…pported range Follow-up to provider PR microsoft#61 (config-level effort support). Requesting an effort a model doesn't support (e.g. 'max' on claude-sonnet-5) previously warned per-request and OMITTED output_config.effort, silently downgrading to server default. Now clamps to highest supported tier ≤ requested (EFFORT_ORDER: low<medium<high<xhigh<max), emits clamped value in output_config.effort, and logs ONE-TIME INFO per (model, requested_effort) instead of per-request WARNING. - Exact-match models (fable-5, opus-4.8) pass through untouched - Below-floor edge handled (clamp up, tested via helper) - One legacy test updated (asserted old warn-and-omit behavior) - 25 new tests covering clamp range, legacy models, edge cases Fixes: microsoft-amplifier/amplifier-support#289 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.
Problem
Follow-up to #61 (config-level reasoning effort). When requesting
effort: maxon a model without max support (e.g., claude-sonnet-5), the provider warned per-request and OMITTEDoutput_config.effort, silently downgrading to the server's default. This created a silent behavioral change — the configured effort tier was lost, with no auditable record.Solution
Replaced warn-and-omit with clamp-and-log-once:
effort: maxon claude-sonnet-5 (supports up to xhigh) clamps toxhigh._effort_downgrade_loggedcache) as existing_warned_deprecated_models.Testing
effort: max→ exactly ONE INFO log (Effort 'max' exceeds claude-sonnet-5's supported range … using 'xhigh'), both turns returned 200 OK witheffort: xhighin output_config.Implementation Detail
The
EFFORT_ORDERconstant is the single source of truth for tier ordering and is used in both the global config validation (which only validates that an effort string is recognized, not model-supported) and the per-model gate (which applies the clamp). This avoids duplicating model-aware logic in two places.Compatibility
mount(),complete(), or other public contractsFixes microsoft-amplifier/amplifier-support#289 (follow-up to #61)