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
Preserve HTTP status on UnknownError so plugins can fallback #47039
Provider HTTP failures (401, 429, 5xx, auth-expired) are often collapsed to UnknownError with Unexpected server error and no status on the session error. Plugins that implement model/provider fallback cannot classify the failure.
Related: #39340 (overloaded_error becomes UnknownError and is not retried).
[FEATURE]:Auto-Failover for Rate Limit Resilience #42513: Auto-Failover for Rate Limit Resilience — related in that both require the session error to carry enough information (status, error type) for fallback/retry logic to make decisions
This issue is narrower and is a prerequisite for both: the session error object loses the HTTP status when a provider failure is wrapped as UnknownError. Whatever retries — OpenCode's own logic in #30611, the failover in #42513, or an external plugin — cannot classify 401 vs 429 vs 503 if the status was already discarded at the wrap site. Fixing the wrap does not implement either of those features, and implementing either of them without the status still leaves the classifier blind.
PR #47092 preserves the status on the Error wrap and does not change retry policy, which keeps it independent of the decisions still open on #30611 and #42513.
This is fixed in v2: session errors preserve the provider’s HTTP status when available and expose typed classifications such as provider.auth, provider.rate-limit, and provider.internal, along with the response body. Plugins can classify these failures without relying on a generic UnknownError message; this does not add automatic failover.
To get v2, run npm i -g @opencode/cli@latest. If you still see this on v2, please open a new issue with the details.
Activity
github-actions commentedon Sep 3, 2026
This issue might be a duplicate of existing issues. Please check:
RaviTharuma commentedon Sep 3, 2026
Both cited issues are still open, and neither covers this one.
This issue is narrower and is a prerequisite for both: the session error object loses the HTTP status when a provider failure is wrapped as
UnknownError. Whatever retries — OpenCode's own logic in #30611, the failover in #42513, or an external plugin — cannot classify 401 vs 429 vs 503 if the status was already discarded at the wrap site. Fixing the wrap does not implement either of those features, and implementing either of them without the status still leaves the classifier blind.PR #47092 preserves the status on the Error wrap and does not change retry policy, which keeps it independent of the decisions still open on #30611 and #42513.
neriousy commentedon Oct 19, 2026
This is fixed in v2: session errors preserve the provider’s HTTP status when available and expose typed classifications such as
provider.auth,provider.rate-limit, andprovider.internal, along with the response body. Plugins can classify these failures without relying on a generic UnknownError message; this does not add automatic failover.To get v2, run
npm i -g @opencode/cli@latest. If you still see this on v2, please open a new issue with the details.