fix: use mode 'all' for Planner-Sisyphus agent and inherit default model
🤖 Generated with assistance of OhMyOpenCode
- Fix Planner-Sisyphus agent config: use `mode: 'all'` instead of `mode: 'primary'` to show in Tab selector
- Use model fallback to default config model when plan agent model not specified
- Demote original plan agent to `subagent` mode with `hidden: true` instead of `disable: true`
- Destructure `mode` from plan config to avoid passing it to migratedPlanConfig
This commit is contained in:
@@ -168,16 +168,17 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plannerEnabled) {
|
if (plannerEnabled) {
|
||||||
const { name: _planName, ...planConfigWithoutName } =
|
const { name: _planName, mode: _planMode, ...planConfigWithoutName } =
|
||||||
configAgent?.plan ?? {};
|
configAgent?.plan ?? {};
|
||||||
const migratedPlanConfig = migrateAgentConfig(
|
const migratedPlanConfig = migrateAgentConfig(
|
||||||
planConfigWithoutName as Record<string, unknown>
|
planConfigWithoutName as Record<string, unknown>
|
||||||
);
|
);
|
||||||
const plannerSisyphusOverride =
|
const plannerSisyphusOverride =
|
||||||
pluginConfig.agents?.["Planner-Sisyphus"];
|
pluginConfig.agents?.["Planner-Sisyphus"];
|
||||||
|
const defaultModel = config.model as string | undefined;
|
||||||
const plannerSisyphusBase = {
|
const plannerSisyphusBase = {
|
||||||
...migratedPlanConfig,
|
model: (migratedPlanConfig as Record<string, unknown>).model ?? defaultModel,
|
||||||
mode: "primary",
|
mode: "all" as const,
|
||||||
prompt: PLAN_SYSTEM_PROMPT,
|
prompt: PLAN_SYSTEM_PROMPT,
|
||||||
permission: PLAN_PERMISSION,
|
permission: PLAN_PERMISSION,
|
||||||
description: `${configAgent?.plan?.description ?? "Plan agent"} (OhMyOpenCode version)`,
|
description: `${configAgent?.plan?.description ?? "Plan agent"} (OhMyOpenCode version)`,
|
||||||
@@ -209,7 +210,7 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
: {};
|
: {};
|
||||||
|
|
||||||
const planDemoteConfig = replacePlan
|
const planDemoteConfig = replacePlan
|
||||||
? { disable: true }
|
? { mode: "subagent" as const, hidden: true }
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
config.agent = {
|
config.agent = {
|
||||||
|
|||||||
Reference in New Issue
Block a user