Kacper Sawicki
ed679bb3da
feat(codersdk): add circuit breaker configuration support for aibridge ( #21546 )
...
## Summary
Add circuit breaker support for AI Bridge to protect against cascading
failures from upstream AI provider rate limits (HTTP 429, 503, and
Anthropic's 529 overloaded responses).
## Changes
- Add 5 new CLI options for circuit breaker configuration:
- `--aibridge-circuit-breaker-enabled` (default: false)
- `--aibridge-circuit-breaker-failure-threshold` (default: 5)
- `--aibridge-circuit-breaker-interval` (default: 10s)
- `--aibridge-circuit-breaker-timeout` (default: 30s)
- `--aibridge-circuit-breaker-max-requests` (default: 3)
- Update aibridge dependency to include circuit breaker support
- Add tests for pool creation with circuit breaker providers
## Notes
- Circuit breaker is **disabled by default** for backward compatibility
- When enabled, applies to both OpenAI and Anthropic providers
- Uses sony/gobreaker internally via the aibridge library
## Testing
```
make test RUN=TestPoolWithCircuitBreakerProviders
```
2026-01-20 14:59:29 +01:00
..
2025-08-21 16:03:34 -04:00
2025-07-08 16:16:00 +00:00
2025-11-28 08:33:50 +02:00
2026-01-08 09:58:10 +00:00
2025-12-31 16:38:19 -07:00
2026-01-16 17:04:57 -09:00
2024-08-20 14:47:46 +10:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2024-04-02 10:02:30 -05:00
2024-04-01 09:19:26 -05:00
2024-04-01 09:19:26 -05:00
2024-04-02 10:02:30 -05:00
2024-04-01 09:19:26 -05:00
2024-04-01 09:19:26 -05:00
2025-11-28 08:33:50 +02:00
2025-11-28 08:33:50 +02:00
2025-11-28 08:33:50 +02:00
2025-11-28 08:33:50 +02:00
2025-11-28 08:33:50 +02:00
2025-11-28 08:33:50 +02:00
2023-10-09 23:04:35 +00:00
2025-09-03 10:38:42 +04:00
2024-01-24 14:05:39 +00:00
2024-08-20 14:47:46 +10:00
2025-10-29 15:45:45 +00:00
2025-11-25 18:13:00 -07:00
2026-01-16 17:04:57 -09:00
2026-01-08 09:58:10 +00:00
2023-09-14 19:48:29 -05:00
2025-09-11 15:08:57 +02:00
2025-09-11 15:08:57 +02:00
2024-07-11 15:22:20 +02:00
2024-07-11 15:22:20 +02:00
2025-02-19 13:08:38 +00:00
2025-03-21 15:28:08 +00:00
2025-03-21 15:28:08 +00:00
2024-01-02 20:46:18 +02:00
2024-09-17 14:08:33 -05:00
2026-01-16 17:04:57 -09:00
2024-09-17 10:22:20 -05:00
2024-09-17 10:22:20 -05:00
2024-09-17 10:22:20 -05:00
2024-09-17 10:22:20 -05:00
2024-09-17 10:22:20 -05:00
2025-04-04 14:04:20 -04:00
2026-01-16 17:04:57 -09:00
2024-09-17 10:22:20 -05:00
2026-01-16 17:04:57 -09:00
2024-09-17 14:08:33 -05:00
2026-01-14 09:47:50 -08:00
2026-01-14 09:47:50 -08:00
2026-01-14 09:47:50 -08:00
2026-01-14 09:47:50 -08:00
2024-09-17 10:22:20 -05:00
2025-02-24 05:38:17 +00:00
2023-12-08 10:01:13 -06:00
2025-01-20 17:24:22 +00:00
2025-01-27 16:26:56 +00:00
2025-01-27 16:26:56 +00:00
2025-10-06 08:56:43 +00:00
2025-10-06 08:56:43 +00:00
2025-03-10 12:28:06 +00:00
2025-08-21 16:03:34 -04:00
2026-01-09 11:23:32 -06:00
2025-05-19 16:05:39 +01:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2025-01-03 11:15:35 -06:00
2026-01-16 17:04:57 -09:00
2024-12-18 10:58:33 +00:00
2025-08-13 18:15:53 +01:00
2024-08-20 14:47:46 +10:00
2023-09-14 19:48:29 -05:00
2023-09-14 19:48:29 -05:00
2026-01-20 14:59:29 +01:00
2024-03-20 13:14:43 -04:00
2023-09-14 19:48:29 -05:00
2023-09-14 19:48:29 -05:00
2025-07-08 16:16:00 +00:00
2024-08-20 14:47:46 +10:00
2025-05-16 10:09:46 -04:00
2026-01-16 17:04:57 -09:00
2024-08-20 14:47:46 +10:00
2024-08-20 14:47:46 +10:00
2024-08-20 14:47:46 +10:00
2024-08-20 14:47:46 +10:00
2023-09-14 19:48:29 -05:00
2023-09-14 19:48:29 -05:00
2026-01-12 15:16:59 +01:00
2026-01-16 17:04:57 -09:00
2024-03-25 15:14:27 +00:00
2026-01-20 10:28:52 +11:00
2025-11-25 13:50:22 +00:00
2025-11-25 13:50:22 +00:00
2026-01-16 17:04:57 -09:00
2025-11-25 13:50:22 +00:00
2025-11-25 13:50:22 +00:00
2025-11-25 13:50:22 +00:00
2025-11-25 13:50:22 +00:00
2025-07-24 16:44:36 +01:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2025-10-17 13:09:50 -05:00
2024-08-20 14:47:46 +10:00
2025-07-24 16:44:36 +01:00
2025-07-29 16:59:26 +01:00
2026-01-16 17:04:57 -09:00
2026-01-16 17:04:57 -09:00
2024-10-17 14:15:14 +05:00
2026-01-16 17:04:57 -09:00
2024-08-20 14:47:46 +10:00
2024-10-17 14:15:14 +05:00
2026-01-16 17:04:57 -09:00
2025-10-27 17:07:25 +01:00
2025-10-28 15:15:57 +00:00
2025-10-27 17:07:25 +01:00
2025-02-12 18:18:17 +11:00
2025-10-27 17:07:25 +01:00
2024-01-24 14:05:39 +00:00
2025-06-23 09:12:37 +01:00
2025-05-13 20:48:16 +00:00
2024-08-20 14:47:46 +10:00
2025-05-13 20:48:16 +00:00
2023-10-09 11:47:57 -05:00
2026-01-16 17:04:57 -09:00
2025-10-22 16:18:31 +11:00
2025-05-23 11:35:05 -03:00
2024-12-20 00:06:22 +02:00
2024-08-20 14:47:46 +10:00
2024-08-20 14:47:46 +10:00
2024-08-20 14:47:46 +10:00
2025-09-26 11:20:25 +01:00
2026-01-20 14:59:29 +01:00