You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Anthropic "Extra usage is required for long context requests" causes infinite retries #18684
When Anthropic returns the error "Extra usage is required for long context requests" (billing tier context limit), opencode classifies it as a retryable API error and retries indefinitely with exponential backoff (observed up to attempt #7 with 2-minute delays).
This error means the prompt exceeds the user's billing tier context window — retrying will never succeed. The correct behavior is to treat it as a context overflow and trigger compaction.
Steps to reproduce
Use an Anthropic API key on a billing tier with a standard context limit
Have a session grow large enough that the prompt exceeds the tier's context window
Observe: Extra usage is required for long context requests. [retrying in 2m attempt #7]
Expected behavior
The error should be classified as context_overflow (same as "prompt is too long"), triggering compaction to reduce context size.
Actual behavior
Classified as a retryable API error. Retries indefinitely, never compacts, and can corrupt session message state from repeated partial writes.
Activity
github-actions commentedon Mar 23, 2026
This issue might be a duplicate of existing issues. Please check:
Please review these issues and consider whether this can be addressed there, or if this report adds new context worth tracking separately.
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.