Description
The fallback system can spin in an infinite retry loop when a provider consistently fails. We should cap retry attempts (e.g. at 5) so the fallback system can proceed to the next configured model instead of spinning indefinitely.
Steps to Reproduce
- Configure a provider that consistently fails (e.g., due to network error or repeated 500 responses).
- Trigger the fallback system to use this provider.
- Observe the session logs showing an infinite retry loop without proceeding to the next configured model.
Expected Behavior
The retry loop should be capped at a reasonable limit (e.g., 5 attempts). Once the limit is reached, it should return an exhaustion status so the system can proceed to the next fallback model.
Environment
- OS: Any
- OpenCode version: dev
- Provider/model: Any consistently failing provider
Description
The fallback system can spin in an infinite retry loop when a provider consistently fails. We should cap retry attempts (e.g. at 5) so the fallback system can proceed to the next configured model instead of spinning indefinitely.
Steps to Reproduce
Expected Behavior
The retry loop should be capped at a reasonable limit (e.g., 5 attempts). Once the limit is reached, it should return an exhaustion status so the system can proceed to the next fallback model.
Environment