/** * Process-wide provider health signal. * * When the main session's turn fails with a usage/quota/rate-limit error that * does not recover (retries exhausted or disabled), the session records the * provider as "exhausted" for a short window. The subagent Task tool reads this * to skip pointless spawns: subagents inherit the parent's provider, so they * would hit the same wall. The signal is cleared on the next successful response * and self-expires after a TTL so it never sticks longer than necessary. */ export interface ProviderExhaustion { provider: string; /** Epoch ms when the exhaustion was recorded. */ at: number; /** The provider error message that triggered it (truncated for display). */ message: string; } /** * Heuristic: does this provider error indicate quota/credit/rate-limit * exhaustion (as opposed to a transient network/overload blip)? */ export declare function isProviderQuotaError(message: string | undefined): boolean; /** Record that a provider is currently exhausted/rate-limited. */ export declare function markProviderExhausted(provider: string, message: string): void; /** Clear any exhaustion signal for a provider (e.g. after a successful response). */ export declare function clearProviderExhaustion(provider: string): void; /** * Return the active exhaustion record for a provider, or undefined when none is * active or it has expired. Expired records are pruned on read. */ export declare function getProviderExhaustion(provider: string, ttlMs?: number): ProviderExhaustion | undefined; /** Test helper: clear all recorded exhaustion signals. */ export declare function resetProviderHealthForTesting(): void; //# sourceMappingURL=provider-health.d.ts.map