feat(model-settings-compat): add variant/reasoningEffort compatibility resolver
- Registry-based model family detection (provider-agnostic) - Variant and reasoningEffort ladder downgrade logic - Three-tier resolution: metadata override → family heuristic → unknown drop - Comprehensive test suite covering all model families
This commit is contained in:
@@ -371,6 +371,26 @@ describe("CategoryConfigSchema", () => {
|
||||
}
|
||||
})
|
||||
|
||||
test("accepts reasoningEffort values none and minimal", () => {
|
||||
// given
|
||||
const noneConfig = { reasoningEffort: "none" }
|
||||
const minimalConfig = { reasoningEffort: "minimal" }
|
||||
|
||||
// when
|
||||
const noneResult = CategoryConfigSchema.safeParse(noneConfig)
|
||||
const minimalResult = CategoryConfigSchema.safeParse(minimalConfig)
|
||||
|
||||
// then
|
||||
expect(noneResult.success).toBe(true)
|
||||
expect(minimalResult.success).toBe(true)
|
||||
if (noneResult.success) {
|
||||
expect(noneResult.data.reasoningEffort).toBe("none")
|
||||
}
|
||||
if (minimalResult.success) {
|
||||
expect(minimalResult.data.reasoningEffort).toBe("minimal")
|
||||
}
|
||||
})
|
||||
|
||||
test("rejects non-string variant", () => {
|
||||
// given
|
||||
const config = { model: "openai/gpt-5.4", variant: 123 }
|
||||
|
||||
@@ -35,7 +35,7 @@ export const AgentOverrideConfigSchema = z.object({
|
||||
})
|
||||
.optional(),
|
||||
/** Reasoning effort level (OpenAI). Overrides category and default settings. */
|
||||
reasoningEffort: z.enum(["low", "medium", "high", "xhigh"]).optional(),
|
||||
reasoningEffort: z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
|
||||
/** Text verbosity level. */
|
||||
textVerbosity: z.enum(["low", "medium", "high"]).optional(),
|
||||
/** Provider-specific options. Passed directly to OpenCode SDK. */
|
||||
|
||||
@@ -16,7 +16,7 @@ export const CategoryConfigSchema = z.object({
|
||||
budgetTokens: z.number().optional(),
|
||||
})
|
||||
.optional(),
|
||||
reasoningEffort: z.enum(["low", "medium", "high", "xhigh"]).optional(),
|
||||
reasoningEffort: z.enum(["none", "minimal", "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(),
|
||||
|
||||
Reference in New Issue
Block a user