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
Some transient stream/rate-limit errors bypass retry and terminate sessions #21893
When opencode hits certain transient upstream failures during model streaming, some failures are retried, but others terminate the session immediately. This breaks unattended runs.
Type validation failed: Value: ("error": ("type":"rate_limit_error","message":"concurrency limit exceeded for account, please retry later"))
From reading the code, the main session retry path only runs after an error has been normalized into a retryable MessageV2.APIError and accepted by SessionRetry.retryable(). These cases appear to fall through as unknown / validation errors instead, so the run stops instead of retrying.
Observed behavior:
Known retryable failures such as some APICallErrors, ECONNRESET, and Bun decompression failures can enter session retry.
Some stream-layer / wrapped validation failures with transient upstream semantics do not enter retry.
The session ends in error/idle, and the task stops.
Expected behavior:
Transient upstream stream errors should be normalized into the existing retry path.
Wrapped rate-limit / concurrency-limit failures should still be recognized as retryable.
Long unattended tasks should continue after these transient failures instead of stopping.
Start a long-running agent task that streams model output.
Hit a transient upstream failure during streaming, especially one shaped like stream_read_error or a wrapped rate_limit_error / concurrency-limit validation error.
Observe that the session sometimes stops with an error instead of entering retry state.
Compare with already-classified retryable failures, which do enter retry state and continue.
Opened #30323 rebased on current dev with broader OpenAI/Codex stream error coverage (stream_read_error, overload, rate limit), including parseStreamError, retryable(), and fromError(Error.message) paths plus regression tests. Would appreciate a 👍/review if this matches what you are seeing — especially for Codex gpt-5.x unattended runs.
Activity
github-actions commentedon Apr 10, 2026
This issue might be a duplicate of existing issues. Please check:
rate_limit_error/Type validation failedscenario for Responses API stream chunks — the wrapped{"error":{"type":"rate_limit_error",...}}shape failing validation and not being retried is described there in detail.AI_JSONParseError) falling through toNamedError.Unknownand bypassing the retry path, which is the same root cause described here.If your issue adds new cases (e.g.
stream_read_error) not covered by those, please note that in the existing issues or reference them here.mwroffo commentedon Apr 17, 2026
Is this related to #22803 ?
spark4862 commentedon Jun 2, 2026
Opened #30323 rebased on current
devwith broader OpenAI/Codex stream error coverage (stream_read_error, overload, rate limit), includingparseStreamError,retryable(), andfromError(Error.message)paths plus regression tests. Would appreciate a 👍/review if this matches what you are seeing — especially for Codex gpt-5.x unattended runs.github-actions commentedon Aug 2, 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.