orca icon indicating copy to clipboard operation
orca copied to clipboard

Orchestration completion can remain unseen without an explicit inbox poll

Open wohsj110 opened this issue 4 months ago • 3 comments

Environment

  • Orca macOS 1.4.136 (com.stablyai.orca)
  • Local runtime was healthy: orca status --json reported ready / reachable: true
  • macOS, local dispatch

Observed

A dispatched worker emitted several heartbeat messages followed by worker_done. The coordinator conversation did not surface the completion until I explicitly ran:

orca orchestration check --unread --json

That check returned the prior heartbeats and the completion event together. The event timestamps in the result were represented without an offset (for example created_at: "2026-07-14 08:08:02"), while the host used CST / UTC+08:00, which also made perceived delay difficult to interpret.

Expected

Either:

  1. worker_done and important heartbeats are proactively surfaced to the supervising coordinator session, or
  2. the product/docs clearly state that coordinators must maintain a long-lived orca orchestration check --wait ... loop and expose an unambiguous notification when that loop is absent.

Timestamps should include an explicit UTC offset or be documented as UTC.

Why it matters

A coordinator can incorrectly report a task as still running after it has completed, especially during long device-verification flows.

Note

This report does not claim the runtime transport itself is definitely delayed: the same symptom may be caused by missing coordinator polling. The issue is that completion visibility and timestamp semantics are insufficiently clear to distinguish the two.

Made with Orca 🐋

wohsj110 avatar Jul 14 '26 08:07 wohsj110

Thanks for the report — taking a look!

brennanb2025 avatar Jul 17 '26 08:07 brennanb2025

Confirming this on a separate incident with Orca v1.4.144 (orca serve on Linux, paired macOS client). A worker sent heartbeats and a final worker_done; the task was durably marked completed, but the coordinator did not see the completion until an explicit unread/inbox check.

The implementation explains the behavior: orchestration.send reconciles worker_done into the database and then calls notifyMessageArrived. That notification only wakes a recipient already blocked in check --wait; if no waiter exists at that instant, the message remains unread until the next poll (src/main/runtime/rpc/methods/orchestration.ts and src/main/runtime/orca-runtime.ts).

There was also a coordinator-side recovery miss in this incident: after interruption, it did not immediately sweep unread messages and task state. The deterministic workaround we are now using is:

  1. Keep a filtered check --wait active for worker_done,escalation,decision_gate across the dispatch window.
  2. Re-arm it immediately after every wake.
  3. Sweep unread messages, inbox, and task state at every recovery/checkpoint boundary.
  4. Preserve both taskId and dispatchId in completion messages, and re-resolve terminal handles after reconnects.

That workaround prevents silent misses, but it still requires a coordinator to maintain a long-lived poll loop. A durable push/inbox signal for important lifecycle messages would remove that obligation. PR #9167 appears to improve timestamps, but not this delivery gap.

— @ericjung

e-jung avatar Jul 17 '26 14:07 e-jung

Resolved by the merged delivery work: #9167 made timestamps unambiguous, #12988 surfaced durable Run-mailbox mail through coordinator pointers, and #14332 repaired the remaining stale-waiter, live-idle, PTY-retirement, and restart races without polling. SQLite mail remains authoritative and explicit orchestration check behavior is unchanged.

brennanb2025 avatar Aug 13 '26 20:08 brennanb2025