afab3e658a
- Add council config guard prompt: when Athena has no valid council members, inject a STOP instruction telling the user how to configure council members instead of failing messily with generic agents - Make council member 'name' field mandatory (was optional with auto-naming) - Remove humanizeModelId and UPPERCASE_TOKENS — no more fragile auto-naming - Replace throw on duplicate names with log + skip (graceful degradation) - Update schema, types, tests (87 pass), and documentation
28 lines
820 B
TypeScript
28 lines
820 B
TypeScript
import { z } from "zod"
|
|
import { parseModelString } from "../../agents/athena/model-parser"
|
|
|
|
/** Validates model string format: "provider/model-id" (e.g., "openai/gpt-5.3-codex"). */
|
|
const ModelStringSchema = z
|
|
.string()
|
|
.min(1)
|
|
.refine(
|
|
(model) => parseModelString(model) !== null,
|
|
{ message: 'Model must be in "provider/model-id" format (e.g., "openai/gpt-5.3-codex")' }
|
|
)
|
|
|
|
export const CouncilMemberSchema = z.object({
|
|
model: ModelStringSchema,
|
|
variant: z.string().optional(),
|
|
name: z.string().min(1),
|
|
temperature: z.number().min(0).max(2).optional(),
|
|
}).strict()
|
|
|
|
export const CouncilConfigSchema = z.object({
|
|
members: z.array(CouncilMemberSchema).min(2),
|
|
}).strict()
|
|
|
|
export const AthenaConfigSchema = z.object({
|
|
model: z.string().optional(),
|
|
council: CouncilConfigSchema,
|
|
}).strict()
|