Previously, demoted plan agent only received { mode: 'subagent' } with no
model settings, causing fallback to step-3.5-flash. Now inherits all
model-related settings (model, variant, temperature, top_p, maxTokens,
thinking, reasoningEffort, textVerbosity, providerOptions) from the
resolved prometheus config. User overrides via agents.plan.* take priority.
Prompt, permission, description, and color are intentionally NOT inherited.
28 lines
657 B
TypeScript
28 lines
657 B
TypeScript
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
|
|
}
|
|
}
|
|
|
|
return { mode: "subagent" as const, ...modelSettings }
|
|
}
|