12 Commits

Author SHA1 Message Date
can1357 a6eafcbf6b fix(ai): keep concurrency caps out of auth rotation
(cherry picked from commit bd6285ad9b16ae6f0a75e336a1c4bf961d3e43c7)
2026-08-05 02:32:36 +02:00
metaphorics e322f28fcc fix(ai): exclude concurrency caps from 403 rotation and test the Copilot gate
403 concurrency caps bypass credential rotation in stream and auth-retry paths; snake-case concurrency codes classify; a session-level test covers the Copilot credential-removal gate.

(cherry picked from commit aca348e797ed987750a14ecf625952b6b971f7a5)
2026-08-05 02:32:35 +02:00
can1357 78ac03f30b feat(ai): rotated through sibling credentials on 403 responses
- Treat `403 Forbidden` errors as retryable credential-rotation triggers similar to usage limits.
- Skip refresh-same detours for 403 responses and cycle directly through the sibling credential pool.
2026-07-28 03:34:41 +02:00
can1357 6ae7cdbf97 feat(ai): added automatic credential rotation for invalidated OAuth tokens
- Implement `isInvalidatedOAuthTokenError` to identify specific upstream auth failures.
- Enable automatic credential rotation in `AuthStorage` and stream retries when an invalidated token is detected.
- Update `proxy.test.ts` to correctly handle `NO_PROXY` and `no_proxy` environment variables during testing.
2026-07-16 05:39:37 +02:00
can1357 6295f5cb14 merged PR #5429: fix(ai): fail over exhausted OpenRouter daily keys
# Conflicts:
#	packages/ai/src/error/rate-limit.ts
#	packages/ai/test/auth-retry.test.ts
2026-07-16 03:45:22 +02:00
roboomp 0c5458a248 fix(ai): recognized OpenRouter daily key limits
- Classified free-models-per-day failures as credential-scoped quota exhaustion.
- Added regression coverage proving auth retries switch to a healthy sibling key.

Fixes #4832
2026-07-14 16:39:28 +00:00
Jeff Scott Ward 0ab90f63e5 fix(auth): rotate through quota-limited accounts
Keep ordinary 401 retries bounded while replay-safe quota failures
walk every distinct eligible credential. Anchor blocks to the failed
credential and stop on cycles, aborts, or 64 attempts.
2026-07-12 00:23:04 -04:00
ben d8d33d4e8c fix(ai): rotate xai-oauth on SuperGrok credit exhaustion
xAI returns HTTP 403 with "run out of credits" / spending-limit when an
account is parked. Classify that as a usage limit so multi-account pools
switch siblings instead of sticking to the exhausted credential.
2026-07-09 18:02:44 +08:00
cagedbird043 0e259bb640 fix(auth): rotate codex accounts before model fallback 2026-07-08 01:48:34 +08:00
can1357 f4504a41cd feat(ai): added withOAuthAccess auth-retry driver for OAuth-access consumers 2026-06-12 02:33:46 +02:00
can1357 d18cc3c717 test(tests): extended auth-retry and read-link tests for updated checks
- Added a read-link probe test that renders text and image paths with active hyperlinks.
- Updated ai auth retry tests for revised static-key validation and rotation behavior.
2026-06-07 05:13:58 +02:00
can1357 cba6641299 feat: enabled resolver-based API key retries with refresh and rotation
- Added `ApiKeyResolver`/`ApiKey` types and exported auth-retry helpers.
- Changed stream and gateway auth retry handling to use resolver steps.
- Added initial-key, force-refresh, and rotate credential retries for auth failures.
- Updated agent and coding-agent integrations to use context-aware API-key resolvers.
2026-06-07 04:20:48 +02:00