Skip to content

feat(cursor): support subagents and sessionEnd lifecycle - #1

Open
RaminGe wants to merge 1 commit into
develop212:mainfrom
RaminGe:feat/cursor-subagent-lifecycle
Open

RaminGe wants to merge 1 commit into
develop212:mainfrom
RaminGe:feat/cursor-subagent-lifecycle

Conversation

@RaminGe

@RaminGe RaminGe commented Oct 20, 2026

Copy link
Copy Markdown

Beautiful project, some improvements for cursor might follow in the next time from me :)

Summary

Brings the Cursor adapter to parity with the Claude Code adapter by adding support for subagents and proper session termination:

  1. Subagents (subagentStart & subagentStop):

    • subagentStart: Spawns a helper teammate (parent: lead, role: subagent_type) attached to the lead's desk pod, briefed with an initial message from the lead.
    • subagentStop: Helper reports back to the lead with a summary message and is marked done, allowing the floor engine's helper auto-sweep to clean it up cleanly.
    • cursorResponse: Answers {"permission": "allow"} for subagentStart so subagents are not blocked by the hook handshake.
  2. Session Cleanup (sessionEnd):

    • Emits a leave event when a session ends or a chat window is closed, so agents depart through the door instead of lingering idle until the stale timeout.
  3. CLI & Docs:

    • Added subagentStart, subagentStop, and sessionEnd to cursorHooks() in bin/agent-floor.mjs (for agent-floor setup cursor).
    • Updated docs/integrations.md with the new hooks.
    • Added unit tests in test/protocol.test.mjs (11/11 tests passing).

- Handle subagentStart: spawns a helper agent attached to the parent lead and briefs it with a message
- Handle subagentStop: reports back to lead with a message, marks helper done for auto-sweep
- Handle sessionEnd: emits leave so the agent departs when a session is closed
- Allow subagentStart in cursorResponse handshake
- Add subagentStart, subagentStop, sessionEnd to cursorHooks setup list and docs
@RaminGe
RaminGe force-pushed the feat/cursor-subagent-lifecycle branch from 419e0ba to 5f67303 Compare October 20, 2026 13:50

This branch has not been deployed

No deployments
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.

1 participant