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
fix: yield retry to OMO fallback when retry-after exceeds threshold #36398
When a provider returns a retry-after header longer than 1 minute (e.g. retry-after: 3600), OpenCode waits that entire duration before retrying — and there is no cap. If the error keeps coming back, OpenCode retries indefinitely without ever notifying OMO.
This means OMO never receives a session.error event and can never activate its fallback chain. The session stays stuck in a retry loop for hours.
Fix: Add an optional RETRY_MAX_SINGLE_DELAY_MS threshold (60s). When OMO (oh-my-openagent) is detected on the system (via its config file at ~/.config/opencode/oh-my-openagent.json) and the computed wait exceeds this threshold, the retry policy stops retrying and lets the error propagate to session.error → OMO fallback.
Verification:
Without OMO installed → behavior unchanged (no threshold enforced)
With OMO + retry-after < 60s → behavior unchanged
With OMO + retry-after > 60s → retry yields, OMO receives session.error and activates fallback chain
The issue does not use one of the three required templates (Bug Report, Feature Request, or Question). It is written as a fix proposal rather than following the template structure. If this is a bug report, please use the Bug Report template with a proper Description field and reproduction context. If it is a feature request, the title should start with [FEATURE]: and include the required verification checkbox.
The issue title uses a commit-style prefix (fix:) which is not appropriate for issue titles.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
When using omo with opencode, things like free usage exceeded and too many requests can put a limit on their waiting time. Because if opencode raised an error, OMO can catch it and fallback, which means OMO can hand the prompt to a next model that functions normally. But if opnecode keep holding the session and retry, it will cost a huge amount of time.
Activity
github-actions commentedon Jul 11, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:and include the required verification checkbox.fix:) which is not appropriate for issue titles.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
UCASRMTG5D commentedon Jul 11, 2026
It is true that these existing issues reflect the same problem I've encountered.
UCASRMTG5D commentedon Jul 11, 2026
When using omo with opencode, things like free usage exceeded and too many requests can put a limit on their waiting time. Because if opencode raised an error, OMO can catch it and fallback, which means OMO can hand the prompt to a next model that functions normally. But if opnecode keep holding the session and retry, it will cost a huge amount of time.