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
SSE timeout errors are not retried when chunkTimeout is exceeded #20466
When chunkTimeout is set in provider config and the LLM stops sending tokens for longer than the timeout (e.g., 60 seconds), an error "SSE read timed out" is thrown. However, this error is not retried by the session retry mechanism.
Plugins
No response
OpenCode version
latest
Steps to reproduce
When the error "SSE read timed out" is thrown, it gets converted to NamedError.Unknown in message-v2.ts:fromError()
In retry.ts:retryable(), this error is treated as non-retryable because:
It's not an APICallError
It's not a ContextOverflowError
The retryable() function tries to parse it as JSON (JSON.parse("SSE read timed out")), which fails, so json becomes undefined, and the function returns undefined (non-retryable)
Expected behavior:
SSE timeout errors should be treated as retryable network errors
The session should automatically retry when chunkTimeout is exceeded
Suggested fix:
Add a check in retry.ts:retryable() to recognize SSE timeout errors:
if(error.data.message?.includes("SSE read timed out")){return"SSE read timed out"}Additionalcontext:
Thisaffects any provider using chunkTimeoutconfigurationUserswithcustomprovidersthatsometimeshavelongthinktimesareaffectedNocurrentworkaroundexceptremovingchunkTimeoutwhichcancausethesessiontohangindefinitely
### Screenshotand/orsharelink_Noresponse_
### OperatingSystem_Noresponse_
### Terminal_Noresponse_
Activity
github-actions commentedon Apr 1, 2026
This issue might be a duplicate of existing issues. Please check:
retry.ts, causing the session to halt instead of retrying. That issue coversoverloaded_errorfrom Anthropic; this one covers SSE timeout errors fromchunkTimeout. A fix for Anthropic overloaded_error is not retried, halts session #20384 may address or be extended to cover this case as well.opencode: drop chunkTimeout, add root pyrightconfig for LSP-payload fix
adamskrodzki commentedon Apr 28, 2026
Having same problem, I attach log with events generated in session by opencode before crash
https://gist.github.com/adamskrodzki/58122d96d2d165e3dc20e639176954af#file-gistfile1-txt
opencode: drop chunkTimeout, add root pyrightconfig for LSP-payload fix
fix: handle stream interruption for OpenAI-compatible providers
feat(opencode): make local turns survive, and make failures visible (#48