Dashboard › Code › llm-adapter.ts: retry logic, backoff sc…
019e7013-a9ea-72e6-8e8c-17ef1848e4e0| Project | Hits | Last recalled |
|---|---|---|
| opencode-lore | 1 | 2026-06-13 |
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.