MCPcopy
hub / github.com/codeaashu/claude-code / cacheExtraUsageDisabledReason

Function cacheExtraUsageDisabledReason

src/services/claudeAiLimits.ts:441–452  ·  view source on GitHub ↗

* Cache the extra usage disabled reason from API headers.

(headers: globalThis.Headers)

Source from the content-addressed store, hash-verified

439 * Cache the extra usage disabled reason from API headers.
440 */
441function cacheExtraUsageDisabledReason(headers: globalThis.Headers): void {
442 // A null reason means extra usage is enabled (no disabled reason header)
443 const reason =
444 headers.get('anthropic-ratelimit-unified-overage-disabled-reason') ?? null
445 const cached = getGlobalConfig().cachedExtraUsageDisabledReason
446 if (cached !== reason) {
447 saveGlobalConfig(current => ({
448 ...current,
449 cachedExtraUsageDisabledReason: reason,
450 }))
451 }
452}
453
454export function extractQuotaStatusFromHeaders(
455 headers: globalThis.Headers,

Callers 2

Calls 3

getGlobalConfigFunction · 0.85
saveGlobalConfigFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected