DashboardCodellm-adapter.ts: retry logic, backoff sc…

llm-adapter.ts: retry logic, backoff schedule, and circuit breaker integration

Category: architecture
Confidence: 1.00
ID: 019e7013-a9ea-72e6-8e8c-17ef1848e4e0
Project ID: ffa98226-3908-4f0c-936b-969018c62abf
Cross-project: No
Recalled in other projects: 1
Source session: (none)
Created: 2026-06-09 16:58:08
Updated: 2026-06-12 00:15:06

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 1 2026-06-13

Content

llm-adapter.ts retry/backoff: TRANSIENT_CODES={429,500,502,503,529}; AUTH_ERROR_CODES={401,403}. MAX_RETRIES_RATE_LIMIT=3; MAX_RETRIES_SERVER=3; MAX_RETRIES_URGENT=2. backoffMs(): Retry-After present → min(retryAfterMs, cap); urgent → min(1000×2^attempt, 4000); 429 non-urgent → min(60_000+attempt×60_000, 180_000); 5xx → min(1000×2^attempt, 8000). On 429 non-urgent → tripCircuitBreaker(pauseSec). Auth errors → markAuthStale, re-resolve, retry once if credentialChanged && attempt===0. buildAnthropicWorkerRequest(): injects billing block only when cred.scheme === 'bearer'; system sent as block array with cache_control: { type: 'ephemeral', ttl: '1h' }; body signed via signBody(). AbortError downgraded to log.info.

Move to: