Skip to content

Commit 97c4c06

Browse files
authored
🤖 fix: guide agent to evaluate plan relevance before incremental edits (#1037)
## Problem When a user requests a new plan for something entirely different from the previous task, the agent keeps referring to and building upon the old plan. This happens because: 1. The plan file persists across different requests (stored at `~/.mux/plans/{workspaceId}.md`) 2. When `planExists` is true, the instruction said: "You can read it and make incremental edits" 3. This biased the agent toward incremental edits rather than recognizing when a fresh start is needed ## Solution Updated `getPlanModeInstruction` to give the agent clear guidance about evaluating whether the existing plan is relevant: 1. **Read first** - Agent must read the plan before deciding 2. **Evaluate relevance** - Explicitly check if it relates to current request 3. **Delete if unrelated** - Clear guidance to remove stale plans 4. **Keep incremental edits** - Still available when plan IS relevant _Generated with `mux`_
1 parent ce16695 commit 97c4c06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/common/utils/ui/modeUtils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ToolPolicy } from "@/common/utils/tools/toolPolicy";
77
*/
88
export function getPlanModeInstruction(planFilePath: string, planExists: boolean): string {
99
const fileStatus = planExists
10-
? `A plan file already exists at ${planFilePath}. You can read it and make incremental edits using the file_edit_* tools.`
10+
? `A plan file already exists at ${planFilePath}. First, read it to determine if it's relevant to the current request. If the current request is unrelated to the existing plan, delete the file and start fresh. If relevant, make incremental edits using the file_edit_* tools.`
1111
: `No plan file exists yet. You should create your plan at ${planFilePath} using the file_edit_* tools.`;
1212

1313
return `You are in Plan Mode. ${fileStatus}

0 commit comments

Comments
 (0)