Skip to content

fix(proxy): support explicit opus 4.6 and 4.7 pins#497

Merged
rynfar merged 3 commits into
rynfar:mainfrom
briankeefe:briankeefe/fix-extra-usage-fallback-opus-46
May 11, 2026
Merged

fix(proxy): support explicit opus 4.6 and 4.7 pins#497
rynfar merged 3 commits into
rynfar:mainfrom
briankeefe:briankeefe/fix-extra-usage-fallback-opus-46

Conversation

@briankeefe
Copy link
Copy Markdown
Contributor

@briankeefe briankeefe commented May 7, 2026

Summary

  • catch Claude Code's shorter "You're out of extra usage" error so 1M requests fall back to the base model instead of surfacing a 500
  • keep claude-opus-4-7 as Meridian's default Opus pin for bare opus requests
  • preserve explicit claude-opus-4-6 and claude-opus-4-7 requests by passing a per-request SDK env override that survives the 1M fallback retry
  • when a resumed Opus session still gets the same extra-usage error after falling back to base opus, evict the cached session and retry once from a fresh prompt on the same model

Testing

  • bun test src/__tests__/proxy-extra-usage-fallback.test.ts src/__tests__/session-fingerprint-context.test.ts src/__tests__/errors.test.ts
  • bun test src/__tests__/errors.test.ts src/__tests__/proxy-extra-usage-fallback.test.ts src/__tests__/proxy-env-stripping.test.ts src/__tests__/models.test.ts src/__tests__/query.test.ts

@briankeefe briankeefe changed the title fix(proxy): catch extra-usage fallback and pin opus 4.6 fix(proxy): support explicit opus 4.6 and 4.7 pins May 7, 2026
@rynfar
Copy link
Copy Markdown
Owner

rynfar commented May 11, 2026

sorry for the delay ive been traveling, ill try to get to this today

Copy link
Copy Markdown
Owner

@rynfar rynfar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tight scope, mirrors existing retry patterns, comprehensive test coverage. Verified 1738/1738 tests pass locally and CI is green. Regression risk on non-opus and aliased paths is nil (envOverrides only set for explicit claude-opus-* requests). Fresh-retry is properly guarded by didYieldContent/didYieldClientEvent against post-yield retries.

@rynfar rynfar merged commit 597a304 into rynfar:main May 11, 2026
3 checks passed
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.

2 participants