Files
oh-my-opencode/src/plugin-handlers/plan-model-inheritance.ts
T
YeonGyu-Kim ccb2715ada fix: hide native plan agent when replace_plan is true (#3443)
When replace_plan is true (default), the native plan agent was demoted to
subagent but remained visible in the agent picker. This caused Sisyphus to
route planning to the native plan agent instead of Prometheus.

Add hidden: true to buildPlanDemoteConfig(), consistent with how the build
agent is hidden when default_builder_enabled is false.
2026-04-15 17:04:54 +09:00

28 lines
671 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, hidden: true, ...modelSettings }
}