Cursor subagentStop has no subagent_id; Entire correlation key goes empty
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.1k
- Forks
- 475
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 178
Description
Summary
Official Cursor hooks docs list subagent_id on subagentStart but not on subagentStop. Entire's parseSubagentStop sets ToolUseID/SubagentID from subagent_id, so real Stop payloads yield an empty correlation key.
Impact
- Start writes
pre-task-<id>.json; Stop looks uppre-task-.json→ miss. DetectFileChanges(nil)treats all untracked files as new (spurious task checkpoints).- Real pre-task files are never cleaned up (orphans in
.entire/tmp/). - Parallel subagent Stops all collide on the empty key.
Stop does include task and agent_transcript_path, which can be used to recover the id.
Expected
Resolve the Start-side pre-task id on Stop when subagent_id is absent (e.g. match stored task description, or unambiguous single active pre-task).
Refs
- https://cursor.com/docs/hooks.md (
subagentStartvssubagentStopinput tables)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read parseSubagentStop and the pre-task handling around .entire/tmp; compare Cursor’s subagentStart and subagentStop payload tables, including task and agent_transcript_path. Done means Stop resolves the Start-side id without subagent_id, avoids empty-key collisions, cleans the matching pre-task file, and prevents spurious DetectFileChanges(nil) results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100