Skip to content

fix(orchestration): safely wake opted-in Codex coordinators - #27924

Draft
toantranol wants to merge 9 commits into
stablyai:mainfrom
toantranol:fix/coordinator-event-delivery
Draft

toantranol wants to merge 9 commits into
stablyai:mainfrom
toantranol:fix/coordinator-event-delivery

Conversation

@toantranol

@toantranol toantranol commented Oct 12, 2026 •

Copy link
Copy Markdown

ELI5

An idle Codex coordinator can receive a worker report as terminal input without starting a new turn. This draft adds an explicit coordination mode that submits through Orca's existing prompt path and records delivery only after a new turn is observed. Routine progress stays available to read without waking the coordinator.

Early review draft: head b428803a409bf25b9e0da5052854d55d27420409. Independent Standards and Spec review clears source behavior at this exact tip. The coordinating reviewer independently verified and accepted this hardened source checkpoint after checking the committed tip, published draft, check ledger and reviewer receipt. End-to-end timer/restart and the release validation below remain pending. This is not an installed-runtime fix or a merge-ready claim.

What Changed

  • Opt in with orchestration run-create --notification-policy coordination. Existing Runs keep their notification behavior. Worker completion, escalation, questions, declared material status and rejected lifecycle reports request attention; ordinary heartbeat/status stay readable and quiet.
  • Reuse mailbox reservations and the existing bracketed-paste/render/turn verifier. Send one Enter, recheck the current owner, generation, process, unread/waiter ownership and permission before effects, and queue busy work. Accepted input alone leaves delivery unconfirmed; ambiguous input stays reserved across later idle/restart rather than being pasted again. Refused Enter preserves an accepted paste.
  • Add request-pass through existing durable send, naming the current owner/generation/process. It requests one bounded reconciliation pass without run-use, takeover, worker launch or a runtime timer. Callers keep responsibility for cadence, scope, pause and expiry.
  • Advertise the optional feature capability and explicitly check it before new calls. Default/all policy remains compatible. Reject invalid policy choices locally before contacting a host.
  • Keep the supported-owner requirement when run-use rebinds a coordination Run. Refuse unsupported owners before changing either Run, while generic binding remains compatible. Preserve explicit unsupported/unverifiable delivery errors across RPC.
  • Verify the current foreground receiver through the existing process probe before binding and every prompt effect; a launch hint alone cannot authorize input. Unknown receiver evidence fails explicitly. Require a matching Codex turn receipt to settle this Codex-only contract.
  • Release a proven refused first paste through the existing phase/process reservation check even after its flight retires. Reoffer to the current owner if its idle edge already passed; unknown or accepted writes stay reserved, and current persistent refusals do not loop.
  • Extend the existing real-Codex fixture to Windows and add focused selection, ownership, refusal, replay/restart, permission and real-transport compatibility tests. Document the supported calls in the runtime-owned guide.

Current support is an addressable Codex PTY owner with settled-write support. Structured owners and other providers are explicitly unsupported by this opt-in contract.

Why

The completion-title recovery from PR19243 is already in the base and is preserved. Windows trials still reached pointer text plus one Enter without an observed notification turn. Two readiness-only candidates failed. Reusing the existing prompt delivery and turn correlation gives an honest delivery result without another wake subsystem or automatic repeated Enter. Quiet filtering is scoped to an explicit contract so generic message delivery keeps its compatibility.

Linked Issue

Existing requests addressed in part by this draft:

Related Windows submission evidence: #11343. Its large-dispatch mechanism is not claimed identical to this smaller mailbox failure. Outstanding Delivery acknowledgment suppression #21081 is preserved, not bypassed. No broader issue closure or new issue creation is claimed; the linked-issue scope needs maintainer agreement before finalizing this draft.

Visual Proof

Terminal behavior was tested without opening a browser or focusing an app window. Sanitized observations:

  • Before: unchanged source's six Windows real-Codex trials passed four and failed two; failures wrote pointer plus one Enter without a notification model request. The installed1.4.224 idle-wake negative observation remains separate and unchanged.
  • After: final opt-in mailbox sweep passed six of six, three before/three after completion, each one bracketed paste and one Enter, with an observed notification request and durable settlement.
  • A matched raw control also passed, so six successes are not a universal timing guarantee. Earlier failed candidates and startup-only failures remain excluded from wake successes.

Raw terminal captures remain local and are not committed or attached.

Testing

Windows, Node24.21.0, pinned pnpm12.8.1, Codex0.162.1. Scoped temporary Codex homes/hooks, real PTY and a local Responses fixture; no hosted-model generation in the proof.

  • Mailbox/prompt consolidated check: 15 files, 134 tests passed; affected attention/selection checks: 16 passed; completion-recovery/eligibility/consistency: 49 passed.
  • Latest CLI correction: four files, 25 tests passed, including real RuntimeClient over an inert Windows named-pipe peer advertising only the old contract. Unsupported behavior refuses before mutation; invalid policy makes zero peer requests. This models an older peer, not a released old binary.
  • Latest binding/error correction: five files, 55 tests passed. Unsupported rebinding leaves the current owner/generation and caller's prior Run unchanged; Codex coordination and generic structured/other-provider binding remain supported. Public delivery error codes have red/green coverage.
  • Latest actual-entry and refusal hardening: five initial regressions and a later 30-second idle-owner recovery case failed before corrections; four affected files now pass 36 tests. Current-code Windows real mailbox sweep passes 6/6 in116.88s, with the same one-paste/Enter and durable-settlement assertions. A broader changed-fixture command had 18 passing files and one premature test expectation; that expectation was fixed and its affected suite rerun green, rather than labeling the failed command all green.
  • Node and CLI typechecks passed; latest runtime delta rechecked Node. Formatting, changed-code quality across 47 TypeScript files, generated-guide verification and whitespace checks passed. Full repository/packaging CI has not been claimed run.
  • Latest Node-only host build passes (5852 modules, zero Electron/node:sqlite imports, Node24.21.0), and the compiled CLI boundary verifies without installation. These builds were not launched. Earlier built host and CLI reached explicit paired repository/worktree resolution and a terminal command round trip before later corrections. Smoke exited1 on EPERM cleanup; functional assertions are not a passing full smoke. Exact test residuals are retained, and a cleanup attempt was rejected by safety policy. No installed app/daemon was changed.

