refactor(coding-agent/tools): removed enter-plan-mode tool

- Removed the enter-plan-mode tool, associated prompt, and all event handling code.
This commit is contained in:
can1357
2026-01-27 04:15:32 +01:00
parent a8743c1f91
commit 0f4829376f
9 changed files with 3 additions and 211 deletions
@@ -247,12 +247,6 @@ export class EventController {
this.ctx.setTodos(details.todos);
}
}
if (event.toolName === "enter_plan_mode" && !event.isError) {
const details = event.result.details as import("../../tools").EnterPlanModeDetails | undefined;
if (details) {
await this.ctx.handleEnterPlanModeTool(details);
}
}
if (event.toolName === "exit_plan_mode" && !event.isError) {
const details = event.result.details as ExitPlanModeDetails | undefined;
if (details) {
@@ -29,7 +29,7 @@ import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
import { HistoryStorage } from "../session/history-storage";
import type { SessionContext, SessionManager } from "../session/session-manager";
import { getRecentSessions } from "../session/session-manager";
import type { EnterPlanModeDetails, ExitPlanModeDetails } from "../tools";
import type { ExitPlanModeDetails } from "../tools";
import { setTerminalTitle } from "../utils/title-generator";
import type { AssistantMessageComponent } from "./components/assistant-message";
import type { BashExecutionComponent } from "./components/bash-execution";
@@ -631,25 +631,6 @@ export class InteractiveMode implements InteractiveModeContext {
await this.enterPlanMode();
}
async handleEnterPlanModeTool(details: EnterPlanModeDetails): Promise<void> {
if (this.planModeEnabled) {
this.showWarning("Plan mode is already active.");
return;
}
const confirmed = await this.showHookConfirm(
"Enter plan mode?",
"This enables read-only planning and creates a plan file for approval.",
);
if (!confirmed) {
return;
}
const planFilePath = details.planFilePath || this.getPlanFilePath();
this.planModePlanFilePath = planFilePath;
await this.enterPlanMode({ planFilePath, workflow: details.workflow });
}
async handleExitPlanModeTool(details: ExitPlanModeDetails): Promise<void> {
if (!this.planModeEnabled) {
this.showWarning("Plan mode is not active.");
-1
View File
@@ -178,7 +178,6 @@ export interface InteractiveModeContext {
openExternalEditor(): void;
registerExtensionShortcuts(): void;
handlePlanModeCommand(): Promise<void>;
handleEnterPlanModeTool(details: import("../tools").EnterPlanModeDetails): Promise<void>;
handleExitPlanModeTool(details: ExitPlanModeDetails): Promise<void>;
// Hook UI methods