2026-02-08 13:22:56 +09:00
|
|
|
const MODEL_SETTINGS_KEYS = [
|
|
|
|
|
"model",
|
|
|
|
|
"variant",
|
|
|
|
|
"temperature",
|
|
|
|
|
"top_p",
|
|
|
|
|
"maxTokens",
|
|
|
|
|
"thinking",
|
|
|
|
|
"reasoningEffort",
|
|
|
|
|
"textVerbosity",
|
|
|
|
|
"providerOptions",
|
|
|
|
|
] as const
|
|
|
|
|
|
|
|
|
|
export function buildPlanDemoteConfig(
|
|
|
|
|
prometheusConfig: Record<string, unknown> | undefined,
|
|
|
|
|
planOverride: Record<string, unknown> | undefined,
|
|
|
|
|
): Record<string, unknown> {
|
|
|
|
|
const modelSettings: Record<string, unknown> = {}
|
|
|
|
|
|
|
|
|
|
for (const key of MODEL_SETTINGS_KEYS) {
|
|
|
|
|
const value = planOverride?.[key] ?? prometheusConfig?.[key]
|
|
|
|
|
if (value !== undefined) {
|
|
|
|
|
modelSettings[key] = value
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-15 17:04:54 +09:00
|
|
|
return { mode: "subagent" as const, hidden: true, ...modelSettings }
|
2026-02-08 13:22:56 +09:00
|
|
|
}
|