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
[Feature Request] Configurable Retry Mechanism via opencode.json #3011
This is a request to add a retry mechanism that can be configured through opencode.json.
For example, we should be able to define retry settings per provider—such as allowing up to 3 retries within a customizable time window (e.g., 5 seconds). This would improve reliability, especially since the current implementation lacks configurable retries.
Yeah we do already have retries setup but making it configurable makes sense. This is probably a lower priotiery currently tho
@rekram1-node, regarding the configurable retry mechanism for handling API errors, I think it would be better to use a fixed interval. For example, we could set 4 retries over 10 seconds—so each retry happens every 2.5 seconds—or simply retry every 10 seconds. This would be simpler than increasing the delay between retries (i.e., exponential backoff).
Yeah we do already have retries setup but making it configurable makes sense. This is probably a lower priotiery currently tho
What's the default for retries at the moment? It might be low priority for those using stable internet, reliable providers, and perfectly compatible models... but for those who aren't so lucky... it's an easy way to recover from errors and hiccups without having to habitually say "Continue".
Claude Code has the ENV var CLAUDE_CODE_MAX_RETRIES which I have set to 100. That works for API errors as well as API timeouts. Opencode seems to give up after a single timeout?
Using OpenCode with gpt-5.2-codex from Azure, I frequently get ratelimit errors and timeouts. In Codex, setting max retries to 100 mostly solves the problem. In OpenCode, I frequently have to say "continue".
Very annoying for unsupervised sessions.
Reacted by KC, Ingolf Wagner, kalebw-cerebras, alkeryn, Vedran Manojlovic, Keith Chia, Łukasz Kaptur, ruomiop, Akri and debanjandhar12
The configurable retry mechanism is now implemented natively in #26292 — supports fallbacks array in config, cooldown_seconds, per-agent overrides, and retry-after header parsing.
Reacted by Gökalp Özcan, Vitaly Sharov and LuminairPrime
is there a way to bind a mapping to a 'retry' action? So that when I kill the subagent elsewhere etc. that was stalling my main agent because of api parallel limits I would be able to immediately tell the main agent to continue instead of waiting the given interval?
Activity
github-actions commentedon Oct 7, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
H0llyW00dzZ commentedon Oct 7, 2025
Also This retry mechanism should also handle provider-specific API errors.
rekram1-node commentedon Oct 7, 2025
Yeah we do already have retries setup but making it configurable makes sense. This is probably a lower priotiery currently tho
H0llyW00dzZ commentedon Oct 7, 2025
@rekram1-node, regarding the configurable retry mechanism for handling API errors, I think it would be better to use a fixed interval. For example, we could set 4 retries over 10 seconds—so each retry happens every 2.5 seconds—or simply retry every 10 seconds. This would be simpler than increasing the delay between retries (i.e., exponential backoff).
kierr commentedon Oct 8, 2025
What's the default for retries at the moment? It might be low priority for those using stable internet, reliable providers, and perfectly compatible models... but for those who aren't so lucky... it's an easy way to recover from errors and hiccups without having to habitually say "Continue".
Claude Code has the ENV var
CLAUDE_CODE_MAX_RETRIESwhich I have set to 100. That works for API errors as well as API timeouts. Opencode seems to give up after a single timeout?kierr commentedon Oct 8, 2025
There is also this! #2116
rekram1-node commentedon Oct 8, 2025
yeah it looks like itd be pretty simple to add a config setting or an env var, I will take a look at pr later
adamal commentedon Jan 24, 2026
Using OpenCode with gpt-5.2-codex from Azure, I frequently get ratelimit errors and timeouts. In Codex, setting max retries to 100 mostly solves the problem. In OpenCode, I frequently have to say "continue".
Very annoying for unsupervised sessions.
github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
j3k0 commentedon May 17, 2026
The configurable retry mechanism is now implemented natively in #26292 — supports array in config, , per-agent overrides, and header parsing.
j3k0 commentedon May 17, 2026
The configurable retry mechanism is now implemented natively in #26292 — supports fallbacks array in config, cooldown_seconds, per-agent overrides, and retry-after header parsing.
litoj commentedon Oct 14, 2026
is there a way to bind a mapping to a 'retry' action? So that when I kill the subagent elsewhere etc. that was stalling my main agent because of api parallel limits I would be able to immediately tell the main agent to continue instead of waiting the given interval?