fix(opencode): cap session retry attempts#30245
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: #26369 - This PR addresses similar retry capping logic for sessions. However, PR #30245 (the current PR) appears to be a more recent and generalized approach using The other result (#28691) is about LLM provider retry attempts and appears unrelated to session retry configuration. |
|
For reviewer context: #26369 is related, but this PR takes the configurable route instead of adding a hardcoded retry cap. That keeps current behavior unchanged unless |
…max-retries # Conflicts: # packages/opencode/src/config/config.ts
Issue for this PR
Fixes #25733
Type of change
What does this PR do?
Adds
experimental.max_retriesto cap retry attempts for transient provider errors.When the option is unset, retry behavior is unchanged. When set,
SessionRetry.policy()stops scheduling retries after the configured number of retry attempts and lets the session surface the error.How did you verify your code works?
git diff --checkbun --cwd packages/opencode prettier --check src/config/config.ts src/session/retry.ts src/session/processor.ts test/session/retry.test.tsbun run --cwd packages/opencode typecheckbun test --cwd packages/opencode test/session/retry.test.ts --timeout 30000Screenshots / recordings
N/A. This is retry/config behavior only.
Checklist