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
fix: 5xx errors from non-standard providers are not retried #19203
MessageV2.fromError currently only upgrades APICallError instances to retryable APIError. When an OpenAI-compatible provider throws a plain Error or object with HTTP status fields instead, the error falls through to NamedError.Unknown, so session retry logic never runs.
Reproduction
Configure a custom OpenAI-compatible provider that occasionally returns 502/503
The error object may be:
An Error with a statusCode or status property (not APICallError)
A plain object with status/statusCode or response.status/response.statusCode
An Error whose .message is a JSON string containing statusCode
OpenCode treats all of these as non-retryable Unknown errors
Expected behavior
Any error with HTTP status >= 500 should be classified as APIError with isRetryable: true, regardless of the error object shape.
If your issue is specifically about the fromError() classification gap for non-APICallError shapes with HTTP 5xx status, it may be best addressed alongside #13579.
Activity
github-actions commentedon Mar 26, 2026
This issue might be a duplicate of existing issues. Please check:
APICallErrorfall through toNamedError.UnknowninfromError()and are not retried (that issue coversAI_JSONParseError, this one covers plainErrorwith HTTP status fields)If your issue is specifically about the
fromError()classification gap for non-APICallErrorshapes with HTTP 5xx status, it may be best addressed alongside #13579.okuyam2y commentedon Mar 26, 2026
Fix submitted in #19204.
github-actions commentedon Jul 5, 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.