fix(core): ensure enter_plan_mode tool registration respects experimental.plan (#18587)

This commit is contained in:
Jerop Kipruto
2026-02-08 20:57:01 -05:00
committed by GitHub
parent 97a4e62dfa
commit 375c104b32
2 changed files with 31 additions and 3 deletions
+8 -2
View File
@@ -1540,8 +1540,14 @@ export class Config {
if (registry.getTool(EXIT_PLAN_MODE_TOOL_NAME)) {
registry.unregisterTool(EXIT_PLAN_MODE_TOOL_NAME);
}
if (!registry.getTool(ENTER_PLAN_MODE_TOOL_NAME)) {
registry.registerTool(new EnterPlanModeTool(this, this.messageBus));
if (this.planEnabled) {
if (!registry.getTool(ENTER_PLAN_MODE_TOOL_NAME)) {
registry.registerTool(new EnterPlanModeTool(this, this.messageBus));
}
} else {
if (registry.getTool(ENTER_PLAN_MODE_TOOL_NAME)) {
registry.unregisterTool(ENTER_PLAN_MODE_TOOL_NAME);
}
}
}