/** * Gemini provider error classification and failover policy. * * thought_signature 400s are client/protocol validation errors (FR-018), * not infrastructure outages — they must return terminal errors, not trigger * stream delegation failover. */ import type { AssistantMessage } from '@earendil-works/pi-ai/compat'; /** * Telemetry reason_code for the one-shot residual failover (SP-233): when a * thought_signature 400 survives repair/guard, the session's replay state is * incompatible with Gemini — fail over once to a non-Google fleet member. * Distinct from infra failover codes (e.g. circuit_breaker_failover). */ export declare const GEMINI_REPLAY_INCOMPATIBLE: "gemini_replay_incompatible"; export interface GeminiProviderError { readonly statusCode?: number; readonly code?: string; readonly message?: string; } /** * Gemini returns 400 INVALID_ARGUMENT when tool-call replay omits thought_signature. */ export declare function isGeminiThoughtSignatureError(parsed: GeminiProviderError): boolean; export declare function isGeminiThoughtSignatureAssistantError(message: AssistantMessage): boolean; /** * Returns true when a Gemini provider error should trigger failover. * thought_signature validation failures are terminal — never failover. */ export declare function shouldFailoverOnGeminiError(parsed: GeminiProviderError): boolean; /** * Format a Gemini thought_signature validation error with operator workarounds. */ export declare function formatGeminiThoughtSignatureErrorMessage(errorMessage: string): string; //# sourceMappingURL=gemini-provider.d.ts.map