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(session): retry schedule has no upper bound on attempts #26354
policy() in packages/opencode/src/session/retry.ts has no numeric cap on the retry schedule. It continues as long as retryable() returns a truthy value, which means a misclassified-retryable error (or an upstream that's permanently unhealthy but keeps emitting retryable signals) can cause the schedule to spin without bound.
Reproduction
Construct an error that retryable() always classifies as retryable (e.g. an APIError with isRetryable: true and a 5xx status).
Drive policy() with that error repeatedly.
Observe: the schedule never terminates from the policy side. The only termination is whatever caller-side timeout exists.
Proposal
Add a numeric cap alongside the other RETRY_* constants and check it in the policy step function:
With the existing 2-4-8 s backoff this gives a wall-clock retry budget of ~14 s for a worst-case run, which feels appropriate for a TUI-attached LLM call.
Out of scope
Custom error-classification headers / non-standard retry vocabulary. Proxies wanting to short-circuit retries can do so through standard HTTP semantics already handled by retryable():
Feature requests must use the Feature Request issue template: the title should start with [FEATURE]: and the template's verification checkbox must be included.
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:
changed the title [-]feat(session): bounded retry policy + honor X-Llm-Error-* response headers[/-][+]fix(session): retry schedule has no upper bound on attempts[/+]on May 8, 2026
Thanks for updating the issue! It now clearly describes the bug with a specific file reference, reproduction steps, and a concrete proposal. The needs:compliance label has been removed.
Activity
github-actions commentedon May 8, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:and the template's verification checkbox must be included.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:
SessionRetry.policy()retries forever with no max attempt count (same bounded retry concern)If you believe this was flagged incorrectly, please let a maintainer know.
[-]feat(session): bounded retry policy + honor X-Llm-Error-* response headers[/-][+]fix(session): retry schedule has no upper bound on attempts[/+]github-actions commentedon May 8, 2026
Thanks for updating the issue! It now clearly describes the bug with a specific file reference, reproduction steps, and a concrete proposal. The needs:compliance label has been removed.