oh-my-opencode/src/config/schema/runtime-fallback.ts
Rebase Bot 632570f7ec feat(config): add runtime_fallback and fallback_models schema
Add configuration schemas for runtime model fallback feature:
- RuntimeFallbackConfigSchema with enabled, retry_on_errors,
  max_fallback_attempts, cooldown_seconds, notify_on_fallback
- FallbackModelsSchema for init-time fallback model selection
- Add fallback_models to AgentOverrideConfigSchema and CategoryConfigSchema
- Export types and schemas from config/index.ts

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-02-21 02:28:27 +09:00

12 lines
429 B
TypeScript

import { z } from "zod"
export const RuntimeFallbackConfigSchema = z.object({
enabled: z.boolean().default(true),
retry_on_errors: z.array(z.number()).default([429, 503, 529]),
max_fallback_attempts: z.number().min(1).max(10).default(3),
cooldown_seconds: z.number().min(0).default(60),
notify_on_fallback: z.boolean().default(true),
})
export type RuntimeFallbackConfig = z.infer<typeof RuntimeFallbackConfigSchema>