Repository navigation
Add Cursor orchestration group routing - #8436
Conversation
📝 WalkthroughWalkthroughAdded shared Cursor-agent title detection and re-exported it for runtime consumers. Extended orchestration group typing and resolution to support 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e722c224-e60b-4a05-a77f-084745117ca5
📒 Files selected for processing (10)
config/scripts/orchestration-skill-guidance.test.mjsskills/orchestration/SKILL.mdsrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/groups.test.tssrc/main/runtime/orchestration/groups.tssrc/main/runtime/rpc/methods/orchestration.test.tssrc/main/runtime/rpc/methods/orchestration.tssrc/shared/agent-detection.test.tssrc/shared/agent-detection.tssrc/shared/agent-title-core.ts
| - Use `ask` when a worker needs a blocking answer from the coordinator; it waits for the reply and returns the answer directly. | ||
| - `check --wait` returns one message at a time. If N workers may finish together, loop N times and dispatch newly ready tasks after each completion. | ||
| - Group addresses include `@all`, `@idle`, `@claude`, `@codex`, `@opencode`, `@gemini`, `@droid`, `@grok`, and `@worktree:<id>`. | ||
| - Group addresses include `@all`, `@idle`, `@claude`, `@codex`, `@opencode`, `@gemini`, `@droid`, `@grok`, `@cursor`, and `@worktree:<id>`. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Doc list omits @openclaude and @mimo group addresses.
AGENT_NAME_GROUPS in groups.ts includes openclaude and mimo, but this line's group-address list doesn't mention them, so agents following this skill doc won't know those groups are addressable.
📝 Proposed fix
-- Group addresses include `@all`, `@idle`, `@claude`, `@codex`, `@opencode`, `@gemini`, `@droid`, `@grok`, `@cursor`, and `@worktree:<id>`.
+- Group addresses include `@all`, `@idle`, `@claude`, `@openclaude`, `@codex`, `@opencode`, `@mimo`, `@gemini`, `@droid`, `@grok`, `@cursor`, and `@worktree:<id>`.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Group addresses include `@all`, `@idle`, `@claude`, `@codex`, `@opencode`, `@gemini`, `@droid`, `@grok`, `@cursor`, and `@worktree:<id>`. | |
| Group addresses include `@all`, `@idle`, `@claude`, `@openclaude`, `@codex`, `@opencode`, `@mimo`, `@gemini`, `@droid`, `@grok`, `@cursor`, and `@worktree:<id>`. |
The worktree card, status bar, and mobile all derive an agent label from the
terminal title via getAgentLabel / resolveTerminalTitleAgentType. Both matched
Cursor with `titleHasAgentName(title, 'cursor')`, a whole-token match. But
`cursor` is ordinary editor vocabulary, so a Claude/Codex tab working on Orca's
own code (title like `⠋ preserve cursor visibility across replays`) got
mislabeled as Cursor. The generic braille-spinner Claude fallback even had a
`!lower.includes('cursor')` guard that then dropped the title to no label at
all.
Gate Cursor on its closed identity title set (`isCursorAgentTitle`) instead —
the same predicate @cursor orchestration routing uses. A real cursor-agent
terminal still resolves as Cursor across working/idle/permission; a non-Cursor
tab that merely mentions a text cursor reverts to its true agent. Relax the
braille guard to the same predicate so those titles land on Claude, not null.
Makes display consistent with routing (the follow-up flagged in #8436).
#8445) * fix(agent-status): label Cursor by identity, not a bare "cursor" token The worktree card, status bar, and mobile all derive an agent label from the terminal title via getAgentLabel / resolveTerminalTitleAgentType. Both matched Cursor with `titleHasAgentName(title, 'cursor')`, a whole-token match. But `cursor` is ordinary editor vocabulary, so a Claude/Codex tab working on Orca's own code (title like `⠋ preserve cursor visibility across replays`) got mislabeled as Cursor. The generic braille-spinner Claude fallback even had a `!lower.includes('cursor')` guard that then dropped the title to no label at all. Gate Cursor on its closed identity title set (`isCursorAgentTitle`) instead — the same predicate @cursor orchestration routing uses. A real cursor-agent terminal still resolves as Cursor across working/idle/permission; a non-Cursor tab that merely mentions a text cursor reverts to its true agent. Relax the braille guard to the same predicate so those titles land on Claude, not null. Makes display consistent with routing (the follow-up flagged in #8436). * refactor(agent-status): address review on Cursor identity labeling - Trim the four Cursor `// Why:` comments in both parallel resolvers (agent-title-identity.ts, terminal-title-agent-type.ts) to AGENTS.md's one-to-two-line rule; use identical wording so future drift is visible. - Add a direct isClaudeAgent assertion in terminal-title-agent-type.test.ts pinning that file's parallel copy (previously only covered transitively), plus Cursor Agent / "Cursor - action required" activity-facet assertions. Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Orca <help@stably.ai>
Co-authored-by: nikg24 <228026988+nikg24@users.noreply.github.com>
stablyai#8445) * fix(agent-status): label Cursor by identity, not a bare "cursor" token The worktree card, status bar, and mobile all derive an agent label from the terminal title via getAgentLabel / resolveTerminalTitleAgentType. Both matched Cursor with `titleHasAgentName(title, 'cursor')`, a whole-token match. But `cursor` is ordinary editor vocabulary, so a Claude/Codex tab working on Orca's own code (title like `⠋ preserve cursor visibility across replays`) got mislabeled as Cursor. The generic braille-spinner Claude fallback even had a `!lower.includes('cursor')` guard that then dropped the title to no label at all. Gate Cursor on its closed identity title set (`isCursorAgentTitle`) instead — the same predicate @cursor orchestration routing uses. A real cursor-agent terminal still resolves as Cursor across working/idle/permission; a non-Cursor tab that merely mentions a text cursor reverts to its true agent. Relax the braille guard to the same predicate so those titles land on Claude, not null. Makes display consistent with routing (the follow-up flagged in stablyai#8436). * refactor(agent-status): address review on Cursor identity labeling - Trim the four Cursor `// Why:` comments in both parallel resolvers (agent-title-identity.ts, terminal-title-agent-type.ts) to AGENTS.md's one-to-two-line rule; use identical wording so future drift is visible. - Add a direct isClaudeAgent assertion in terminal-title-agent-type.test.ts pinning that file's parallel copy (previously only covered transitively), plus Cursor Agent / "Cursor - action required" activity-facet assertions. Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Orca <help@stably.ai>
Summary
@cursorto the orchestration agent-name groups, so it resolves to running Cursor terminals instead of zero recipientscursoris the one group name that is also ordinary vocabulary in another agent's task titleisCursorAgentTitleout oforca-runtime.tsintosrc/shared/agent-title-core.tsCursor was already first class everywhere else: launchable in
tui-agent-config.ts, managed status hooks, title detection, and--injectaccepts it viaisTerminalRunningAgent. Only the group allowlist omitted it.Design
grok,droid,codex,mimo,geminiare coined names.cursoris an English noun, in a terminal app, that agents type into their own OSC titles constantly. It is the only entry inAGENT_NAMESwith that property, and it is why this group cannot usebuildAgentNameRe.buildAgentNameRe('cursor')returns true for all three titles below. None is a Cursor terminal:⠋ preserve cursor visibility across replays⠋ Codex: fix cursor offsetsTerminal Cursor and Orca slows downNone of Claude Code's four title prefixes (
✳,.,*, braille spinner) contains its own name, so in a Claude terminal working on caret code, "cursor" is the only agent-like token the title has. Group resolution is a routing authority: delivery writes the message into the target terminal's live prompt, so a false positive types into another agent's session. Anyone using Orca to work on Orca hits this, since the codebase talks about cursors constantly.So ambiguous names register an identity matcher instead of a token regex. The resolver keeps no agent-specific branch, and every other group's matching is byte-for-byte unchanged:
isCursorAgentTitleis not new. It already existed privately inorca-runtime.ts, where delivery uses it to suppress synthesized Enter, since Cursor treats injected PTY text as editable prompt input. Its comment names this exact hazard: "display labels can mention Cursor in another agent's task text." Moving it into shared means routing and delivery share one predicate rather than growing a second, weaker one. It is behavior-identical; the only edit is the inline'cursor agent'literal collapsing into theCURSOR_NATIVE_TITLE_LOWERconstant already in that file.That also answers the brittleness question. Delivery's auto-Enter suppression already depends on this vocabulary, so a Cursor label change breaks there first and louder. The vocabulary already had to be maintained; this makes it one place instead of two, and a test pins it against
SYNTHETIC_AGENT_TITLE_PROFILES.cursor.Testing
pnpm lintpnpm typecheckpnpm testpnpm buildorca-runtime.test.tsis not touched by this PR and passes unchanged (660 tests). Its existing case "still auto-submits to a non-Cursor agent when its idle title mentions Cursor Agent" is exactly the delivery behavior the hoist had to preserve, so the pre-existing suite validates it with zero test edits.Dev Electron/runtime validation with live
@cursorrouting: with one realcursor-agentterminal and one decoy titled⠋ preserve cursor visibility across replays,orchestration send --to @cursorresolvedrecipients=1to the Cursor terminal and excluded the decoy.orchestration dispatch --injectreturnedinjected=true, and Cursor executed the task and reportedworker_done. 0 console errors.Screenshots
No visual change.
AI Review Report
Reviewed the diff with three independent agents before filing (Codex GPT-5.6 Sol at max reasoning, Grok 4.5 xhigh, and Composer 2.5), each asked to attack the design rather than confirm it, with every finding required to cite
file:lineand an exact triggering title. All three returned ship with no material findings. Risks checked:grok.exe); Cursor's binary iscursor-agent, so that rule was never load-bearing for it.cursorregisters a matcher. A genericresolveTerminalTitleAgentType(title) === agentNameguard was tried first and rejected, because it silently breaks@mimo: the group name ismimobut its TuiAgent id ismimo-code. It also still mislabels⠋ preserve cursor visibility across replaysas Cursor.@cursortraffic into a live prompt. Residual, and shared with every other group: a user who renames a terminal to an exact agent label can still make it addressable.Notes
@cursoris deliberately less rename-tolerant than other groups. A manually renamed Cursor pane (Cursor - reviewer) is group-unaddressable and resolves to 0 recipients rather than misdelivering; address it by handle. A test pins this so the tradeoff lives in code, not just here.Cursor - action requiredis accepted but not reachable today, since no subscribed Cursor hook event maps to a blocked state. Kept so the group works unchanged if Cursor ships a permission hook.cursorinterminal-title-agent-type.ts, so a cursor-mentioning Claude title is labeled Cursor in the UI while@cursorwill not deliver to it. Routing is deliberately the stricter of the two. Pre-existing and out of scope; happy to follow up separately.