Skip to content

fix(orchestration): submit mail pointers to Cursor CLI instead of leaving them in the composer - #33347

Merged
nwparker merged 4 commits into
mainfrom
nwparker/agint-19760-cursor-pointer-enter
Oct 25, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/agint-19760-cursor-pointer-enter

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36 $\color{#cf222e}{\Huge{\mathbf{−}}}$​51 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15
Prod 3 0 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13

ELI5

When Cursor CLI is a coordinator, Orca types "You have N orchestration messages. Run orca orchestration check" into its prompt box and then never presses Enter, so the message sits there. Every other agent gets the Enter. Now Cursor gets it too.

This is a rebase of #19761 by @zleo-ai (author commit kept as-is), plus a small cleanup on top.

Root cause

finishPointerWriteAndStageEnter (src/main/runtime/orchestration/mailbox-pointer-stage.ts) returned early for any pane whose OSC, pane, or tab title matched isCursorAgentTitle. It marked the mail delivered and skipped the delayed \r.

git log -S isCursorAgentTitle traces the skip to #3156 (fix for #3034, May 2026). That issue was a UX complaint about the old idle delivery, which pasted the whole --- Orchestration Messages (N) --- block plus Enter into a Cursor tab the user was typing in. Cursor CLI never had a technical problem with Enter. Since then the payload has become a one-line pointer, and delivery only happens when agent-status hooks report the pane live and idle (Cursor has managed hooks). Leaving the pointer unsubmitted is worse than either option: the mail is marked delivered but never acted on, pointer lines pile up in the composer, and they get sent along with the user's next prompt. That is the bug in #19760.

Typing while a pointer is submitted is a risk for every agent, not just Cursor. It is tracked separately in #14832. Turning pointers off entirely is #16822.

Upstream cursor-agent check (closed source; read from the shipped bundle)

  • Installed cursor-agent 2026.06.02-8c11d9f, 5678.index.js: the composer counts keystrokes that arrive less than 35 ms apart (at.current = D<35 ? at.current+1 : 1). It treats return as a newline only during such a paste-like burst (at.current>=3). Otherwise if(n.return){… return void(M&&(Et(),M(I)))} submits. A multi-character chunk containing \n, like the pointer, is inserted as text, so the pointer alone never submits.
  • Latest cursor-agent 2026.10.22-27dcf5f (tarball from downloads.cursor.com/lab/2026.10.22-27dcf5f/darwin/arm64/agent-cli-package.tar.gz), 8116.index.js: same logic (dt.current=p<35?dt.current+1:1, if(n.return){if(dt.current>=3)…return void(v&&(Wt(),v(x)))}).
  • Orca sends \r as a separate write after enterDelayMs (500 ms). That is far outside the 35 ms burst window, so Cursor submits it.

What changed

Verification

  • New unit case submits the pointer with Enter for a Cursor Agent pane fails on main (no \r written) and passes with the fix.
  • pnpm test src/main/runtime/orchestration/: 123 files, 982 tests pass.
  • E2E tests/e2e/orchestration-idle-mail-delivery.spec.ts (electron-headless, background): 12/12 pass, including writes and submits the pointer for a Cursor agent pane.
  • pnpm tc and pnpm run check:code-quality:changed both pass.
  • Not done: a live end-to-end run with real cursor-agent. The local CLI is not logged in (agent -p returns "Authentication required"), so the composer can't be reached in a PTY. The submit behavior above comes from reading the shipped bundle.

Risk

Fixes #19760
Supersedes #19761

Co-authored-by: Maple 54388301+zleo-ai@users.noreply.github.com

zleo-ai and others added 2 commits October 24, 2026 18:50
…gents

Cursor titles used to skip the delayed Enter after the idle mail pointer
(#3156). Current cursor-agent leaves that text in the composer, so the
nudge never runs. Use the same paste-then-Enter path for Cursor.

Fixes #19760
…sor submit test into the stage suite

The Cursor Enter skip was the only reader of PointerDeliveryDependencies.getTabTitle.
One staging case now guards the regression instead of a parallel harness.

Co-authored-by: Maple <54388301+zleo-ai@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3c17349b-6684-48c4-a885-ec867f1444db
Commits

Reviewing files that changed from the base of the PR and between f66c4c0 and eb44abb.

Files selected for processing: 7
  • src/main/runtime/construction/runtime-service-state.ts
  • src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts
  • src/main/runtime/orchestration/mailbox-pointer-delivery-contract.ts
  • src/main/runtime/orchestration/mailbox-pointer-stage.test.ts
  • src/main/runtime/orchestration/mailbox-pointer-stage.ts
  • tests/e2e/helpers/orchestration-mail-pane-agent.ts
  • tests/e2e/orchestration-idle-mail-delivery.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

nwparker and others added 2 commits October 24, 2026 23:48
…er the mail pointer

Drops the title false-positive case; no title gates the pointer Enter any more.

Co-authored-by: Maple <54388301+zleo-ai@users.noreply.github.com>
@nwparker
nwparker merged commit e13e5e8 into main Oct 25, 2026
51 checks passed
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.

[Bug]: Cursor CLI orchestration mail pointer is typed but never submitted

2 participants