Skip to content

feature: cursor-agent monitor, and pid name for cursor-agent #856

Description

@apstndb

Summary

Builtin cursor monitor is not useful unless the pid walk can see cursor-agent.

  1. _agmsg_agent_binaries does not list cursor-agent, so cursor falls through to claude codex gemini. Watchers are not liveness-gated. Manifest already has detect_proc.
  2. Builtin cursor is delivery_modes=turn off. Cursor Agent CLI has no Monitor tool; idle wake is Shell notify_on_output. Offer monitor (BETA is fine). Keep monitor=no on spawn.

Needs the #477 - fold (sibling #855 / #857) because the launch command uses "${CURSOR_CONVERSATION_ID:--}". That is a runtime dependency, not a git stack: #858 stays a draft until #857 and #860 have landed.

The grok-build pid mapping is independently mergeable on #859 / #860.

Pid name

. scripts/lib/resolve-project.sh
_agmsg_agent_binaries cursor        # claude codex gemini  (wrong)

Fix, before the * arm:

cursor)      echo "cursor-agent" ;;

The matcher already accepts "$bin"|"$bin"-*. Follow-up (not this issue): read detect_proc from type.conf for plugins (#631).

Shared basename agent

Do not add agent to _agmsg_agent_binaries or to detect_proc for cursor or grok-build.

Homebrew grok-build installs both grok and agent. The Cursor CLI installer also ships agent as an alias of cursor-agent. The basename is not type-distinctive. detect_proc globs are required to be disjoint (detect-cli-type.sh); a shared name would attach the wrong pid (#93).

Env detection already distinguishes the CLIs (CURSOR_AGENT / CURSOR_CONVERSATION_ID vs GROK_SESSION_ID). Pid walk still needs distinctive comm/argv0 (cursor-agent, grok) to find the enclosing process. Missing the alias is intentional. Disambiguating via cmdline or install path is a follow-up, not this issue.

Also do not list cursor (the desktop app code shim).

#860 comments this omission on _agmsg_agent_binaries.

Cursor monitor

  • type.conf: delivery_modes=turn monitor off. Optional detect=CURSOR_AGENT CURSOR_CONVERSATION_ID.
  • _delivery.sh: keep the existing turn .mdc + check-inbox.sh rule. Add a monitor rule that launches watch.sh once via Shell + notify_on_output. Status must distinguish turn vs monitor. Short AGMSG-DIRECTIVE on set monitor.
  • template.md: offer monitor; Ensure-monitor; actas/drop 4th arg; mode accepts monitor, rejects both.

Do not invent a Monitor tool. Do not use /loop sleep as delivery. Do not change grok caller templates.

Maintainer merge order

  1. fix(watch): fold sentinel '-' into the empty session-id path #857 and fix(resolve): map grok-build to grok in the pid walk #860 — independently mergeable, either order
  2. Rebase feat(cursor): offer monitor delivery and name cursor-agent #858 onto main (picks up the fold, the grok arm, and the agent comment) and then merge. Keep feat(cursor): offer monitor delivery and name cursor-agent #858 a draft until that rebase; do not mark it ready earlier.

Related

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