Repository navigation
refactor(orchestration): delete the unreachable pre-mailbox terminal delivery path - #30576
Conversation
…delivery path OrcaRuntimeWithDeliverPendingMessages.deliverPendingMessages was only reachable from itself and settlePendingMessageDelivery, which was only reachable from it. Live terminal mail delivery goes through OrchestrationMailboxPointerDelivery (stage/submit), so this removes the dead mixin link, its settle method, its state fields (flights, parked redeliveries, probe dedupe, pointer watermarks), and the now-unused isCursorAgentOrchestrationTarget and RuntimeMessageWaiters.typeHasLiveWaiter. No behaviour change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
Orca had two copies of the code that types "you have new mail" into an agent's terminal. Only the newer copy was ever called. This deletes the old copy and the bookkeeping that only it used.
What Changed
Before / after for users: nothing changes. The deleted code could not run.
Mechanism: when an orchestration message arrives for an agent running in a terminal, Orca types a short pointer ("check your mail") into that terminal and presses Enter. That job is done by
OrchestrationMailboxPointerDelivery(mailbox-pointer-delivery.ts,mailbox-pointer-stage.ts,mailbox-pointer-submit.ts). It records each step in the orchestration database so delivery survives a restart.An older version of the same job,
deliverPendingMessagesinorchestration/mail/terminal-message-delivery.ts, was still part of the runtime class chain. Its only callers were itself (after a liveness probe) andsettlePendingMessageDelivery, and that method's only caller wasdeliverPendingMessages. Nothing outside that pair, including tests, reached either of them.Removed:
OrcaRuntimeWithResolveWaiternow extends the next class,OrcaRuntimeWithResolveExitWaiters, directly;settlePendingMessageDeliveryand the abstractdeliverPendingMessagesdeclaration;isCursorAgentOrchestrationTargetandRuntimeMessageWaiters.typeHasLiveWaiter, whose only caller was the old path;Why
Dead code that looks live misleads readers. We found this while planning a shared "submit text to an agent terminal" helper: the old file looked like the obvious place to extract from, but it never runs. Deleting it removes about 265 lines and a link in the runtime class chain, with no behaviour to preserve. The alternative, leaving it and documenting it as unused, keeps the trap in place.
Linked Issue
None. Internal cleanup.
Visual Proof
N/A. No UI or behaviour change; the removed code could not run.
Testing
pnpm tc:node: no type errors.oxlint and
oxfmt --checkon the changed files, pluspnpm run check:code-quality:changed: clean.pnpm test --maxWorkers=2over the orchestration mailbox and mailbox-pointer tests, the main runtime test file (orca-runtime.test.ts) and the runtime terminal-wait, liveness, delivery and message-waiter tests: 18 files, 1769 passed, 1 skipped.I manually tested these changes locally
Automated tests added/updated, or explained why not below. No new tests: deleting unreachable code; the existing delivery tests cover the live path.
AI Disclosure
Review
Agent skill upstream boundary
Notes
Security, cross-platform, SSH/remote, mobile, backwards compatibility, performance: no impact. Only unreachable main-process code is removed; no wire, schema or stored-data change.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)