You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(plan-todo): replace hard gate with soft reminder after 10 tool calls
The stale-todo mechanism previously blocked every non-read-only tool call
after the first successful one until todo_write was called, causing
repeated failures in batched tool execution. Replace the boolean
requiresRefresh flag with a counter (toolCallsSinceLastTodoWrite) and
emit a non-blocking prompt addendum after 10+ calls without an update.
Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -53,11 +53,12 @@ export function createPlanTodoStateManager(): PlanTodoStateManager {
53
53
"Represent completed items as `- [x]` and remaining items as `- [ ]`.",
54
54
].join("\n");
55
55
}
56
-
if(state.requiresRefresh){
56
+
if(state.toolCallsSinceLastTodoWrite>=10){
57
57
return[
58
-
"Your todo checklist is stale.",
59
-
`Before the next non-read-only tool call, you MUST call \`${TODO_WRITE_TOOL_NAME}\` again and update the markdown checklist to reflect the latest completed steps.`,
60
-
].join("\n");
58
+
`You haven't updated the todo list in a while (${state.toolCallsSinceLastTodoWrite} tool calls since last update).`,
59
+
`Consider calling \`${TODO_WRITE_TOOL_NAME}\` to reflect your current progress.`,
60
+
"This is a gentle reminder — ignore if not applicable.",
61
+
].join(" ");
61
62
}
62
63
returnundefined;
63
64
}
@@ -76,12 +77,6 @@ export function createPlanTodoStateManager(): PlanTodoStateManager {
76
77
`Call \`${TODO_WRITE_TOOL_NAME}\` first with a markdown checklist based on the approved plan, then retry this tool.`,
77
78
].join(" ");
78
79
}
79
-
if(state.requiresRefresh){
80
-
return[
81
-
"The todo list is stale after progress was made on the approved plan.",
82
-
`Call \`${TODO_WRITE_TOOL_NAME}\` first to update the markdown checklist and mark completed items, then retry this tool.`,
83
-
].join(" ");
84
-
}
85
80
returnundefined;
86
81
}
87
82
@@ -93,15 +88,15 @@ export function createPlanTodoStateManager(): PlanTodoStateManager {
0 commit comments