Skip to content

Fix: don't restart Cursor with a verify reminder after the user stopped the turn - #192

Open
aayank13 wants to merge 1 commit into
mainfrom
fix/cursor-stop-status
Open

aayank13 wants to merge 1 commit into
mainfrom
fix/cursor-stop-status

Conversation

@aayank13

Copy link
Copy Markdown
Owner

Fixes #156

Cursor's stop hook reports how the turn ended in status: completed, aborted or error. The adapter ignored it, so with the verify reminder on, a turn that ended any way at all got a followup_message if the recalled check had not run since the last edit. Cursor sends that message as a new user message, so pressing Stop in the middle of a turn started the agent again with "Run it once before finishing", which is exactly what the user had just said not to do. A turn that died on an error was restarted the same way.

The adapter now reads status and only treats a completed stop as one that may be followed up. An aborted or error stop still ends the turn and still queues ingest as before, it just never gets a reminder. A stop with no status keeps the old behavior, so older Cursor builds are not affected. Because no reminder is shown on a stopped turn, the injection is not marked as reminded, so if the user carries on and the next turn completes without running the check, the reminder shows up then.

The change is limited to the Cursor adapter. It reuses the existing continued flag on the turn end, which is what already suppresses a second reminder after loop_count goes above zero, rather than adding a new kind of turn end that every other agent would have to handle.

To reproduce, I built the binary, pointed TRODDEN_HOME at a scratch directory with the verify reminder on, a procedure whose check is npm test and an injection for the conversation, and piped real Cursor hook payloads into trodden hook cursor: an afterFileEdit, then stop with status set to aborted, error and completed in turn. Before the fix the aborted stop printed a followup_message. After the fix the aborted and error stops print nothing and the following completed stop prints the reminder. A new test checks that aborted and error stops never render a reminder (it fails without the fix), and the existing stop test now also covers a stop with no status.

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.

Cursor: the verify reminder restarts the agent after the user stopped the turn

1 participant