Skip to content

fix: auto-retry effort-capability 400s on models that predate newer effort tiers (v4.8.58)#491

Merged
askalf merged 1 commit into
masterfrom
fix/effort-capability-retry
Jun 10, 2026
Merged

fix: auto-retry effort-capability 400s on models that predate newer effort tiers (v4.8.58)#491
askalf merged 1 commit into
masterfrom
fix/effort-capability-retry

Conversation

@askalf

@askalf askalf commented Jun 10, 2026

Copy link
Copy Markdown
Owner

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 —

claude-opus-4-5-20251101 + DARIO_EFFORT=max →
400 "This model does not support effort level 'max'. Supported levels: high, low, medium."

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.
  • Retry once with output_config.effort clamped to the strongest supported level (bestSupportedEffort: xhigh > max > high > medium > low) — value-only in-place mutation, JSON field order (a fingerprint surface) untouched.
  • Supported set cached per wire model (effort support is a model property, not an account property); the body-build path clamps up front on every later request — the 400 round-trip is paid once per model per process.
  • If the 400 matches but there's no output_config.effort to 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 measured resolveEffort clamp.

Tests

  • New test/effort-capability.mjs — 16 assertions on the live-observed wire shape, parser negatives, and clamp preference.
  • Full suite 86/86; tsc clean. Lockfile re-synced in-PR.

Post-merge

Will deploy to the box and re-run the prod smoke battery (the opus-4-5 case should flip to PASS).

…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.
@github-actions

Copy link
Copy Markdown
Contributor

Compat test: ✅ PASSED

Ran node test/compat.mjs against dario proxy --passthrough on the self-hosted runner for commit b08aeb6a2e94f8cf970049a8dabcbe1f5e3dcaa7.

Output
============================================================
  dario Compatibility Validation (--passthrough via dario)
  2026-06-10T21:50:38.905Z
============================================================

--- Anthropic Messages API (Hermes) ---
✅ #1 Anthropic non-stream: "COMPAT OK" | thinking_injected=false | service_tier=-
✅ #2 Anthropic stream: 8 events | order=correct | "**STREAM COMPAT**"
✅ #3 SSE framing: event:/data: pairs correctly paired

--- Passthrough Verification ---
✅ #4 No thinking injection: No thinking block in response (passthrough clean)
✅ #5 Client betas preserved: Client-requested thinking honored (status=200)

--- Tool Use (OpenClaw) ---
✅ #6 Tool use: tool=get_weather | input={"location":"Tokyo"}
✅ #7 Tool use stream: 11 events | tool_use=true | input_json_delta=true

--- OpenAI Compat ---
✅ #8 OpenAI non-stream: "OPENAI COMPAT"
✅ #9 OpenAI stream: 3 chunks | [DONE]=true | "**STREAM OPENAI**"

--- Header Visibility ---
✅ #10 Header visibility: request-id=true | ratelimit=true (12 headers)

============================================================
  RESULTS: 10 passed, 0 failed, 0 warnings
============================================================

Full workflow run

@askalf askalf merged commit 1a79987 into master Jun 10, 2026
12 checks passed
@askalf askalf deleted the fix/effort-capability-retry branch June 10, 2026 21:54
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.

1 participant