Repository navigation
fix(orchestration): submit mail pointers to Cursor CLI instead of leaving them in the composer - #33347
Merged
Conversation
…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>
Contributor
|
Warning Review limit reachedYou'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. View limit details
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 |
…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>
Closed
7 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 matchedisCursorAgentTitle. It marked the mail delivered and skipped the delayed\r.git log -S isCursorAgentTitletraces 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)
cursor-agent2026.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 treatsreturnas a newline only during such a paste-like burst (at.current>=3). Otherwiseif(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.cursor-agent2026.10.22-27dcf5f (tarball fromdownloads.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)))}).\ras a separate write afterenterDelayMs(500 ms). That is far outside the 35 ms burst window, so Cursor submits it.What changed
mailbox-pointer-stage.ts: removed the Cursor title early return (from fix(orchestration): submit Cursor CLI mail pointers instead of leaving them in the composer #19761). Cursor now uses the same pointer-then-Enter path as every other agent.orchestration-idle-mail-delivery.spec.ts: the Cursor case now expects the pointer to be submitted (from fix(orchestration): submit Cursor CLI mail pointers instead of leaving them in the composer #19761).PointerDeliveryDependencies.getTabTitleand the line that supplied it inruntime-service-state.ts. The Cursor skip was the only code that read it.mailbox-pointer-stage.test.ts.orca-runtime-deliver-pending-messages.tsandorca-runtime-core.tsare gone. Main already deleted that path in refactor(orchestration): delete the unreachable pre-mailbox terminal delivery path #30576.Verification
submits the pointer with Enter for a Cursor Agent panefails on main (no\rwritten) and passes with the fix.pnpm test src/main/runtime/orchestration/: 123 files, 982 tests pass.tests/e2e/orchestration-idle-mail-delivery.spec.ts(electron-headless, background): 12/12 pass, includingwrites and submits the pointer for a Cursor agent pane.pnpm tcandpnpm run check:code-quality:changedboth pass.cursor-agent. The local CLI is not logged in (agent -preturns "Authentication required"), so the composer can't be reached in a PTY. The submit behavior above comes from reading the shipped bundle.Risk
→. A Cursor draft in progress gets no extra protection from either.writeOrchestrationPointerPty, and Enter is still\rafter the existing delay.Fixes #19760
Supersedes #19761
Co-authored-by: Maple 54388301+zleo-ai@users.noreply.github.com