Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes #40241
Type of change
What does this PR do?
When an organization uses a one-minute LLM limit window, some providers report the exhausted window as a non-standard HTTP 400 response with a JSON
detailcontainingrate limit exceeded. OpenCode previously treated that response as terminal and stopped session processing.This PR adds the provider-local opt-in
provider.<id>.options.retry400RateLimit. When enabled, the existing retry flow handles only matching HTTP 400 rate-limit responses. Generic HTTP 400 responses remain non-retryable, and the option is not passed through as an SDK request option.The implementation threads the setting through
SessionProcessorandMessageV2.fromErrorintoProviderError.parseAPICallError, with unit and processor integration tests plus design documentation.How did you verify your code works?
bun test test/session/retry.test.ts test/session/processor-effect.test.ts --timeout 30000frompackages/opencode— 52 passed, 0 failed.bun typecheckfrompackages/opencode— passed.git diff --check— passed.TS1128error inpackages/enterprise/src/custom-elements.d.ts.Screenshots / recordings
Not applicable; this is a server/session error-handling change.
Checklist