fix: retry OpenAI overload errors#25886
Conversation
|
The following comment was made by an LLM, it may be inaccurate: I found several potentially related PRs. Let me filter out the current PR (#25886) and highlight the relevant ones: Potential Duplicates/Related PRs:
These PRs are worth reviewing to ensure there's no overlap or conflicting approaches to retry handling across different providers. |
|
Thanks for the automated guidance. I updated the issue and PR to match the repo templates and removed the generated footer/long-form wording. I also checked the related work and saw #25728 covers the same If maintainers prefer #25728, I can close this PR as a duplicate. Otherwise this one is now the same narrow bug fix from the OpenAI-compatible stream angle. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Closes #25884
Type of change
What does this PR do?
OpenAI-compatible streams can return
server_is_overloaded/service_unavailable_erroras a stream error event.This PR maps that stream error to the existing retryable API error path, and keeps the generic retry classifier aware of the same nested provider code/type when it arrives as plain JSON or an API response body.
This overlaps with #25728. I opened this from the OpenAI side before seeing that PR; happy to close this one if maintainers prefer the Codex-focused PR.
How did you verify your code works?
Local automated tests were not run because
bunis not installed in this environment. I added focused regression tests in:packages/opencode/test/session/retry.test.tspackages/opencode/test/session/message-v2.test.tsScreenshots / recordings
Not applicable; no UI changes.
Checklist