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>
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { z } from "zod"
|
|
import { FallbackModelsSchema } from "./fallback-models"
|
|
|
|
export const CategoryConfigSchema = z.object({
|
|
/** Human-readable description of the category's purpose. Shown in task prompt. */
|
|
description: z.string().optional(),
|
|
model: z.string().optional(),
|
|
fallback_models: FallbackModelsSchema.optional(),
|
|
variant: z.string().optional(),
|
|
temperature: z.number().min(0).max(2).optional(),
|
|
top_p: z.number().min(0).max(1).optional(),
|
|
maxTokens: z.number().optional(),
|
|
thinking: z
|
|
.object({
|
|
type: z.enum(["enabled", "disabled"]),
|
|
budgetTokens: z.number().optional(),
|
|
})
|
|
.optional(),
|
|
reasoningEffort: z.enum(["low", "medium", "high", "xhigh"]).optional(),
|
|
textVerbosity: z.enum(["low", "medium", "high"]).optional(),
|
|
tools: z.record(z.string(), z.boolean()).optional(),
|
|
prompt_append: z.string().optional(),
|
|
/** Mark agent as unstable - forces background mode for monitoring. Auto-enabled for gemini/minimax models. */
|
|
is_unstable_agent: z.boolean().optional(),
|
|
/** Disable this category. Disabled categories are excluded from task delegation. */
|
|
disable: z.boolean().optional(),
|
|
})
|
|
|
|
export const BuiltinCategoryNameSchema = z.enum([
|
|
"visual-engineering",
|
|
"ultrabrain",
|
|
"deep",
|
|
"artistry",
|
|
"quick",
|
|
"unspecified-low",
|
|
"unspecified-high",
|
|
"writing",
|
|
])
|
|
|
|
export const CategoriesConfigSchema = z.record(z.string(), CategoryConfigSchema)
|
|
|
|
export type CategoryConfig = z.infer<typeof CategoryConfigSchema>
|
|
export type CategoriesConfig = z.infer<typeof CategoriesConfigSchema>
|
|
export type BuiltinCategoryName = z.infer<typeof BuiltinCategoryNameSchema>
|