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
provider.*.options.timeout config is not applied to API requests #30252
provider.anthropic.options.timeout is documented as configurable via OPENCODE_CONFIG_CONTENT but the Go server does not apply it. API requests always time out at 300s (5 minutes) regardless of the config value.
Reproduction
import{createOpencode}from"@opencode-ai/sdk";asyncfunctionmain(){conststart=Date.now();constelapsed=()=>`${((Date.now()-start)/1000).toFixed(1)}s`;constopencode=awaitcreateOpencode({config: {provider: {anthropic: {options: {timeout: 600000}},// 10 minutes},},port: 0,timeout: 30_000,});constsession=awaitopencode.client.session.create({body: {title: "timeout-test"},});constsessionId=session.data!.idasstring;try{awaitopencode.client.session.prompt({body: {parts: [{text: "Use the bash tool to run: sleep 360 && echo done\n\nDo NOT use pty_spawn. Wait for the command to complete.",type: "text"}],},path: {id: sessionId},});console.log(`[${elapsed()}] Completed`);}catch(error){console.log(`[${elapsed()}] Failed: ${error}`);}}main();
Expected
The session should survive past 5 minutes since timeout: 600000 (10 min) is set.
Actual
TypeError: fetch failed at exactly 302-303 seconds every time.
Tested values
Config
Result
timeout: false
Fails at 302.9s
timeout: 600000
Fails at 302.5s
timeout: 600000 + global headers merged
Fails at 302.9s
No timeout config (default)
Fails at 302-303s
All produce TypeError: fetch failed at the same ~303s mark.
Context
The TypeScript SDK types document this field correctly:
options?: {timeout?: number|false;// "Default is 300000 (5 minutes). Set to false to disable timeout."
chunkTimeout?: number;};
The config is serialized to OPENCODE_CONFIG_CONTENT and passed to opencode serve. The Go server appears to not read provider.*.options.timeout when configuring its internal HTTP client.
Impact
Any programmatic use of the SDK where a session needs to run longer than 5 minutes (e.g., agentic pipelines with many tool calls) hits this wall. The only workaround is keeping individual sessions under 5 minutes.
Activity
github-actions commentedon Jun 1, 2026
This issue might be a duplicate of existing issues. Please check:
timeout: falseor large timeout values in provider options are ignored and requests fail at the ~300s mark@opencode-ai/sdk— same 5-minute wall hit viaclient.session.prompt()despite timeout configurationIf your issue is distinct or provides additional context not covered in those reports, feel free to keep this open and link to the related issues.
github-actions commentedon Aug 1, 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.