Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

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

When a plan file exists, the instruction now tells the agent to:
1. Read the existing plan first
2. Evaluate if it's relevant to the current request
3. Delete and start fresh if unrelated
4. Only make incremental edits if the plan is relevant

This prevents the agent from building upon stale plans when users
switch to entirely different tasks.

_Generated with mux_
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ammario ammario merged commit 97c4c06 into main Dec 9, 2025
20 checks passed
@ammario ammario deleted the fix-agent-plan-reference-bug branch December 9, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants