fix: auto-retry effort-capability 400s on models that predate newer effort tiers (v4.8.58)#491
Merged
Merged
Conversation
…ffort tiers (v4.8.58)
The autodetected catalog (v4.8.57) exposes models like opus-4-5 that 400
on the box's DARIO_EFFORT=max pin ("does not support effort level 'max'.
Supported levels: high, low, medium" — live smoke catch). Mirror the
context-1m/beta rejection machinery: parse the supported set, retry once
with output_config.effort clamped to the strongest supported level, cache
per wire model, clamp up front thereafter. Field order untouched; fable's
soft-refusal clamp unaffected. test/effort-capability.mjs, suite 86/86.
Contributor
Compat test: ✅ PASSEDRan Output |
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.
What
Same-day smoke catch on the v4.8.57 autodetected catalog: newly-exposed older models hard-400 under a pinned effort the model doesn't support —
Fix
Mirrors the existing context-1m / anthropic-beta rejection machinery (one method, not another special case):
parseEffortRejection()extracts the rejected level + the model's supported set from the 400 body.output_config.effortclamped to the strongest supported level (bestSupportedEffort: xhigh > max > high > medium > low) — value-only in-place mutation, JSON field order (a fingerprint surface) untouched.output_config.effortto clamp, the original upstream error forwards unchanged (the branch consumes the body, so it forwards inline).fable unaffected: its effort intolerance is a soft refusal (200 +
stop_reason:"refusal"), invisible to 400-based machinery — stays on its measuredresolveEffortclamp.Tests
test/effort-capability.mjs— 16 assertions on the live-observed wire shape, parser negatives, and clamp preference.Post-merge
Will deploy to the box and re-run the prod smoke battery (the opus-4-5 case should flip to PASS).