bb15a89b6f
Update schema comment to match actual code default [400, 429, 503, 529]. Previously the comment omitted 400 which is included in the code default. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
19 lines
913 B
TypeScript
19 lines
913 B
TypeScript
import { z } from "zod"
|
|
|
|
export const RuntimeFallbackConfigSchema = z.object({
|
|
/** Enable runtime fallback (default: true) */
|
|
enabled: z.boolean().optional(),
|
|
/** HTTP status codes that trigger fallback (default: [400, 429, 503, 529]) */
|
|
retry_on_errors: z.array(z.number()).optional(),
|
|
/** Maximum fallback attempts per session (default: 3) */
|
|
max_fallback_attempts: z.number().min(1).max(20).optional(),
|
|
/** Cooldown in seconds before retrying a failed model (default: 60) */
|
|
cooldown_seconds: z.number().min(0).optional(),
|
|
/** Session-level timeout in seconds to advance fallback when provider hangs (default: 30, 0 to disable) */
|
|
timeout_seconds: z.number().min(0).optional(),
|
|
/** Show toast notification when switching to fallback model (default: true) */
|
|
notify_on_fallback: z.boolean().optional(),
|
|
})
|
|
|
|
export type RuntimeFallbackConfig = z.infer<typeof RuntimeFallbackConfigSchema>
|