Repository navigation
fix(orchestration): settled workers stop reading resting slash lists - #34342
Conversation
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Notify journal observers from the restate… · structured-agent-session-client-delivery.ts:186-192
src/main/native-chat/agent-session-wire/structured-agent-session-client-delivery.ts:186-192
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winNotify journal observers from the restate branch.
An unexpected child exit can publish the ordinary wake before settlement releases the worker. Release can then change the runtime fence without a nonempty journal commit. The later
{ restate: true }branch snapshots the new fence and returns without notifying journal observers. Parked mail can remain unrevaluated until another publication.Notify the observers once from the restate branch. Keep the ordinary
publishJournal(...)notification unchanged.Suggested fix
if (options.restate) { const fence = structuredAgentSessionConversationFence(this.deps().store, sessionId) this.subscribers.snapshot(sessionId, journal, fence) + this.notifyJournalObservers(sessionId) return } @@ - for (const observer of this.journalObservers.get(sessionId) ?? []) { + this.notifyJournalObservers(sessionId) + } + + private notifyJournalObservers(sessionId: string): void { + for (const observer of this.journalObservers.get(sessionId) ?? []) { try { observer() } catch (error) { this.deps().logger.warn('observing a journal publication failed', { scope: 'journal-delivery', @@ }) } } }

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
23302493-c84b-4088-bfe3-d7536e3bd67d
Files selected for processing: 1-
src/main/runtime/rpc/methods/orchestration-structured-worker-redrive.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
|
Settled orchestration workers were keeping invisible chat streams alive, causing resting command discovery for chats nobody was viewing. Workers now observe journal publications directly, so parked mail still retries while those workers create no command-list demand. Visible desktop and phone menus keep their existing behavior. Catalog/process bounds are separate work. Full-path review completed with three validation passes; the fresh decider ruled KEEP on this head. Correctness, architecture, consumer, reference and readiness checks found no PR-caused production regression. The fixes removed a prohibited test assertion and added the missing CLI, moved-path and scale evidence; production code stayed unchanged during the loop. Verified: real CLI send through actual socket/RPC/runtime and production worker-topology wiring to fixture-provider pointer delivery and durable receipts. The former stream and new observer both retain mail after a throwing send, deliver after a later journal publication, and cancel pending retries on release. Thirteen redrive tests pass after the final test-loading correction ( The conflict-free main merge For Brennan’s review: observer and disposal, worker binding, CLI outcome comparison and scale contract. #28567 overlaps |
Problem
On Windows, users running many orchestration workers saw Orca keep about 100 hidden
codex app-serverprocesses alive and start more than one per second, pinning the CPU at 100% for hours (tracked in #34141). Releasing the settled workers made it stop.Each structured worker kept a full chat-stream subscription solely to retry parked mail when its chat changed. Building those frames and refreshing resting slash lists read the
/command list for unreleased workers, which could start background Codex discovery even when no composer displayed the list.Scope: native chat orchestration workers only
This only affects orchestration workers that run as native chat (structured) sessions. Terminal orchestration workers never held this subscription or a resting command list, so they never caused the storm and are untouched here.
Each structured worker kept a hidden subscription so orchestration could re-deliver parked mail when the worker's chat changed. That subscription used the same path a visible chat tab uses, so every settled-but-unreleased worker counted as a resting chat someone was looking at and kept asking for its
/and$command list. Any agent's worker could create that demand, but only Codex turns it into processes: each Codex check started an app-server that stays up about 70 seconds for plugin sync, while Claude checks exit as soon as they answer and were already capped at two at a time.After this PR, the worker's subscription listens only for new chat-log entries and never asks for a command list. Chat tabs on desktop and phone are unchanged.
Change
Worker redrive now observes the host's existing journal publications directly. Commits, tombstones, epoch changes, reattach snapshots and row-free work changes still wake the existing coalescer. Release, stop and abandon cancel pending wakes and remove the observer. Display-only catalog/roster/activity frames no longer create worker retry demand. Visible desktop and phone command-list behavior is unchanged.
This PR removes internal-worker discovery demand. Catalog scheduling and the shared probe process bound ship separately. It overlaps #28567 in
subscribeForRedrive; only its subscription-call block changes here.Validation
Full review path: orchestration runtime. QA classification: CLI/orchestration/performance tests row.
orchestration send, actual socket/RPC/runtime, production worker-topology callback and real journal publications reach fixture-provider pointer delivery and durable mail receipts. The same inputs pass with the former stream carrier and the new observer: held mail, a throwing send that retains unread/undelivered mail, later successful delivery, and teardown cancellation.The CLI integration uses a fixture provider and exercises CLI send through this changed flow; it does not claim a real-agent or app run. CI supplies static analysis, typechecking and affected tests on the final head.