Skip to content

feat(cursor): multitask slash, auto-review mode, Cursor-native worktree/multi-root #1013

Description

@swear01

Summary

Close the highest-value Cursor Agent CLI gaps in HAPI remote sessions:

  1. /multitask + related slash pass-through (and better subagent task visibility)
  2. autoReview permission mode (Cursor Auto-review / Smart Auto)
  3. Cursor-native --worktree / --add-dir for Cursor sessions (plus mid-session slash)

Also expand Cursor slash pass-through to commands that are actually useful over ACP (text prompt), not interactive TUI menus.

Research notes (ACP probe on agent 2026.07.09)

  • Cursor ACP configOptions.mode only exposes agent | plan | ask (no debug, no auto-review).
  • Auto-review is a spawn flag: agent --auto-review acp works; mid-session toggle is slash /auto-review.
  • Cursor-native worktree works as agent --worktree <name> acp~/.cursor/worktrees/<repo>/<name>.
  • Multitask / best-of-n / worktree apply-delete / add-dir are agent slash commands, not ACP config options — remote HAPI should isolate + pass them through as prompts (same pattern as /compress).

Slash pass-through: include vs exclude

Include (agent-executable as prompt; useful remotely):

  • already: /compress, /model
  • add: /summarize, /compact (aliases)
  • add: /multitask, /best-of-n
  • add: /worktree, /apply-worktree, /delete-worktree
  • add: /add-dir
  • add: /context, /fork
  • add: /auto-review

Exclude (interactive TUI / IDE-only / needs special protocol):

  • /config, /mcp, /sandbox, /plugins, /vim, /copy, /logs, /statusline, /btw, /rewind, /resume, /login, /logout, /update
  • Mode switches /ask /plan /debug — already covered by HAPI permission-mode UI via ACP set_config_option

Acceptance criteria

1) Slash pass-through

  • Listed include-commands are isolated in the message queue (not newline-batched)
  • ACP + legacy remote launchers show a short status line and forward the command text to the agent
  • Unit tests cover parsing + isolation

2) Auto-review mode

  • autoReview added to CURSOR_PERMISSION_MODES (+ labels/tones + schema allowlist)
  • New Cursor ACP sessions with autoReview spawn agent --auto-review … acp
  • Mid-session switch to autoReview keeps ACP mode=agent and sends isolated /auto-review once (best-effort; ACP has no config option)
  • Web permission picker shows Auto-review for Cursor

3) Cursor-native worktree / multi-root

  • For agent=cursor + New Session sessionType=worktree, runner does not create HAPI-side worktree; instead passes Cursor --worktree into ACP spawn
  • Optional --add-dir / repeated dirs supported on ACP spawn (CLI flag + runner plumbing); mid-session /add-dir via pass-through
  • Session metadata records Cursor worktree path when known (stderr Using worktree: … or resolved path)
  • Non-Cursor agents keep existing HAPI createWorktree behavior

4) Subagent visibility (MVP)

  • cursor/task notifications render as live CursorTask tool cards with status from payload when present (running/completed), not always force-completed
  • Docs note: full Agents Window fleet UI is out of scope; multitask is slash-driven

Out of scope (follow-ups)

  • Cloud Agents / /in-cloud / private worker
  • Interactive /sandbox /mcp /config remote UIs
  • /btw mid-turn overlay, /rewind timeline
  • True non-interrupting multitask orchestration UI

Test plan

  • bun typecheck && bun run test (shared + cli cursor suites)
  • Unit: special-command parser, acp backend arg builder, modes allowlist, runner cursor-worktree branch
  • Manual (optional): remote Cursor session — /multitask …, permission Auto-review, New Session worktree for Cursor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions