Title: Orchestration mail should inject a pointer, not the payload (finishes #12536, fixes #7337 for worker panes) · Issue #12953 · stablyai/orca · GitHub
Open Graph Title: Orchestration mail should inject a pointer, not the payload (finishes #12536, fixes #7337 for worker panes) · Issue #12953 · stablyai/orca
X Title: Orchestration mail should inject a pointer, not the payload (finishes #12536, fixes #7337 for worker panes) · Issue #12953 · stablyai/orca
Description: Split out from #12584, which fixed the first half of #12536 (mail to an already-idle recipient never fired). Two related problems remain, and they share one root cause. What's still broken 1. A bound coordinator receives mail but never a...
Open Graph Description: Split out from #12584, which fixed the first half of #12536 (mail to an already-idle recipient never fired). Two related problems remain, and they share one root cause. What's still broken 1. A bou...
X Description: Split out from #12584, which fixed the first half of #12536 (mail to an already-idle recipient never fired). Two related problems remain, and they share one root cause. What's still broken 1. A...
Opengraph URL: https://github.com/stablyai/orca/issues/12953
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Orchestration mail should inject a pointer, not the payload (finishes #12536, fixes #7337 for worker panes)","articleBody":"Split out from #12584, which fixed the first half of #12536 (mail to an already-idle recipient never fired). Two related problems remain, and they share one root cause.\n\n## What's still broken\n\n**1. A bound coordinator receives mail but never acts on it (#12536's second half)**\n\n`deliverPendingMessages` writes the banner, then returns early for the active `coordinator_handle` without the delayed Enter, so the text sits at the prompt unsubmitted. The row is still stamped `delivered_at`, so push never retries it.\n\nNote this cannot be fixed by making the coordinator auto-submit. `worker_done`/`heartbeat` are readdressed to `run:\u003cid>` in `rpc/methods/orchestration.ts` whenever the sender has a run and a dispatch, and `run:` is not a terminal handle, so it is rejected before delivery. Lifecycle mail reaches a coordinator only through `check --wait`. The fix belongs at the `run:` consumer layer, not the push path.\n\n**2. Mail still clobbers a half-typed prompt (#7337 is only partly fixed)**\n\nThe original report was a user mid-sentence in the orchestrator whose partial text was submitted together with an incoming worker message. #7391 removed the synthesized Enter for the coordinator pane, but left the write in place — so the banner is still pasted into whatever you were typing, and `delivered_at` is stamped for mail nobody acted on.\n\nWorse, the guard barely applies. `getActiveCoordinatorRun()` is an unscoped global `SELECT ... WHERE status='running' ORDER BY created_at DESC LIMIT 1` over `coordinator_runs`, a table written only by `orchestration.run` and `Coordinator.run()`. No CLI command writes it — the CLI's `run-create` writes the modern `runs` table. So in CLI-driven workflows the branch effectively never fires, and **a human typing into a worker pane gets the banner plus a synthesized Enter today**.\n\n#12584 makes this more likely to bite, not less: push previously fired only on a busy->idle transition, so a pane you were merely typing in was rarely targeted. It now fires the moment mail is sent.\n\n## Root cause\n\nThe terminal write carries the **payload**. That makes a collision destructive (a real instruction is corrupted and lost) rather than cosmetic.\n\n## Proposed direction\n\n**Inject a pointer, not the payload.** Write a short line — \"you have N orchestration messages, run `orca orchestration check`\" — and keep the content in the store the agent reads on demand. Then:\n\n- A collision garbles a short machine-generated string instead of losing a task.\n- Delivery stops being an event that can be missed. The row is durable, so any later trigger drains it; already-idle stops being a special case.\n- `delivered_at` regains an honest meaning: the pointer is not the delivery, the `check` is.\n\n**Then wire `check --inject` into the `UserPromptSubmit` hooks Orca already installs** (~18 agents under `src/main/*/hook-service.ts`), so mail arrives at turn boundaries and the pointer write becomes the rare fallback for runtimes without hooks.\n\nTwo caveats worth carrying:\n- Hooks are reliable for *delivery at turn boundaries* but not as *lifecycle state authority* — they miss transitions (cancellations, interrupts). Keep title/process detection as the status source.\n- `UserPromptSubmit` does not fire for an idle agent nobody is talking to, so a wake path is still needed. That is what the pointer write is for.\n\n**Also worth adopting:** invert the trigger. Send, then use the state change only to *confirm* delivery landed, against a monotonic sequence counter rather than a status comparison — a fast idle->working->idle turn produces no status difference but does bump a counter — with a bounded timeout and a distinct \"no observed effect\" error, so an ineffective injection surfaces instead of failing silently.\n\n## Rejected\n\nTracking unsubmitted keystrokes per pane to detect a draft. Implemented and tested, then discarded: the counter tracks magnitude, which is unknowable. Word-deletion (Ctrl+W, Ctrl+K, Alt+Backspace) empties the box without decrementing, leaving the pane permanently \"dirty\" so mail defers forever — and there is currently no UI surface for pending mail, so that stranding is silent. Ctrl+W cannot be treated as a clear either, since it deletes one word and the box may still hold text.\n\nPrompt-emptiness detection from rendered output was also assessed as unreliable: the composer always renders something, and stripping ANSI makes a dim placeholder byte-identical to typed text. It may be feasible if cell attributes are retained (the emulator is xterm-backed, so the data exists even though `getVisibleLines()` discards it) — unverified, and unnecessary if the terminal only ever carries a pointer.\n","author":{"url":"https://github.com/Jinwoo-H","@type":"Person","name":"Jinwoo-H"},"datePublished":"2026-08-06T22:06:50Z","url":"https://github.com/stablyai/orca/issues/12953"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:14d31006-a8de-47bb-a3a7-9b1277fe1a2d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A32A:4A706:C12EA:FAFAF:6AEBDFDD |
| html-safe-nonce | e4d3d076be8bb1d2e63cb111d26598eca243e430ff91f8ba7961ba52ec8a9132 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzJBOjRBNzA2OkMxMkVBOkZBRkFGOjZBRUJERkREIiwidmlzaXRvcl9pZCI6IjkxNTQ0MzExMDQ4MDg5MDI2MjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 56323889765635ed134883cf336f67846a5ad5ae678c310a559a616e5da24a54 |
| hovercard-subject-tag | issue:5085045551 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stablyai/orca/12953/issue_layout |
| twitter:image | https://opengraph.githubassets.com/812d963507f2bb1f3e7fb34536df200f1445bbd2f4074ad681a2c14a8f015dac/stablyai/orca/issues/12953 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/812d963507f2bb1f3e7fb34536df200f1445bbd2f4074ad681a2c14a8f015dac/stablyai/orca/issues/12953 |
| og:image:alt | Split out from #12584, which fixed the first half of #12536 (mail to an already-idle recipient never fired). Two related problems remain, and they share one root cause. What's still broken 1. A bou... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jinwoo-H |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb4fe414357cc0dbc2996fde3e4947524ebbb7f50a92a6e6934fee909acf2c00 |
| turbo-cache-control | no-preview |
| go-import | github.com/stablyai/orca git https://github.com/stablyai/orca.git |
| octolytics-dimension-user_id | 127256420 |
| octolytics-dimension-user_login | stablyai |
| octolytics-dimension-repository_id | 1183888342 |
| octolytics-dimension-repository_nwo | stablyai/orca |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1183888342 |
| octolytics-dimension-repository_network_root_nwo | stablyai/orca |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5295beeefa36b9ce5c704f35fdc483ebb6f2cb19 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width