Remaining validation: real integrated event/timer overlap and restart through the built host/CLI; installed-runtime activation; SSH/macOS/Linux execution; CI. Current busy/overlap/restart guarantees have focused automated seam coverage rather than that full integration proof.

AI Disclosure

Writer: GPT-6.1 Sol medium. Independent read-only reviewer: GPT-6 Luna max. Four rounds cleared Standards and identified capability negotiation, invalid-policy, unsupported rebinding, current receiver proof and retired-refusal gaps; all have regression-first corrections. The fifth exact-tip review clears both Standards and source Spec, with no material findings. No Claude review/diagnosis or recursive implementation delegation.

Review

Source checkpoint accepted after independent verification at b428803a409bf25b9e0da5052854d55d27420409; this acceptance covers source behavior only and does not waive integrated-host, installed-runtime, platform, CI or release gates.

One current owner, no blind repeated Enter, permission prompts fail closed, and contact loss is not treated as process death. Existing acknowledgment/waiter fences remain binding. Both earlier review terminals are retained under ownership protection. Merge, installation/restart, production schedule and cleanup decisions remain unapproved.

Agent skill upstream boundary

  • No external skill-installer source copied. The existing runtime-owned guide and generated bundle describe the new contract.

Checklist

  • User-facing before/after, mechanism and reason for the approach are described.
  • Focused automated tests and actual Windows behavior checks are reported with their limits.
  • Cross-platform, remote execution and older-peer boundaries considered; untested modes remain explicit.
  • Independent Standards/Spec clearance for source behavior at the stated exact tip.
  • Integrated timer/restart proof and required CI.
  • Maintainer agreement on linked-issue scope before finalizing.

Browser-free launch follow-up — current source checkpoint

The earlier accepted b428803 checkpoint and all its evidence and limitations above are retained. The current draft head is 7449ade38a354615b092aaeb19175d13dcd735f1, independently reviewed and accepted by the coordinator as a source-local successor for the next isolated proof. This remains a draft, not a merge-ready or installed-runtime claim.

Before, orcad could discover and start installed Electron without a browser request, preventing a browser-free coordinator proof. orcad --no-browser and orca serve --no-browser now skip browser discovery and startup through the existing host lifecycle. Default behavior is unchanged; browser commands remain unavailable when opted out. Malformed values and Electron-only selections reject, including the direct Electron serve form.

Browser-free supervision validates host selection before changing force/brake state and before each attempt, outside retry handling; the attempt uses that same validated selection. Unsupported selection cannot become a persisted retry failure. Supported orcad supervision and ordinary service behavior remain. An explicit launch option avoids environment tricks, hiding installed binaries, or redesigning terminal daemon lifetime.

Follow-up evidence

  • Regression-first unknown-flag, unsafe fallback, ignored-value, direct Electron and combined-supervision cases failed before correction. The final focused run passed 123 tests across 13 files, with 2 existing skips. Supported orcad supervision and a later Electron selection are covered.
  • Fresh Node and CLI typechecks, formatting/whitespace and changed-code quality across 16 files pass; all seven quality scans report zero findings. Host and CLI rebuilds pass without installation: build 0.1.0+cb84d72ff874, 5852 modules, zero Electron/node:sqlite imports, pinned Node 24.21.0. Both built public help paths expose the option.
  • Sole independent GPT-6 Luna Max review clears Standards and source Spec at exact 7449ade38a; diagnostic assertion suggestion S-STD-01 and supervised-validation finding SPEC-13-01 are resolved. Reviewers were read-only leaves and are fully accounted for. This follow-up did not rerun or relabel the earlier six real-Codex mailbox trials as integrated latest-host proof.
  • N/A visual proof: launch arguments, help and host lifecycle behavior; no renderer/UI change. The option is a reversible opt-in; it adds no dependency, daemon redesign or wire change.

Preserved remaining gates

Managed-stop retirement is existing support, not executed cleanup: a retired acknowledgment still needs independent host/daemon/child exit proof. The next ticket11 live proof remains behind coordinator review of exact resources, absolute expiry and cleanup ownership. Busy or unknown daemons remain live/unverifiable.

No live host, browser/Electron application, daemon or timer was launched for this follow-up; no installed app/daemon replacement or restart, merge, default smoke, prior rejected cleanup or protected/user-owned resource mutation. The earlier negative capability evidence, EPERM/cleanup residuals, protected reviewers and all prior limitations remain unchanged.

Integrated event/timer/overlap/restart, installed-runtime activation, SSH/macOS/Linux execution, hosted CI/packaging and maintainer agreement on linked issues remain unproven or separately gated. Source acceptance does not close those gaps or complete the wider workstream.

This branch has not been deployed

No deployments
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.

1 participant