From 2612e8a6cab80df4561523f5bc1a5713a43fe1e6 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 20 Jun 2026 20:56:16 +0900 Subject: [PATCH] style(usage): prettier line-wrap for claude-usage 429 backoff Co-Authored-By: Claude Opus 4.7 --- src/claude-usage.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/claude-usage.ts b/src/claude-usage.ts index 13b81ee..f20daed 100644 --- a/src/claude-usage.ts +++ b/src/claude-usage.ts @@ -206,7 +206,10 @@ async function fetchUsageForToken( * apply to *failures* too — without it an empty cache means every dashboard * refresh hits the API, which itself sustains the very 429s we then report. */ - const recordAttempt = (errorStatus?: number, cooldownUntil?: number): void => { + const recordAttempt = ( + errorStatus?: number, + cooldownUntil?: number, + ): void => { const now = Date.now(); const entry: UsageCacheEntry = usageDiskCache[writeKey] ?? { usage: {}, @@ -308,7 +311,8 @@ async function fetchUsageForToken( tokenKey: legacyTokenCacheKey(token), cacheKey: writeKey, staleMinutes: Math.round(staleMs / 60_000), - retryAfterSec: retryAfterMs != null ? Math.round(retryAfterMs / 1000) : null, + retryAfterSec: + retryAfterMs != null ? Math.round(retryAfterMs / 1000) : null, cooldownSec: Math.round(cooldownMs / 1000), }, 'Claude usage API: rate limited (429)',