Skip to content

fix(opencode): cap session-level retries and export MAX_SESSION_RETRIES - #30040

Closed
nikhilkulkarni1755 wants to merge 1 commit into
anomalyco:devfrom
nikhilkulkarni1755:fix/cap-session-retries-export-constant
Closed

fix(opencode): cap session-level retries and export MAX_SESSION_RETRIES#30040
nikhilkulkarni1755 wants to merge 1 commit into
anomalyco:devfrom
nikhilkulkarni1755:fix/cap-session-retries-export-constant

Conversation

@nikhilkulkarni1755

@nikhilkulkarni1755nikhilkulkarni1755 commented May 31, 2026

Copy link
Copy Markdown

Issue for this PR

Closes#29143

Type of change

  • Bug fix

What does this PR do?

The session retry schedule in retry.ts had no attempt cap — persistent provider failures (5xx, 503) would cycle indefinitely since retryable() always returned truthy for those errors.

Adds MAX_SESSION_RETRIES = 5 and exports it so test/session/retry.test.ts can drive the schedule to exhaustion to verify the cap fires. Also adds the missing test case.

How did you verify your code works?

bun test test/session/retry.test.ts — 34 pass, 0 fail

test-results

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label May 31, 2026
@nikhilkulkarni1755
nikhilkulkarni1755force-pushed the fix/cap-session-retries-export-constant branch from 7a0bbdc to c5d2affCompareMay 31, 2026 02:42
@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

The session retry schedule in retry.ts had no attempt cap — persistent
provider failures (5xx, 503) would cycle executor→session indefinitely
since retryable() always returned truthy for those errors.
Adds MAX_SESSION_RETRIES = 5 and exports it so test/session/retry.test.ts
can drive the schedule to exhaustion to verify the cap fires. Also adds
the missing test case.
Fixesanomalyco#29143
@nikhilkulkarni1755
nikhilkulkarni1755force-pushed the fix/cap-session-retries-export-constant branch from f2b5084 to 60de35aCompareJune 5, 2026 04:04
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Infinite retry loop on consistent provider failure

1 participant

@nikhilkulkarni1755