Skip to content

fix: recognize extra usage as long-context fallback#199

Closed
rich-jojo wants to merge 1 commit intogriffinmartin:mainfrom
rich-jojo:fix-extra-usage-fallback
Closed

fix: recognize extra usage as long-context fallback#199
rich-jojo wants to merge 1 commit intogriffinmartin:mainfrom
rich-jojo:fix-extra-usage-fallback

Conversation

@rich-jojo
Copy link
Copy Markdown

@rich-jojo rich-jojo commented Apr 15, 2026

Summary

  • treat You're out of extra usage responses as long-context fallback signals inside isLongContextError()
  • let the existing 1M beta exclusion path retry at 200k context instead of failing Opus/Max requests outright
  • add regression coverage for the extra-usage response in src/betas.test.ts

Related issue

Primary issue: #159
Closes #159.
Helps #188.

Testing

  • corepack pnpm run format
  • corepack pnpm run lint
  • corepack pnpm run build
  • node --test --experimental-strip-types src/betas.test.ts
  • corepack pnpm test (still fails on pre-existing ESM temp-module loading errors in src/credentials.test.ts and src/index.test.ts under this local Node 24 environment)

Checklist

  • PR title follows Conventional Commits (feat:, fix:, docs:, chore:, etc.)
  • make all passes locally (runs lint, build, and test)
  • Tests added or updated where applicable
  • README or docs updated where applicable

@rich-jojo rich-jojo closed this Apr 20, 2026
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.

isLongContextError misses 'out of extra usage' error, breaking 1M context fallback

1 participant