fix(config): plan agent inherits model settings from prometheus when not explicitly configured
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.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user