fix(plan-mode): make execution mode clearer to agent

- Add explicit [PLAN MODE DISABLED - EXECUTE NOW] message
- Emphasize FULL access to all tools in execution context
- List remaining steps in execution context
- Prevents agent from thinking it's still restricted
This commit is contained in:
Helmut Januschka 2026-01-03 21:50:19 +01:00
parent 14d55d8fd3
commit b1f574f7f7

View file

@ -425,11 +425,13 @@ Do NOT attempt to make changes - just describe what you would do.`,
if (executionMode && todoItems.length > 0) {
const completed = todoItems.filter((t) => t.completed).length;
const remaining = todoItems.filter((t) => !t.completed).map((t) => t.text);
return {
message: {
customType: "plan-execution-context",
content: `[EXECUTING PLAN - ${completed}/${todoItems.length} complete]
Continue executing the plan step by step.`,
Plan mode is OFF. You have FULL access to: read, write, edit, bash.
${remaining.length > 0 ? `Remaining steps:\n${remaining.map((t, i) => `${i + 1}. ${t}`).join("\n")}` : "All steps complete!"}`,
display: false,
},
};
@ -509,8 +511,12 @@ Continue executing the plan step by step.`,
updateStatus(ctx);
const execMessage = hasTodos
? `Execute the plan step by step. Start with: ${todoItems[0].text}`
: "Execute the plan you just created. Proceed step by step.";
? `[PLAN MODE DISABLED - EXECUTE NOW]
You now have FULL access to all tools: read, write, edit, bash.
Execute the plan step by step. Start with: ${todoItems[0].text}`
: `[PLAN MODE DISABLED - EXECUTE NOW]
You now have FULL access to all tools: read, write, edit, bash.
Execute the plan you just created. Proceed step by step.`;
pi.sendMessage(
{