Skip to content

Shared Codex servers survive an Orca restart and update - #51093

Merged
brennanb2025 merged 70 commits into
mainfrom
brennanb2025/shared-codex-servers-survive-restart
Nov 30, 2026
Merged

brennanb2025 merged 70 commits into
mainfrom
brennanb2025/shared-codex-servers-survive-restart

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

With shared Codex servers turned on, quitting or updating Orca used to stop every chat's work: replies Codex was still writing, commands it was running and questions waiting for your answer were all cut off. Now, on macOS and Linux, that work keeps going while Orca is closed, and each chat picks up where it was when you open it again, reading its history back from Codex. Text Codex wrote while Orca was closed appears once that reply or command finishes. On Windows nothing changes yet. Chats run by bots are the exception: their work still stops when Orca quits, for now.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24
Prod 61 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2380 $\color{#cf222e}{\Huge{\mathbf{−}}}$​410 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1970

What Changed

  • A shared Codex server now runs under the terminal daemon as one relay (agent kind codex-shared), on macOS and Linux. Windows and an older daemon stay as today. A new custom command takes effect once a chat's kept pooled run has ended.
  • Each pooled chat's run placement names the server's relay, its start time, and its lease's workload id. A reopened chat keeps that id, so Stop after a restart ends commands started before it.
  • Codex is the source of truth: Orca keeps no copy of a shared server's output. A chat that reopens onto its kept server resumes its thread from Codex (history plus the running turn so far), and events that arrive meanwhile are applied after it. Lines the daemon replays at attach are dropped when resume rebuilds them.
  • Requests (approvals, input) for a thread no open chat holds are never refused: they wait for the chat that claims the thread, go back to waiting if that chat leaves without answering, and are answered at most once. Account requests with no chat open are answered after Codex's own deadline.
  • At quit, a keepable lease detaches without interrupting anything. Other leases close as today. A server with a detached lease, or reattached from the last run, is handed off; others stop.
  • When no chat in Orca has used a kept server for 60 seconds, Orca asks Codex what is still open on it (each loaded thread's status and background terminals) and hands the server back to the terminal daemon with that open work. The daemon stops it a minute after that work ends; unread lines a reopen rebuilds from Codex don't hold it, but others (a plan update, an error) keep it for the next open. Acks are held from the first read on, so the daemon counts anything that starts or ends meanwhile. If Codex can't say, the daemon keeps it until the detached limit.
  • Chats are routed by where their last run lives, so a kept run is never given a second writer when the setting changes. One chat owns each thread at a time; a chat that is closing takes no new threads. A chat whose close proved its part ended reads as gone, so its next run follows the setting.
  • A failed reattach refuses to start rather than spawn a second server beside a live one.
  • With sharing on, a chat whose tools go through the terminal daemon's tool relay (a bot's tools, or a host tool with a saved credential) runs on its own daemon-held app-server, as with sharing off, so its run and tools survive a restart. Other chats share.

Why

Shared servers were spawned directly by the app, so they ended with it.

Linked Issue

N/A (maintainer).

Visual Proof

N/A: no UI change. Verified by quit/relaunch QA on Linux (see Testing).

Testing

  • Invariant test for the saved run placement.
  • QA on Linux with shared servers on: a running turn, a running command, a pending approval, subagents, a chat not reopened, and a crash, across quit and relaunch.

Performance

At a hand-off, one loaded-thread listing and two reads per loaded thread, at most 4 at once. Requests waiting for a chat are bounded by the daemon's cap; settled request ids are kept as ranges. Per frame, nothing is added beyond today's routing.

Risk

Level: High. This touches routing, quit and reopen for shared servers. Known limits:

  • Output streamed while Orca was closed or a chat wasn't open (a message's text so far, a running command's output) shows when the item completes. After an app crash, a running turn is rebuilt from Codex at reopen.
  • Codex truncates saved command and tool output (64 KiB per result in paginated history), and older-format threads lose finished command items while Orca isn't attached.
  • If 256 requests go unanswered on one server, the daemon pauses that server's output until one is answered.
  • An account token refresh with no chat open fails after Codex's own deadline, as today.
  • Deleting a chat doesn't stop work its run left on a shared server; that work runs until it finishes or the server stops (follow-up STA-19416).
  • Subagents are restored from Codex only in part. For a subagent whose work ended while Orca was closed, these can still show incomplete after reopen, though the work itself runs on and Codex keeps it: a command from an earlier subagent turn may lack its final output; a command that finished inside a subagent turn still running may lack its final output; a subagent named only in an older saved turn may stay on Working; and a nested subagent whose details can't be read is filed under the chat, so Stopping its own parent misses it. The chat's own thread is complete. A follow-up rebuilds each subagent from Codex the way the chat itself is rebuilt.
  • A subagent's background command from an earlier turn that ends while Orca is closed can keep reading running after reopen, until the chat is closed; Codex has its output. The same follow-up fixes it.
  • If a subagent finishes one turn while Orca is closed and starts its next turn within the few seconds of reopening, the newer turn's card can keep reading Running; closing and reopening the chat, or Stop on its parent, clears it. The same follow-up fixes it.
  • A command that's stopped after a restart, not run to its end, keeps the gap from while Orca was closed; Codex still has that output. The same follow-up fills it.
  • A command that ends while its chat is reopening may show a leftover running row next to its completed one until the chat is reopened again; the completed row has the full output. The same follow-up fixes it.
  • A restored chat's close stays unproven, with its threads routed and the server up, while Codex can't list its loaded threads. It retries, backing off to every 5 minutes (STA-19494).
  • A chat whose close confirmed its work ended can still run on its old shared server for about two minutes after that server goes back to the terminal daemon, even with shared servers turned off since. It's the same server, so nothing runs twice.
  • Quitting Orca while it hands an idle shared server back, or while it is still reconnecting to one from the last run, can leave that server running until the daemon's 24-hour limit; the next open reattaches it. A follow-up makes that quit wait for the reconnect, so the server stops once its work ends.
  • After an idle shared server stops, a chat with older-format history can show its previous context-usage reading until its next turn.
  • A terminal daemon from a build without this change keeps an idle shared server that was handed back until its 24-hour limit.
  • A chat on a shared server held by a newer Orca's terminal daemon is refused with the general "couldn't reach" message rather than "update Orca"; nothing runs twice. A follow-up gives it the update message.
  • A bot chat whose run on a shared server ended, opened once after shared servers were turned off, gets tools tied to Orca for that one run, so that run doesn't survive a restart; its next run does.
  • A chat kept on a shared server that gains a host tool with a saved credential keeps its run there across restarts. Once that run ends, the chat moves to its own server for the new tool. Its first send after the move can be refused with "Codex is still holding this conversation open" for a minute or two, while the old server lets the conversation go. The message stays queued with Retry, and sending again then works. A new chat with that tool gets its own server from the start. Follow-up: STA-19996.
  • Downgrading to a build without this ends kept shared servers, and their chats recover as today.

Back out with a plain revert.

Agent skill upstream boundary

  • Not applicable.

…chat cutoff; bounded unresolved roots and retries
…floor and drops stay off the chat count; cleanup inside the read limit; partial-listing expiry cuts
…use an unconfirmed interrupt; kept-chat loss markers survive eviction; drops visit each group once; listing stops on a repeated cursor
… history; an overflowing restored backlog is let go with a cut
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan: shared Codex servers survive restart (#51093)

Head d26542a000b01dcdb42e4a905a0567451d7060a2, diff 13defff6454...d26542a000b (46 files). Static scan only: no runtime numbers were taken, so impact is stated as counts and triggers.

Verdict: NOT READY. One P1 retention finding.

Finding

P1: a reattached shared server whose chats don't all reopen is never idle-stopped, for the rest of the app session and (at quit) for up to 24 h in the daemon

  • Where: src/main/codex/app-server/shared-servers/codex-shared-server-pool.ts:195 (|| !server.recovery.empty returns before the 60 s idle timer is armed). Also codex-shared-server-keep.ts:185 (quitOpen === undefined ? null : …).
  • Trigger: a kept shared server gets attached by the first reopen of any of its chats (CodexKeptServers.serverFor) or by a delete (stopRun, codex-shared-server-kept-servers.ts:125). At that point codexExpectedChats puts every chat whose record still names that relay into recovery.
  • Why it never settles: a group leaves recovery only when its chat claims it (reopen), when the chat is deleted (stopExpected), or when its record moves to another run (dropped). Unresolved roots leave only through retryUnresolved, which runs on chat opens and has no timer. A chat that is simply never reopened keeps its group forever. While recovery is non-empty, onServerFreed returns early, so the 60 s IDLE_SERVER_STOP_MS timer is never set, not even for a draining server (old Codex key, or one attached only to delete a chat). Because the app is attached, the daemon's own idle stop and its 24 h detached cap are also disarmed (ProviderRelayDetachedCap.forget on attach). At quit, if no lease was handed off (attached for a delete, or a restored open that handed back), settleQuit detaches with open = null. The daemon reads that as "work unknown, never idle-stopped" (provider-relay-idle-stop.ts:109), so only the 24 h cap ends it.
  • What it holds: per kept server, one Codex app-server process with its loaded threads, up to 32 MiB of held frames in Electron main (recovery room), and a pinned ack floor at the first held request's seq (requests are never dropped). That floor makes the daemon keep lines up to its 1 MiB memory cap and then its 16 MiB spool-file cap.
  • Fleet price: with 100+ agents spread over a few pool keys, almost every kept server has some chats the user doesn't reopen. The idle stop is pre-PR behaviour, and it's now off for every kept server that gets reattached in a session. Each Codex update adds a new pool key, and the old-key servers become draining. Those are meant to stop once their last chat leaves, but they also stay pinned whenever one of their chats is reopened or deleted. So the count of retained processes grows with Codex updates × sessions in which they get touched. It's bounded only by the user eventually reopening or deleting every chat on each server. This is a retained process with no settle owner (Q6), which grows with process lifetime, so it's P1.
  • Check that proves it: use the real CodexSharedServerPool with an injected connect. Reattach a server with expected = 2 chats, open and close one, then advance fake timers 10 min. Today that gives server.stop calls = 0 (and 0 for a draining server as well). The fix should give 1 after IDLE_SERVER_STOP_MS when the held threads have no running turn, while a held thread that has a running turn still keeps it.
  • Possible fix (unverified): when leases.size === 0, judge idleness from server.turns and the relay's carried open work for the held threads. Then arm the idle stop, or hand the server back to the daemon with the carried open work so its idle stop and cap apply again. At quit, pass the carried/open work rather than null when no lease was handed off. Both must keep the "no second writer" and held-frame guarantees.

Coverage by trigger

Trigger Work per event × population Bound / disposition
Per daemon frame (router.route / onUnhandledFrame) recordSeq() O(1). Stamps seq/threadId. For an unclaimed thread on a reattached server, recovery.hold does one JSON.stringify(params), the same per-frame sizing CodexSharedLeaseQueue.push already does. discover → recovery.join is O(1) when the thread is already in the group. lease.deliver → keep.dispatched adds to 2 Sets. backlog → queueChanged is O(1). Constant per frame. Overflow eviction (boundBytes) frees ≥ max(room/8, 256 KiB) per crossing, so the largest scan (≤ groups) and the dropOldest walk (∝ room) work out to a constant per held byte. Identities are capped at 4,096 (perf test at 20k descendants). Bytes are capped at 32 MiB (perf test). Disproved.
Per ack (ackNow → sharedAckFloor.floor) unrouted.floor() scans buckets (≤ 2,000 frames, find usually hits the first). recovery.floor() is a heap peek with amortized pops and compaction at 2×live+64. keep.floor reads firstSeq only for leases in queued (pending > 0). Bounded by the unrouted cap and the chats with queued frames. The perf test reads 0 floors over 1,000 idle chats. Acks are debounced per output, with no idle ack. Disproved.
Per durability barrier (keep.durable) One flushStreamedEvents per chat in unsaved/unforced (chats handed frames since the last barrier), plus any pending quit saves. ≤ chats active since the last ack. Same as or fewer than N per-chat relays. Perf test: 1 barrier per ack with 1 streaming chat of 100/1,000. Combined output reaches the daemon's 1 MiB/16 MiB ask thresholds K× sooner with K busy chats, but each crossing forces one flush of the active chats only. At 20 chats × 5 KB/s that is one forced flush every ~160 s. Disproved.
Per chat open / reopen codexPooledRunOf (record get, O(1)). serverFor: one run gate (daemon ask) only when the server isn't attached. void retryUnresolved(), one in flight per server, dueUnresolved O(unresolved ≤ 4,096), each root read at most once per 10 s, 4 reads at a time. placeRun O(1). Opener: ownRunMayBeKept gate only when the last run was the chat's own relay (once at the switch). narrowed() open/ended work is O(carried keys) at open. Constant or one-time per open, same as per-chat relays. Disproved.
Per reattach (startCodexSharedServer → recoverCodexSharedServerThreads) One records.list() scan (codexExpectedChats, tens of thousands of records, cheap currentPlacement each, sync on main, once per server). thread/loaded/list ≤ 64 pages. One readSource per loaded, non-held thread plus ancestors (≤ 9 rounds), through the server's 4-permit semaphore. ancestry walk per thread. Once per kept server per app session (byRelay dedupes reopen and delete). Evidence gap, not graded: first-reopen latency grows with loaded subagent threads (≤ 4,096 reads ÷ 4 at Codex RPC latency, plus ancestor rounds), and output for every chat on that server is held until it finishes. Needs a timing at ~500 loaded threads. It's async (not a main stall beyond JSON parse) and needed so frames reach the right chat.
Per deletion (stopChat → stopSharedProviderRelayRuns) Non-pooled record: O(1). Pooled, server not attached: one fresh daemon liveness ask, then (if kept) a full reattach (row above) behind DELETE_ATTACH_TIMEOUT_MS 60 s. Then stopExpected: thread/turns/list + interrupt per held thread, workload stop, unsubscribe, all through the 4 permits. dropped(chatKey, null) → releaseExpected on each attached kept server (≤ servers). Per deleted chat, in proportion to its own threads. A bulk delete of K chats on one server reattaches once, but K pooled chats whose runs are gone do K serial fresh asks (one local daemon RPC each, needed to rule out a live writer). A delete-only attach then pins the server: see the finding.
Timers No new setInterval/setTimeout in the diff except withTimeout on delete (one per delete) and the existing setImmediate in ackNow. Unrouted TTL timer is unchanged (armed only while it holds frames). Idle wakeups on main: 0 → 0 (source). Daemon: relay code unchanged. Shared servers now ride it (one relay per server instead of none), with no periodic work while attached (not measured). The missing stop timer is the finding.
Teardown kept.forget O(servers). keep.forget clears unsaved/unforced/queued on lease leave. handBack deletes quitSaves. Pooled-chat registry unregisters on release, hand-back and detach. sharedAttachedHere clears on exit and hand-off. stopping clears in finally. Registries return to baseline per lease and server. The exception is recovery, which by design outlives leases (the finding).

Regression classes touched

  • Per-entity state outlives the entity: finding (recovery groups for chats that never reopen pin the server process, so the class bound doesn't hold). Lease-keyed sets were checked and cleared.
  • Hidden/unobserved owners keep working: finding (a server kept with no lease and no idle stop).
  • Fixed-cadence poll: none. Unresolved retries are driven by opens and gated at once per 10 s per root.
  • New idle wakeups: none in main by source.
  • Hot-path rescans: checked. unrouted.floor per ack (≤ 2,000). merge sorts concatenated frames, at most once per unresolved root per lifetime (≤ 4,096) and bounded by 32 MiB; TimSort merges the two sorted runs in linear time. dropOldest amortized as above. Disproved.
  • Unbounded fan-out: durable Promise.all is ≤ chats on the server. Reattach, retry and cleanup reads share a 4-permit semaphore. Disproved.
  • Sync fs/SQLite on main: none added. records.list() scan is once per reattach.
  • Eager startup imports: codex-shared-server-relay.ts registers at import, with no new SDK. The pnpm-lock change is the @pnpm/exe package manager only, not runtime.

Six questions

  1. Unused work before the gate: reviewed. Sizing stringify only for frames that are actually held. Floor reads gated by queued.
  2. Ownership multiplication: reviewed. One reattach per server (byRelay), one retry in flight per server, one pool.
  3. Thread/storage: reviewed. Everything is on Electron main and async, except the one-time records.list() scan and the per-held-frame stringify. Journal flushes per ack are the same as per-chat relays.
  4. Growth/progress: reviewed. Identities, bytes and the unrouted cap are bounded. Listing stops on a repeated cursor, at 64 pages or at 4,096 ids.
  5. Execution host: Windows doesn't relay (relaying excludes win32). SSH/remote not affected (local daemon only). Linux/mac paths are the same. Not run.
  6. Obsolete work stops: finding. A kept server with no leases and with held threads that are idle or unclaimed is never stopped in-app, and after quit only the 24 h cap stops it.

Residual (not inspected at runtime): first-reopen reattach latency at fleet thread counts. Daemon-side wakeups for an attached shared relay.

…ng; a delete whose commands aren't proven gone drains the server
… a shed during reopen keeps its requests; quit keeps a server any chat was handed off on; bots share the app server where nothing is kept; drop stray lockfile churn
…emon with every chat's open work, keeping recovery's owners and cuts for its next attach (rev 8)
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: shared Codex servers survive restart (#51093), head 7202469

Head 72024695f72733be81ba8aa5d3356a57c0d37b69. This scan covers the diff since the last one, d26542a000b..72024695f72 (22 files). Static scan only: no runtime numbers.

Verdict: NOT READY. The earlier P1 is closed. The fix adds a new P1 on the per-line path.

Earlier P1 (a kept server that never idle-stops): closed

  • codex-shared-server-pool.ts:195-215: onServerFreed no longer returns early on !recovery.empty. A server with no lease arms the 60 s timer. If recovery holds threads and the server is relayed, the timer hands it back (handBack → CodexKeptServers.handBack → keep.handToDaemon → detachProviderRelayToDaemon). Otherwise it stops. A draining server with held threads takes the same path.
  • A server attached only for a delete is covered: stopExpected calls server.ended(), which arms the timer. A reattach without a lease is covered: retryUnresolved calls ended().
  • The hand-back carries work.snapshot(turns). That is the server-wide open set, read when the child stops reading, so the daemon's idle stop is armed. Quit (keep.ts:200-206) passes the same set merged with quitOpen instead of null.
  • The snapshot is null only while a turn start is unresolved, or after the open set passes 1,024 tasks in one group (unaccounted). Then the daemon's 24 h detached cap applies. Both are narrow and bounded.
  • What the app keeps after a hand-back: CodexKeptServers.handedBack, one entry per relay. It holds identities and cuts only, with no frames: ≤ 4,096 × ~200 B ≈ 0.8 MiB per server. It is cleared on the next attach's ready, or on a gone verdict. Bounded by the number of handed-back servers.

New finding

P1: every completed command on a shared server is JSON-parsed a second time, in full, on Electron main

  • Where: src/main/codex/app-server/shared-servers/codex-shared-server-open-work.ts:26-29 (observe → ProviderRelayWorkReader.read). Fed from codex-shared-server-relay.ts:52 and codex-shared-server-keep.ts:76.
  • Trigger: every line a relayed shared server's relay hands on (relayed-provider-output.ts:299/305 → ack floor observe). It runs always, not only while carried work exists.
  • Work per line: mayMatch does a container-stopping envelope scan (cheap). For lines whose name and values may match, it then runs JSON.parse(line) (provider-relay-work-markers.ts:159). The command marker item/completed with "commandExecution" (codex-app-server-relay.ts:58-63) matches every finished command, and that line carries the command's whole aggregated output. The app connection already parsed the same line to dispatch it, so this is a second full parse. The Codex ack floor next to it (codex-relay-ack-floor.ts:40-47, 77-87) avoids exactly this parse on purpose: it matches completions by substring because "its text is never parsed… (possibly huge)". Small item/started, turn/* and thread/closed lines are parsed too, but they're cheap.
  • Fleet price: at the reference fleet (100+ agents), commands finish at roughly 0.1–0.5/s per agent, so 10–50 completions/s across shared servers. Each one doubles the parse of its line on Electron main: ~0.1 ms per 100 KB of output, ≥ 5–10 ms per line for MB-size outputs (unmeasured, my rough estimate). The cost grows with command output bytes × command rate, and the parse it repeats was already done.
  • User impact: extra main-thread time per finished command. Large outputs cause single main-thread stalls that grow with the output size.
  • Check that proves it: feed CodexSharedServerOpenWork.observe K item/completed commandExecution lines with a 1 MiB aggregatedOutput, using a spy on JSON.parse (or a byte counter). Today parses = K and parsed bytes ≈ K MiB. The fix should give 0 full parses of completion lines, with start/end bookkeeping unchanged.
  • Possible fix (unverified): don't re-read raw lines. Feed the open set from the notifications the server already parsed (startCodexSharedServer's onNotification(method, params), next to server.turns.observe), applying the same marker definitions to the parsed value. Or match item/completed ends to open command ids by substring, as createCodexRelayAckFloor does, and parse only item/started. Either way the hand-back must still see every line up to the detach.

Changed triggers

Trigger Work × population Bound / disposition
Per line (new acks.observe → open work) Envelope scan (stopAtContainer, ≤ 32 fields, ≤ 4,096 chars) on every line. Full JSON.parse of marker lines. End markers filter open tasks (≤ 1,024 per group). Scan: constant per line, same as the ack floor's. Second full parse of command completions: finding.
Idle hand-back (60 s one-shot per lease-less server) One detach. recovery.kept() O(groups + identities ≤ 4,096). Snapshot O(open tasks + running turns). Once per idle period. The timer doesn't recur, so no new steady idle wakeup (0 → 0 per process at idle). Disproved.
Quit One snapshot merge per server (dedupe stringifies keys ≤ 1,024 per group). Once per server per quit. Disproved.
Reattach seeding work.seed(carried) merge plus restoreCodexSharedRecovery O(groups + threads), once per attach. Seeded held threads are skipped by discovery reads. Once per attach, and it cuts discovery reads. Disproved.
Reattach churn Each reopen of a chat on a handed-back server reattaches it: one records.list() scan, one loaded listing (≤ 64 pages), reads of loaded threads that aren't held. Then a 60 s idle period hands it back. One cycle per reopen after ≥ 60 s with no chat open. Same as a per-chat relay's reattach on reopen. Bounded by user opens. Disproved.
Restored chat close (seedRecoveredTurns) One thread/turns/list per chat thread with no known turn, through the server's 4 shared permits. Per close, bounded by that chat's threads. Disproved.

Classes touched

  • Streaming re-processes the whole message / re-reading parsed input: finding (above).
  • New idle wakeups: none (one-shot idle timer, already present before).
  • Per-entity state outlives the entity: handedBack and handing are cleared on attach, on a gone verdict and in finally. Bounded.
  • Hidden owners keep working: earlier finding closed.

Six questions:

  • Q1 (unused work): finding. The parse repeats work the connection already did.
  • Q2 (ownership): one open-work reader per server.
  • Q3 (thread): Electron main.
  • Q4 (growth): open/ended tasks are capped at 1,024 per group.
  • Q5 (host): the macOS/Linux relay path. Windows doesn't relay.
  • Q6 (stopping): reviewed, and the earlier finding is closed.

Residual: I didn't measure reattach latency at fleet thread counts or real Codex command-output sizes.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: head b74d9f8

Head b74d9f8e3a27fb7acf70d42428af659efebf91a5, diff 72024695f72..b74d9f8e3a2 (5 files). Static scan only: no runtime numbers.

Verdict: PASS. Both earlier P1s are closed and this diff adds no new perf finding.

  • Second parse of finished commands: closed. CodexSharedServerOpenWork.observe(method, params) is now called from startCodexSharedServer's onNotification, next to server.turns.observe. It uses ProviderRelayWorkReader.readValue. The relay's ack-floor observe is back to items.observe alone, so raw lines are no longer read for open work and JSON.parse no longer runs a second time. Per notification it does one name compare per marker (9 markers), plus path lookups only when the name matches: O(1). It also runs on servers that aren't relayed (Windows/direct), where it costs the same O(1) per notification.
  • Daemon unchanged. read(line) keeps mayMatch and then a single parse, which now hands off to readValue.
  • Hand-back still sees everything up to the detach. Notifications are dispatched synchronously per line, and the snapshot is still read when the child stops reading.
  • Kept server never idle-stopped (from the first scan): still closed. Nothing in this diff touches the idle hand-back or quit paths.

Nothing new was added: no timers, no per-line work and no retained state.

…uit hands off the server's own open work; open work ends visit only their thread's tasks
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: head b26ea69

Head b26ea6923035eb553fa50a59ef38628eead2b64a, diff b74d9f8e3a2..b26ea692303 (6 files). Static scan only: no runtime numbers.

Verdict: PASS. No perf findings are open.

  • A command's end no longer scans every chat's commands. CodexSharedServerOpenWork now keeps its open set as group → thread → task keys. An end visits only that thread's open tasks, where it used to visit all of the group's tasks (up to 1,024) across every chat. A thread-wide end (thread/closed) visits the same set. A start is O(1). Empty per-thread sets are deleted when they empty. The set still counts as unknown past 1,024 tasks in a group, as the daemon does.
  • Snapshot: O(open tasks + running turns). It runs only on idle hand-back and at quit.
  • Quit: hands off the snapshot alone, or nothing when a chat couldn't say. That's O(1) on top of the snapshot. The idle-stop fix from the first scan is unaffected.
  • Spool cut at attach: one boolean read and cutFromNowOn(), once per attach. Each restored chat then catches up from history once when it opens, which costs the same as a cold reopen and no more than before this PR.
  • Nothing new: no timers, no per-line or per-notification work beyond O(markers), and no new retained state.

Not perf, for whoever reviews correctness: cutEverything is carried in the hand-back's kept state, and restoreCodexSharedRecovery sets it again on every reattach. So once a cut happens, every restored chat on that server catches up from history on every reopen after later hand-back cycles too. That can be correct, but it may be broader than needed.

…for exit proof; a retry that finds an unheld ancestor re-roots the family on it
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: head 4c4974d

Head 4c4974dc1de7bca7d4be14688fcd7d8ef47070a9, diff b26ea692303..4c4974dc1de (7 files). Static scan only: no runtime numbers.

Verdict: PASS. No perf findings are open.

  • Server start time (codex-shared-server-start.ts:60-63): readProcessStartTimeMs runs once per relayed server start (fresh or reattach), before initialize. On macOS that's one ps -o lstart= (in-process runner first) with a timeout. On Linux it's two async /proc reads. It adds about one child process (~5–10 ms) to the first open on each server. It doesn't run per chat, per frame or per ack. This is a one-time cost, not a finding.
  • Placement carries the start time (codex-shared-server-kept-servers.ts:208-214, agent-session-lease-transitions.ts relayedPlacement): one field copy per lease commit. O(1).
  • ownerFound re-roots on an ancestor no group holds (codex-shared-server-router.ts:173-182): holdUnowned(parent) plus a merge. The family's root is swapped, so the group count stays the same, and the 4,096-identity cap still applies.
    • Each retry moves up one ancestor level.
    • Retries still run only on chat opens, at most one read per root per 10 s, through the 4 shared permits.
    • A cycle (A under B, B under A) ends on the next join, because both are already in one group.
    • A held but collapsed parent leaves the child as an unresolved root, as before.
  • Test: codex-shared-server-recovery.test.ts adds one case, which has no runtime effect.

Nothing new: no timers, no per-line or per-notification work, and no new retained state.

…at's kept server can't be tied to a chat; rechecked right before the delete commits
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: head de5c2fd

Head de5c2fd48f93041f1943e0154a40c68e7bedf17c, diff 4c4974dc1de..de5c2fd48f9 (27 files: 7 code files, 20 locale files). Static scan only: no runtime numbers.

Verdict: PASS. No perf findings are open.

  • Helper check before and after a delete's stop (codex-shared-server-kept-servers.ts helpersPlaced):
    • It runs only for a deleted chat whose last run was pooled, and only once the kept server is attached.
    • Each check is an O(1) unresolvedCount read. Only when that count is above 0 does it run the existing retryUnresolved, which is one in flight per server and reads each unresolved root at most once per 10 s, 4 at a time through the server's shared permits.
    • So a delete adds at most 2 joined retries. A bulk delete of K chats on one server still reads each unresolved root at most once per 10 s, not K times.
    • Non-pooled records still return at once.
  • Refusal plumbing: the boolean became a 3-value result (stopped, unreachable, helpers), combined over the shared agents with includes. O(1).
  • No retry loop: neither the renderer (src/renderer/src/lib/agent-session/chat-deletion/orca-chat-delete.ts) nor mobile (MobileBotChatDelete.tsx) retries automatically. The new helpers text asks the user to try again.
  • Locale strings: data only.

Nothing new: no timers, no per-line or per-frame work, and no new retained state.

…lete waits until its commands are proven gone; a chat with no part left on an attached server reads as gone; a released helper stays held until interrupted
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: head 2a1ea9c

Head 2a1ea9ccfafdb777780c314d8466001e8a9d3642, diff de5c2fd48f9..2a1ea9ccfaf (9 files). Static scan only: no runtime numbers.

Verdict: PASS. No perf findings are open.

  • Hand-off turn reads (codexSharedHandOffWork → seedRunningCodexTurns):
    • Runs only on a reattached server, once per hand-off: one idle hand-back per idle period, or one quit per server.
    • Each run does one thread/turns/list per held or leased thread with no known running turn. That is ≤ 4,096 held identities plus the leased threads, 4 at a time through the server's shared permits. recovery.kept() is built once to list them, O(identities).
    • It doesn't run per frame or per ack. At quit it still sits under the existing 5 s QUIT_DETACH_WAIT_MS deadline. A server with thousands of held threads can use that whole window; then the detach goes without a policy, so only the 24 h cap applies. That is bounded, not a finding.
  • Delete waits until commands are proven gone: it refuses as unreachable and doesn't retry by itself. No new work.
  • sharedProviderRelayPartEnded / CodexKeptServers.holds:
    • It runs inside an existing liveness decide, after that call's daemon listing, and only for a shared relay this app holds attached.
    • Cost: byRelay lookup, stopping check, recovery.expected (O(1)), then a scan of that server's leases (≤ chats on it).
    • Liveness callers are opens, sends, starts and the reconciler's backed-off retries (2 s to 5 min, only for unknown verdicts). This adds O(leases) to each of those calls next to a daemon round trip, and adds no new calls.
  • A top-level unresolved helper stays held until interrupted: it does the same endThreads work as the old letGo, on the family (familyOf, O(family)). On failure it stays held, inside the identity cap, and is read again at most once per 10 s on the next open or delete.

Nothing new: no timers, no per-line or per-frame work, and no new retained state beyond the capped recovery.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf re-scan: head 6d5d077

Head 6d5d0775598b76d5cd7a9fbeb63b53248a5e046b, one commit since f24223168ea (codex-shared-server-pool.ts, codex-shared-server-turns.ts, +10/-1). Static scan only: no runtime numbers.

Verdict: PASS. The P1 from f24223168ea (idle hand-backs held as unread until the 24 h cap) is cleared for the common cycle.

  • Trace of the fix: retireRelayed records turns.starts, runs the fenced read, and calls unfence() when no turn/started was read meanwhile. Then handBack → handToDaemon → detachAttached → child.detach() runs synchronously up to unbindRelay(), so nothing is read between the check and the unbind. settle(true) → ackNow now sees durable() === true and acks consumption.upTo(pushedSeq). That covers every line the app took, the read's own replies included.
  • In the daemon: unacked() is empty at detach, so unread() is false. With nothing open, check() after 60 s quiet reaches this.host.stop(). Lines the app never read (a helper's late turn/started) stay unacked, so openWorkAtDetach counts them and the server isn't stopped while that work runs.
  • Lifetime now: about 60 s (app idle timer) + about 60 s (daemon HANDED_BACK_IDLE_STOP_MS) after the last chat closes. A new chat in that window spawns its own server, and the old one stops about a minute later, so at most about 2 servers per key at any time across open/close cycles. No accumulation.
  • Residual (not a finding): when a start was read during the scan, or output arrives after the detach (a helper waking), those lines stay unacked and count as unread, and the 24 h detached cap is the bound. That's tied to real work on the server, not every cycle.
  • Cost: turns.starts is one increment per turn/started; unfence() is one flag write. No timers, no per-line work, no retained state.

… daemon's idle stop (no app keeps its output); acks stay held from the read, so the daemon counts every start and end
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan: adbfc21 (shared Codex servers survive restart)

Verdict: PASS. No perf regression at this head. The open concern from the previous scan (6d5d077), idle shared servers lingering up to the 24 h detached cap because unread output held the daemon's idle stop, is fixed for the hand-back path. Static scan only: no tests, builds or runtime were run.

What changed

  • A hand-back detach now sends rebuildable: true (provider-relay-attached-agents.ts policyFor(…, handBack)). The daemon parser accepts only undefined | true (provider-relay-detach-policy.ts:120-143).
  • ProviderRelayIdleStop.check() (provider-relay-idle-stop.ts:300-311) no longer lets unread lines hold a rebuildable relay. Once it has been quiet for idleStopMs (60 s, HANDED_BACK_IDLE_STOP_MS) with no open work and no pending requests, it stops the relay.
  • The pool's retireRelayed (codex-shared-server-pool.ts:233-240) no longer unfences when no turn started during the read, so acks stay held from the read onward. CodexSharedServerTurns.starts and its increment on every turn/started are removed.

Is an idle handed-back server stopped promptly? Yes

Timeline for one idle server: the last lease leaves, the pool waits IDLE_SERVER_STOP_MS (60 s) and does one open-work read. The server is handed back, and the daemon arms its idle stop with that open set plus the unacked lines replayed through the marker reader. After 60 s of quiet with nothing busy, check() stops it. Bound: about 2 min after its last work ends, where before it could be about 24 h (cap). If the server is busy, the timer is not re-armed. The next agent line restarts the 60 s window (waitingForLine), so a running turn is never stopped and there is no polling.

A quit detach (detachProviderRelayForQuit → policyFor with no handBack) does not carry rebuildable. adopt() replaces the whole policy, so the flag from an earlier hand-back does not carry over to a later attach or quit detach whose output must be kept.

Can servers accumulate per key? No

handBack removes the server from the pool's servers map and idleTimers, and kept.forget clears its placement. The pool starts a new server for the key only when a chat opens and none is live. Each handed-back server now stops within one idle window once its work ends, so handed-back servers per key are bounded by those still running real work. Before, it was every idle hand-back in the last 24 h. Each stopped relay leaves one ended-relay entry and its spool file for ENDED_RELAY_RETENTION_MS (24 h). Before, a cap stop kept them for CAP_STOPPED_RETENTION_MS (7 days). The spool holds only the unacked tail, at most the 1 MB memory cap and in practice just the open-work read's replies. Retained state goes down.

Work by trigger

Work Trigger / cadence Population Bound
rebuildable field check in readProviderRelayDetachPolicy each detach/spawn/attach policy parse in the daemon 1 per detach O(1)
rebuildable spread in policyFor each hand-back detach 1 per idle server per hand-back O(1)
check() rebuildable short-circuit one-shot idle timer (60 s) after arm, or the first agent line after a busy check 1 per detached relay O(1). It skips unread(), which built the unacked() array (keptTail.after + memory.after), so this is less work than before
Replaying unacked lines at arm (openWorkAtDetach) once per hand-back lines since the fence (now always held from the read, not only when a turn started) ≤ 1 MB spool memory cap, a single pass; usually just the read's own replies
Removed: turns.starts += 1 every turn/started on a shared server per turn removed
Removed: idleUnread → detached-cap count for idle rebuildable relays was on every idle check with unread lines per idle handed-back relay removed. The cap's one-shot timer is no longer armed for them

Idle wakeups (daemon / main / renderer): none added. A handed-back idle relay now gets one 60 s one-shot timer, then stops and calls cap.forget. Before, it had the same timer plus a detached-cap deadline and a live process for up to 24 h. There are no new intervals and nothing new on renderer or main.

Regression classes touched

  • Fixed-cadence poll / loop that never settles: checked, not a problem. The idle stop is one-shot, and a busy relay waits for an agent line, not a timer.
  • New steady-idle wakeups: checked, not a problem. Daemon timers go down (cap deadline removed for idle hand-backs). Main and renderer are unchanged.
  • Expensive code reachable past a removed gate: the gate that was loosened is the daemon's unread hold, and only for rebuildable. Past it is host.stop(), a single close per relay. That is the intended outcome and costs nothing repeated.
  • Per-entity state outlives the entity: checked, not a problem. servers, idleTimers, placements and the cap's detachedAt/counted are all cleared on hand-back and stop. Ended-relay retention is 24 h, down from 7 days.
  • Re-reading unchanged input: checked, not a problem. The open-work read runs once per idle hand-back, not on a poll.

Six questions

  1. Unused work before the skip gate: reviewed. The rebuildable check now runs before unread(), so the unacked array is no longer built for these relays.
  2. Ownership multiplication: reviewed. One idle-stop instance and at most one timer per relay. Each server is handed back once, then removed from the pool.
  3. Thread / storage: reviewed. Daemon-side O(1) checks. Spool replay at arm is bounded by the 1 MB memory cap. No new sync fs or SQLite.
  4. Growth / progress: reviewed. Live handed-back servers are bounded by running work, and ended relays expire after 24 h.
  5. Execution host: reviewed statically. The same daemon logic runs locally and on SSH hosts, with no platform-specific code in the change. Not run on Windows or Linux.
  6. Obsolete work stops: reviewed. Idle handed-back servers now stop about 60 s after quiet, and the cap entry and timer are released on settle.

Remaining risk (not changed here)

  • If the open-work read cannot answer (open === null), or the daemon lost unacked lines from its file (unacked() === null → overflow), the relay is unarmed or unaccounted and stays bounded only by the 24 h cap. Both are failure paths and predate this commit.
  • A turn Codex never closes keeps a handed-back server alive with no cap, by design: running work is never capped.
  • No runtime measurement. The bounds above come from the source.

… lines a reopen rebuilds or never shows (replies, turn and item frames, status); plan updates, goals and errors still hold it
…ach (before the spool files them) and as each later line arrives, so an empty scan's replies don't hold its idle stop
…ok, a denied review) still hold a handed-back server's idle stop
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan: 90bdb79 (diff adbfc21a74f~1..90bdb793971)

Verdict: PASS. No perf regression found. The span adds no timers, no per-key state that outlives its relay, and no per-line work outside handed-back shared servers. Its per-line cost is a bounded envelope prefix scan that stops at the first kept line. On the main question, idle stops get more prompt: before this span any line received while detached held the idle stop (the server lingered up to the 24 h detached cap). Now only lines a reopen can't rebuild hold it.

Static review only. Nothing was run, so the costs below are counts and bounds, not timings.

Work introduced, with trigger, population and bound

Work Trigger Population Bound
isProviderRelayKeptLine in ProviderRelayIdleStop.observeAgentLine (provider-relay-idle-stop.ts:225) Each agent stdout line while the relay is armed (detached with an open-work policy), has a forgettable list, and keptUnread is still false Only shared Codex servers handed back to the daemon. The pool keeps one per launch key (codex version, home, skill roots), so a few per app, not one per chat or worktree. Attach, spawn and quit policies have no forgettable, so other relays skip the branch with a null check. slice(0, 4096), then leadingJsonEnvelope with stopAtContainer and 32 fields max. It returns at the first method/type/result/error key. A Codex frame is {"jsonrpc":"2.0","method":"…","params":{ (or the reply equivalent), so it does about 2–3 fields, about 60 chars and 1–2 small JSON.parse calls. Worst case is 4096 chars. It latches off at the first kept line. It runs on every line only while all output is forgettable, such as a detached turn streaming item/agentMessage/delta or reasoning deltas. Then the rate is that turn's frame rate, on the daemon, for the few handed-back servers.
Unacked scan in arm() (idle-stop.ts:178–183) Once per detach that carries forgettable (a hand-back) Same handed-back servers The .some stops at the first kept line, over spool.unacked(). That covers the lines since acks were held for the open-work read, capped by the 1 MiB spool memory cap. It returns null, which counts as kept, once spilled. It repeats the walk openWorkAtDetach already does. Runs once per detach.
readProviderRelayDetachPolicy forgettable validation (detach-policy.ts:133) Each spawn, attach or detach RPC that carries a policy Per relay RPC At most 256 names of at most 128 chars each, so ≤ 32 KiB checked. The app's hand-back list is ~62 names.
FORGETTABLE_ON_HAND_BACK (codex-shared-server-keep.ts:31) Module load, once App main ~67 table entries filtered into a deduped array of ~62. Never recomputed.
policyFor copy, plus new Set(policy.forgettable) in adopt Each hand-back detach One per hand-back ~62 strings copied and serialized (~1.5 KB on the detach RPC), plus one Set per relay.

Requested checks

  • Idle hand-back stops promptly. When every line after the detach is a reply or a forgettable name (turn/item frames, agent and reasoning deltas, status chrome, benign notices), check() reaches unreadKept() === false and stops the server 60 s after its last line. keptUnread latches true for a plan update, goal, error or warning, hook/completed, guardianWarning, item/autoApprovalReview/completed, a file-change or process/exec output delta, process/exited, a server request, or an unparseable line. In those cases the server waits for the 24 h detached cap or a reattach, which is the behavior noted in the previous scan. Before this span every unacked line held it, so the set of lines that can hold a server only got smaller. A turn that edits files or updates its plan after the hand-back still lingers until the cap. That is intended (that output can't be rebuilt by a reopen), and the population is the few handed-back servers.
  • Per-key accumulation. None that outlives its owner. Each relay gets one forgettable Set (~62 strings, replaced on each adopt) and one boolean, freed with the relay. The span removes CodexSharedServerTurns.starts. It adds no Map or Set keyed by chat, worktree or host.
  • Timers. None new. schedule() and the detached cap's single timer are unchanged. Idle wakeups per second on main, renderer and daemon match the base: 0 added.

Regression classes touched

  • Hot-path rescans: matched and disproved. The per-line scan is a bounded prefix scan that latches off and is gated to handed-back relays. It is a second envelope scan next to the work reader's scannedName, but it is O(envelope) and not O(line).
  • Per-entity state outlives the entity: matched and disproved (relay-scoped fields only).
  • Fixed-cadence poll and new idle wakeups: no matching code.
  • Unbounded queues or fan-out: no matching code. Both the policy list and the scan are capped.

Six questions

  1. Unused work before the gate: reviewed. The scan is gated on armed && forgettable && !keptUnread before any slicing.
  2. Ownership multiplication: reviewed. One idle stop per relay, and a few handed-back servers per app.
  3. Thread and storage: daemon thread, CPU only. No fs, SQLite or subprocesses.
  4. Growth and progress: reviewed. The scan is bounded per line and stops at the first kept line. The arm scan is bounded by the 1 MiB spool memory cap. The policy list is capped at 256.
  5. Execution host: not applicable. Pure string work, the same on every platform and on remote daemons.
  6. Obsolete work stops: reviewed. disarm clears armed, which ends the scan, and the next arm recomputes keptUnread. Idle stop and the cap both still end the server.

Residual note (not a finding)

If the codex frame classification table grows past ~256 status or benign names, readProviderRelayDetachPolicy rejects the whole hand-back policy. The relay then detaches unarmed and waits for the 24 h cap. Today there are ~62 names, about 4x headroom.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan: shared Codex app-servers survive a restart (head 90bdb79)

Static scan of the whole PR diff (git merge-base HEAD origin/main..90bdb793971, 55 files, 53 shipped). Nothing was run: no timing, CPU or heap numbers here. Each cost below is a source-proven count with its trigger. Surfaces covered: hot-path (both files the detector reported), plus the shared-server, provider-relay and daemon-relay paths.

Verdict: blocked, one P1.

Finding

P1. A restored pooled chat's reopen scans its whole tool-call history a second time.

  • Where: src/main/codex/structured/threads/codex-kept-turn-ordinals.ts:258-299 (savedRunningCodexRows), called from codex-kept-snapshot.ts:315-318. New in this PR.
  • Trigger: openCodexStructuredSession opens a chat whose connection is relay.rebuilt (a run kept on a shared server). That happens once per restored pooled chat per app launch, and the restart path reopens those chats at startup.
  • Work: visitItems({ kinds: ['tool-call'] }) reads every tool-call row of the chat. That is ceil(T/256) reader-pool page reads, and each full AgentJournalRenderItem is cloned to Electron main with its saved output, where a visit callback runs per row. The rows it needs are only the ones saved as running, usually 0 to a few.
  • Why it is waste: the same open already runs catchUpCodexThread, and for rebuilt chats it always runs because keptRunning is false. Catch-up calls readCodexHistoryJournalView, which visits every message, tool-call, diff, approval, question, status and turn row. This PR also makes that pass inspect running tool-calls (openScopes). The new scan reads a subset of rows the first pass already visits, so a rebuilt reopen does 2 history passes where 1 is enough.
  • Price at the reference fleet: about 100 restored pooled agents, each with T tool calls (thousands in a long chat, and their outputs make up much of the journal's tens of GB). That is about 100 × T extra row clones and visits on main during startup, on top of the existing view pass. It grows with chat history and is not capped.
  • User impact: slower first usable progress for each restored chat at launch, and more main-thread deserialization while every restored chat reopens at once. Not measured.
  • Remedy (not verified): have the view pass collect what savedRunningCodexRows needs (address, saved key, whether input.command is present, for running tool-call rows) and pass it to openKeptCodexState. This keeps the same output. A state-filtered journal read would also work.
  • Guard: a counting journal reader on a rebuilt open with N and 10N tool-call rows. Expect items-by-kind page reads to equal one view pass, not view + 1 per page of tool-calls.

Work inventory (trigger, population, bound)

Work Trigger Population Bound / disposition
isProviderRelayKeptLine per stdout line (daemon, provider-relay-idle-stop.ts:225) each line a handed-back shared server prints while no app is attached lines/s of turns running on it (deltas) 4096-char prefix, 32 fields, stops at the first container. It latches once a kept line is seen and only runs while armed with a forgettable list. O(1) per line, beside the existing reader.read parse. Clean.
Unacked scan at detach (idle-stop.ts:178-183) once per hand-back spool's unacked lines one pass per detach, bounded by the spool. Clean.
readCodexSharedOpenWork (2 listings + thread/read + terminal list per loaded thread) a relayed server idle 60 s with no lease, or quit loaded threads on that server ≤64 pages per listing, 4 at once through the server's PrioritySemaphore, 5 s timeouts, and the first timeout fails the rest fast. Once per retirement or quit. Clean.
seedRunningCodexTurns / keptRunThreads in a restored lease's close close of a restored lease the lease's threads 4 at once, through the shared limited reads. Once per close attempt. Clean.
Close retry with readsFailed (codex-shared-server.ts:108-126) a restored lease's release whose reads failed stuck closing leases Wakes early on turns.changed. Otherwise a timer at 30 s, 60 s, 120 s, 240 s, then 300 s, so at most 1 wake per 5 min per stuck lease. It ends when reads pass, the server exits or the lease count changes. Healthy state: 0 timers. This is the backoff fix pattern. Clean.
Metadata reads routed through the 4-permit semaphore (lease-requests.ts:104-108) thread/read, thread/turns/list, thread/loaded/list on a relayed server every chat on the server Fewer at once, no extra calls. Each request's timeout counts from when it is asked, and a request whose caller left is never sent. Residual: a foreground history page can wait behind a startup burst at equal priority.
CodexSharedServerRequests.admit / takeFor / answer each server request frame; each thread claim pending requests (approvals waiting), settled-id ranges has is O(ranges). Ranges merge, and in-order ids grow the last range in place. takeFor is O(pending). Runs at approval rate. Cleared on server exit. Clean.
Server-wide request deadline setTimeout (router.ts:284-286) an account-token refresh or attestation request with no chat open one per such request one-shot, unref, 10 s / 100 ms. Clean.
REBUILT_BY_RESUME.has + replayed() per notification (codex-shared-server-start.ts:43-46) every app-server notification all chats on a server O(1) Set lookup and seq compare. Clean.
RelayedProviderConsumption.lineSeqs each relayed line queued lines Pushed beside after and spliced with it at the same compaction. Same bound. Clean.
daemonReadsFolder(anyFolder) runs codesign a new relayed shared-server spawn on macOS servers per launch key one child per server start, concurrent probes shared. Clean.
readProcessStartTimeMs a relayed server start servers one probe per start. Clean.
openTools in discoverCodexHistory catch-up on chat open turns with a tool row saved as running Re-reads that turn's full page on each open until the row settles. Summary paging was already full-depth before this PR. One extra page per open-tool turn per open. Clean, noted as residual.
hot-path: installProviderRelayRecords (host assembly) once at journal install 1 Stores a pointer. get is an in-memory Map.get. The installed list has no caller. Clean.
hot-path: relayedPlacement (lease transitions) each process-identity commit per launch O(1) object build. agentSessionRunPlacement adds one shortString check per read. Clean.
placeKeptProviderRelay for shared agents launch-time placement shared relays Skips the environ token read, so less work than before.

Listener census and send rates

Subscription / registry Listeners at reference fleet Idle rate Loaded rate Teardown
onProviderRelayQuit 1 (pool singleton) 0/s fires once at quit process lifetime (singleton)
registerPooledProviderRelayChat map 1 per open keepable pooled lease (~100) 0 sends; read only at quit and in per-chat relay queries same unregistered in finish, endQuietly and detachForQuit
track() once-listeners (exit, RELAYED_CHILD_HANDED_OFF) 2 or 3 per attached shared-server child (one child per server) 0/s once per child lifetime fire once, and the child goes with them
sharedAttachedHere / byRelay / handing 1 per relayed server 0/s n/a removed on exit, hand-off, remove() and finally
onCodexSharedRelayChats.holds 1 module callback 0/s read once per run-gate decide n/a
turns.waiters (close retry) 1 per stuck closing lease 0/s healthy; ≤1 per 300 s per lease with readsFailed checked on each turns.changed (turn start/end, lease end); this check predates the PR resolved on pass or timer
Daemon detach policy (forgettable, ≤256 names) 1 message per hand-back 0/s 1 per hand-back n/a
Daemon idle-stop timer for handed-back servers 1 per handed-back server Lazy one-shot (re-armed to idleStopMs - quietFor) ≤1 wake per 60 s until stopped stops with the agent

Steady-idle wakeups per process: Electron main 0 → 0, daemon 0 → 0, renderer untouched. Handed-back servers do now live on in the daemon while the app runs, where the app used to stop them itself. A handed-back server adds ≤1 lazy idle check per 60 s until its work ends and it stops. That check fires only after activity, so it is not a fixed idle cadence.

Regression classes touched

  • Re-reading unchanged input / hot-path rescans: finding (the P1 above).
  • Fixed-cadence poll that never settles: matched (close retry) and disproved. Exponential backoff capped at 5 min, healthy state has none, and it ends with the lease or server.
  • New steady-idle wakeups: matched (server-wide deadline timer, daemon idle stop) and disproved. Both are one-shot or event-driven, and none fires at idle.
  • Per-entity state outlives the entity: matched (pooled, byRelay, sharedAttachedHere, handing, endedChats, SettledRequestIds) and disproved. Each is deleted in its owner's teardown. endedChats is capped by the number of distinct chats on one server during that server's life.
  • Unbounded fan-out: matched (open-work and seed reads) and disproved. 4 permits per server.
  • Subprocess per item or per event: matched (codesign, process start time) and disproved. Once per server start.
  • Sync fs/SQLite on main: no matching code. Record reads are an in-memory Map, and journal reads go through the reader pool.
  • Streaming re-processes whole message: matched (daemon line scan) and disproved. Bounded prefix, latched.
  • Eager startup imports: matched (new value imports on the provider-relay graph). All are local modules, no SDKs. Disproved.

The six questions

  1. Unused work paid before the skip gate: reviewed. The duplicate tool-call scan is the finding. Every other new read sits behind relaying, rebuilt, restored or readsFailed.
  2. Ownership multiplication: reviewed. One open-work read per server, not per chat. Semaphores are per server.
  3. Thread and storage layer: reviewed. The duplicate scan's clones and callbacks land on Electron main. The daemon line scan runs in the daemon and is bounded.
  4. Growth and progress: reviewed. The close retry backs off and ends, open-work pages are capped at 64, and the openTools re-read converges once the row settles.
  5. Execution host: reviewed. Relaying is disabled on Windows. codesign runs only on macOS. SSH-backed chats don't use the pool relay.
  6. Obsolete work stops: reviewed. Hand-off unregisters the lease, unfence runs on an aborted retirement, quit work is tracked and awaited under a 5 s cap, and trackProviderRelayQuitWork clears its own entries.

Residual (not inspected at runtime): foreground metadata-read latency behind a startup burst on one 4-permit server, and real Codex page sizes for openTools re-reads.

…d as running, through the unsettled-row index, not every tool row in its history
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The latest changes appear safe to merge; no new blocking failure was established.RetriggerView in GreptileConfidence Score: 5/5

[High impact] The latest changes appear safe to merge; no new blocking failure was established.

Summary

Shared Codex servers can stay under the terminal daemon across Orca restarts on macOS and Linux. Reopened chats recover their history and running work from Codex.

  • The terminal daemon keeps eligible shared Codex servers running across an Orca restart.
  • Requests wait for the chat that owns their Codex thread.
  • Reopened chats rebuild their running Codex thread state from Codex history.
  • Each chat returns to its kept run, and app-bound tools stay on a separate server.

Diagram

sequenceDiagram
  participant Chat
  participant Orca
  participant Daemon
  participant Codex
  Chat->>Orca: Open saved chat
  Orca->>Daemon: Find saved shared server
  Daemon-->>Orca: Attach to existing server
  Orca->>Codex: Resume thread and read history
  Codex-->>Chat: History and running work
  Orca->>Daemon: Hand server back at quit
  Daemon->>Codex: Keep work running
Loading

Reviews (9) · Last reviewed commit: "fix(codex): a chat whose run is kept on ..." · Reviewed by Greptile

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan of the whole PR at fab469655a3: clean

I scanned the whole diff (git diff $(git merge-base HEAD origin/main) HEAD, base 95f6bb9539e) without running anything. That covers 57 production files, about 2,000 changed lines, and the callers, consumers, teardown and promotion paths they reach. The surface detector reported hot-path for structured-agent-session-host-assembly.ts and agent-session-lease-transitions.ts. I also covered the shared-server, provider-relay, daemon-relay and native-chat journal surfaces. I priced everything against the reference fleet: 100+ agents, a few hundred terminals, and tens of GB of chat journal (many thousands of tool rows per long chat).

No P0 or P1 findings.

The earlier blocker is fixed

savedRunningCodexRows (codex-kept-turn-ordinals.ts) now calls visitItems({ kinds: ['tool-call'], running: true }). In the journal this becomes itemsByKindHeadersSql(true) (journal-items-by-kind-page.ts:44):

  • It uses INDEXED BY journal_items_unsettled, the partial index (session_id, epoch, ordinal, item_id) WHERE hidden=0 AND (lifecycle_state IN ('running','pending') OR live_work=1).
  • The query repeats the index's predicate word for word, so SQLite can use it.
  • ordinal>? is a range on the index's third column, and ORDER BY ordinal follows index order, so there is no sort step.
  • kind='tool-call' AND lifecycle_state='running' are checked against the row after the index lookup.
  • Rows come back in pages (VISIT_PAGE) on the journal's worker, as before.
trigger population bound
before every reopen of a chat on a rebuilt shared server every tool-call row in the chat's history (tens of thousands) grew with history
after same, once per reopen rows still unsettled in the chat's epoch the number of unsettled rows, the same set the reopen's existing unsettled-row timeline reads already walk

The cost no longer grows with history. Body reads (readItemsByKindPage) happen only for the rows chosen. Only the bodies of commands still open, or of history-import commands, are read again afterwards (seedCarriedKeptCodexCommands, 1–2 itemBody reads per open command).

All work the PR adds, with trigger, population and bound

Work Trigger Population Bound
codexPooledRunOf / providerRelayPlacedRunOf (codex-structured-connection-opener.ts, codex-shared-server-pool.ts:98) building an opener, and each pooled open 1 record an in-memory records.get (agent-session-record-store.ts:134), O(1)
ownRunMayBeKept and codexPooledRunGate a chat open whose last run was relayed (pooled: only until its kept server is attached, after which byRelay short-circuits it) 1 daemon listing per open concurrent cold opens share one in-flight listing (instanceListing). This is the same per-open gate that a chat's own relayed agent already pays
kept.serverFor / reattachServer a pooled open after a restart the servers kept per relay one attach per relay, whatever the chat count (byRelay is set synchronously after the gate)
readProcessStartTimeMs (codex-shared-server-start.ts) each relayed shared-server spawn 1 pid one /proc read or one ps per server start, one time only
inspectMacProcessCodeIdentity (provider-relay-spawn-request.ts, anyFolder) each new relayed shared-server spawn on macOS (a reattach skips it) 1 codesign child async; concurrent probes for the same pid are shared; one time per server
readCodexSharedOpenWork hand-back after the 60 s idle timer, or at quit the server's loaded threads, each with thread/read plus a background-terminal list at most 4 in flight per server (PrioritySemaphore), 64 pages, 5 s timeouts; once per hand-back
keptRunThreads / seedRunningCodexTurns (codex-shared-server-writer-stop.ts) closing a restored lease the lease's threads, one thread/turns/list (limit 1) each at most 4 at once, once per close attempt
Retry for a release whose reads failed (codex-shared-server.ts:124) only when that close's reads failed stuck closing leases backs off 30 s → 60 → 120 → 240 → 300 s. It ends when the server exits, a turn or chat changes, or a retry succeeds. A healthy idle run has no timer
REBUILT_BY_RESUME.has plus replayed() per notification (codex-shared-server-start.ts) every frame from a shared server 1 O(1)
CodexSharedServerRequests admit/takeFor/answer/resolved server requests only (approvals, token refresh): human- or tool-paced requests Codex is waiting on pending drains on answer or serverRequest/resolved. settled stores ids as ranges; ranges only multiply where gaps are left, and the set dies with the server
RelayedProviderConsumption.lineSeqs every relayed line a queue parallel to after the same compaction as after (head > 1024 and more than half the queue)
CodexJournalItems activeItems.get per item event Codex item events 1 an O(1) map lookup
readCodexHistoryJournalView openScopes / turnOfRow the existing full catch-up visit (base cost) adds O(1) per row; turnOfRow holds one entry per turn during the read freed when the read ends; sameCodexHistoryJournalView serializes only openTools (turns with a running tool)
Daemon ProviderRelayIdleStop: isProviderRelayKeptLine at a hand-back detach (once over the unacked lines), then per incoming line only while handed back and every line so far is forgettable each line at most 4,096 characters of envelope scan; it stops at the first kept line. The cost per line is constant and of the same size as the existing work-marker read
relayedPlacement (agent-session-lease-transitions.ts) each relayed process commit 1 builds one object; pure
installProviderRelayRecords (structured-agent-session-host-assembly.ts) journal install 1 runs once. list is installed but nothing calls it

Subscriptions and publications (listener census)

Subscription Listeners Idle send rate Loaded send rate
onProviderRelayQuit (pool constructor) 1 per process 0/s once per quit
onCodexSharedRelayChats holder 1 (a getter the daemon gate reads, not a stream) 0/s read per relay-gate call, O(1)
registerPooledProviderRelayChat registry 1 entry per open pooled lease, removed in finish/endQuietly 0/s read at quit (pooledProviderRelayChatsPresent: one pass over the open leases)
Shared child once('exit') / once(RELAYED_CHILD_HANDED_OFF) (provider-relay-attached-agents.ts:track) 2 per attached shared relay child (a few per app) 0/s once per child exit or hand-off
CodexSharedServerTurns waiters (existing) 1 per closing lease 0/s on turn or lease change

New timers are all one-shot and event-driven: the router's server-wide deadline refusal (100 ms or 10 s), the pool's existing 60 s idle timer (now followed by a hand-back), the daemon's 60 s idle stop after a hand-back, and the backoff for failed reads. Healthy steady idle adds 0 wakeups per second on main, the renderer and the daemon, so before and after are both 0.

Regression classes the diff touches

  • Re-reading unchanged input / growth with history. This was a finding at 90bdb793971. It is fixed here because the read now goes through the unsettled-row index.
  • Fixed-cadence poll that never settles. Matched by the retry for failed reads, and disproved: it only exists in a failure state, has exponential backoff with a 5-minute cap, and ends when the server exits, the lease changes or a retry succeeds. The hang watch retires hung servers. thread/loaded/list is already used by the existing kept-thread path, so it is not a permanently unsupported call.
  • New steady-idle wakeups. Disproved: there is no interval and every timer is one-shot.
  • Subprocess per item. Disproved: codesign and the start-time read run once per server spawn, not per chat or per event.
  • Unbounded fan-out. Disproved: every Codex metadata read goes through a 4-permit semaphore per server, and listings are capped at 64 pages.
  • Per-entity state outlives the entity. Disproved. The pooled registry, byRelay, handing and sharedAttachedHere all have deletes in the same teardown. The per-server endedChats and settled die with the server. handedOffAtQuit and reattachedFromLastRun are bounded by chat count per app session.
  • Hot-path rescans. Disproved. SettledRequestIds.has is linear in the number of ranges, but it runs only for request frames. takeFor only runs per thread claim.
  • Expensive code reachable past a gate. Disproved. Kept-state reads run only when relay.rebuilt is set. ownRunMayBeKept and the pooled-run gate are the existing per-open gate that a chat's own relayed agent already pays.

The six scan questions

  1. Unused work before the skip gate. Reviewed. Saved rows are read only when rebuilt === true, helper threads only with a running row, and command bodies only for open commands.
  2. Ownership multiplying work. Reviewed. There is one kept attach per relay and one open-work read per server hand-back, however many chats the server carries.
  3. Which thread pays. Reviewed. SQLite reads run on the journal's worker, paged. The Codex RPCs are async through the permit semaphore. Main does O(1) work per frame.
  4. Growth and progress. Reviewed. The blocker was cost growing with history; it now scales with unsettled rows. Failed reads back off and still move forward on any change.
  5. Execution host. Reviewed. Windows never relays shared servers. The macOS codesign probe runs only on a new spawn. Linux reads the start time from /proc. Remote hosts are untouched, because the relay gate requires a local execution host.
  6. Obsolete work stops. Reviewed. Hand-back moves timing to the daemon's idle stop. endQuietly unregisters and drains the lease queue (take). Fenced acks clear through unfence or the hand-back result.

Gaps: this was a static scan only, so there are no timing, CPU or heap measurements. The work counts above come from the source.

…nds it off instead of stopping it, so chats not reopened keep their work
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan: 62fe073 (quit hands off a kept shared server still reattaching) — clean, no findings.

Scope: git diff fab469655a3 62fe0735ef0 touches only codex-shared-server-keep.ts (+9/-3). Everything else in the PR is unchanged since the fab4696 scan, so that scan still covers it.

Servers that stay up at quit. The only new case is a server reattached from the last run (relayed.attach set) whose connection isn't up yet. Before this commit it stopped at quit. Now it goes back to the daemon. It was already running under the daemon before this launch, so this keeps the state from before the restart rather than adding a process. With no connection there's no open-work read, so the hand-off carries open = null. After that, the daemon's 24 h detached cap (RELAY_DETACHED_CAP_MS) stops it if nothing reopens it. If the reattach never registered an attached child, the detach does nothing, and the daemon applies the policy it got at spawn or attach when the stream drops. The lifetime is bounded either way. Population: at most one per kept relay, and kept relays are one per Codex launch key.

Quit latency. It's the same tracked-work slot as before: trackProviderRelayQuitWork holds the detach promise in place of server.stop(). With no connection, fencedOpenWork() returns null right away, so the cost is one daemon detach RPC per server and no Codex reads. The whole quit wait is still capped by QUIT_DETACH_WAIT_MS (5 s), and the pooledProviderRelayChatsPresent gate on whether quit waits at all hasn't changed.

Repeated work. None. settleQuit latches handedOff before tracking anything, so each server is handed off once, whether the pool's quit listener or onServerFreed calls it. attach stays set after connecting, but once connected that only repeats the existing relay.reattached check. Nothing is tracked twice.

Regression classes: the diff matches no listed class. There's no new timer, poll, subscription or idle wakeup, nothing loops per item, and no gate is removed. The widened condition only takes effect at quit.

Six questions: (1) no work before a skip gate. (2) one hand-off per server. (3) main thread does an O(1) map lookup plus one async RPC. (4) nothing grows. (5) no host-specific probes, and Windows still doesn't relay. (6) the lifetime of the abandoned reattach is bounded by the daemon's idle stop or its 24 h cap.

This was a static scan; nothing was run.

@brennanb2025

brennanb2025 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

QA on the final code: crash and quit, Claude and Codex

Linux, shared Codex servers on.

A Codex command restored after a crash. It reads Working, with Stop, and keeps every line shown before the crash:
(screenshot removed: contained real product data)

Stop ends it, and the row keeps its title and all its output:
(screenshot removed: contained real product data)

A Codex chat that finished while Orca was down shows its output once, in order:
(screenshot removed: contained real product data)

Claude chats. After a graceful quit the chat has one run and no duplicate rows, and Send replies normally:
(screenshot removed: contained real product data)

After a crash, the same:
(screenshot removed: contained real product data)

Stop interrupts a new Claude command after the crash relaunch:
(screenshot removed: contained real product data)

The Codex chat in the same workspace keeps its history and command rows:
(screenshot removed: contained real product data)

With every chat closed, the terminal daemon stopped the shared Codex server 60 s after it was handed back.

…odex-servers-survive-restart

# Conflicts:
#	src/main/codex/app-server/codex-app-server-connection.ts
#	src/main/codex/structured/acquisition/codex-structured-connection-opener.ts
#	src/main/provider-relay/app-provider-relays.ts
#	src/main/provider-relay/provider-relay-launch-inventory.ts
#	src/main/provider-relay/provider-relay-run-liveness.ts
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan of the merge with main at 031e7fe: no findings. This covers only what the merge adds: the combined diff and the 10 files both sides changed, compared with each parent.

What I checked, on the paths that repeat:

  • Front-pin checks at launch (refuseFrontOutsideRelay, launchProviderRelayFrontPin, refuseUnrelayedFront, refuseMovedProviderRelayFront, and takeProviderRelayFrontPin at process commit): each launch does a fixed number of Map lookups and deletes on its own chat key. Nothing loops over chats or relays, and nothing spawns or does I/O. The pin store is cleared at spawn or commit, and the refused set is capped at 256 entries.
  • Run gate (decide in provider-relay-run-liveness.ts): main's newer-daemon check and the PR's shared-part check now sit side by side. Both are constant-time per call: an instanceof check, Set/Map lookups, and requires.every over a list of about one entry. The gate still reads one cached instance listing per ask, the same as on either parent.
  • Listings (listOne / keep / placeKeptProviderRelay): serveKeptToolGrants makes one pass over each listing, and only at launch and relist. The pass is the same as on main, with nothing new on any repeated trigger. A shared agent now skips the per-chat spawn-token read, so the merge removes some work here.
  • Opener and tool resolution: codexPooledRunOf is a single record lookup. ownRunMayBeKept / providerRelayRunGate run once per open, as on the PR side.
  • Hand-back, idle-stop and chat drop: policyFor takes the PR's hand-back argument as a field spread. forgetKeptSharedToolChat (a map delete plus one token hash) moved into the shared drop path and runs at most once per dropped chat. The merge doesn't touch the daemon idle-stop files.
  • Steady idle: the merge adds no timers, polls, subscriptions or IPC.
  • Main brought three changes to these files: one journal-translation call per frame (with arguments only), a smaller items-by-kind page budget, and a protocol requirements check. None of them repeats more often in the merged result.

Six questions: no work is paid for before a gate, no owner multiplies work, the main thread pays only constant map work, and nothing grows with chats, relays or records past the listings that already existed. The execution host doesn't matter here (no new probes). The pin and refused sets are released at commit or capped. I didn't measure runtime; this was a static scan.

…n's front (a bot's) runs on its own relayed app-server, so its run and tools survive a restart
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan: c9a1304 (follows the clean scan at 031e7fe). Verdict: clean, no P0/P1.

Scope: the opener (codex-structured-connection-opener.ts), launch resolution (codex-structured-launch-resolution.ts), provider-relay-front-pins.ts, and what they reach: structured-agent-launch-composition.ts toolServers (once), session-mcp-launch.ts, SessionMcpTools.for, bot-tool-relay-kept-grants.ts grant, and bot-tool-relay-fronts.ts current.

App-server process count. With sharing on, a chat whose launch was given a daemon front no longer shares a server: a bot chat, or a non-bot chat with a relayed host MCP server. Each one now runs its own relayed app-server, one per such open chat. That is the same count as sharing off at base, and the existing detached cap and idle stop limit them the same way. Chats without a front still share. The extra processes grow with the number of open fronted chats, not with worktrees, turns or history, and keeping their runs alive is the point of the change.

Cost per launch. Resolution now passes relays=true when sharing is on. For a launch with relayed tools, fronts.current adds:

  • ensureConnectedWithin, a no-op when already connected
  • on macOS, one probeProviderCwd daemon RPC (1.5 s cap), skipped when reattaching a kept agent
  • one toolRelayFrontOpen RPC
  • serveOnce, memoized per daemon client

So there are at most two local daemon round trips, once per launch (start or resume), never per turn or event. toolServers is wrapped in once, so a launch resolves it a single time. Launches with no relayed tools skip relay.grant entirely and pay nothing. This is the same work the sharing-off path already did at base.

Repeated work. None found. providerRelayFrontPinned is a single Map.has. The opener is built after resolveLaunch, so it reads the pin the same launch set; it is not raced into the pooled path. The spawn, its commit or its end removes the pin, so the map holds no entry past its launch.

Regression classes screened:

  • Subprocess/RPC per item: none. RPCs are per launch, with a constant count.
  • Expensive code past a gate: the sharedServers !== true gate is gone, but what it now lets through is the base sharing-off path at the same per-launch cost.
  • Per-entity state outliving its entity: pins are cleared at spawn or end, and frontRefused is a BoundedMap(256).
  • Idle wakeups: none added.

Not measured: real launch latency of the two RPCs on a busy daemon (static scan only).

@brennanb2025

brennanb2025 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Combined QA on the final head 8499574: bots, shared servers, restart, update, crash

Linux, shared Codex servers on.

Chats:

  • a Codex bot chat and a Claude bot chat, each calling a bot tool through Orca's tool relay;
  • two ordinary Codex chats, one with a subagent.

Steps, while all four were working:

  • a graceful restart;
  • an app update from an older build to a newer one on the same data;
  • a crash (kill -9).

Result: pass.

  • All four chats read Working before and after being opened, and kept every line with no repeats.
  • Each bot's first tool call after a relaunch got Orca's restart message, and the next call worked.
  • One writer per chat; nothing was re-run.
  • The Codex bot ran on its own daemon-held server; the ordinary chats shared one.

All four chats after the update, still Working:
(screenshot removed: contained real product data)

The Codex bot after the update: the restart message, then working tool calls:
(screenshot removed: contained real product data)

The Codex bot after the graceful restart:
(screenshot removed: contained real product data)

The Claude bot after the update: the restart message, then working tool calls:
(screenshot removed: contained real product data)

The subagent's command still running after the update, its output kept:
(screenshot removed: contained real product data)

Stop on a restored ordinary chat after the crash:
(screenshot removed: contained real product data)

… its tools now end with the app, so its open never lands on a second server
…h the app is still rebuilt as kept, so its running turn reads Working
…pooled placement, so a crash before it ends still reopens it on its server
…en its tools now end with the app, instead of special-casing that run's quit, close and rebuild
@brennanb2025

Copy link
Copy Markdown
Contributor Author

QA on 8a1dff993fe: shared Codex servers on, a kept chat that gains a credentialed tool

A chat whose 20-minute command was running on a shared server, after a quit, a relaunch with a new host tool that has a saved credential, and reopening it: it reads Working, and every line from before the quit is kept, once each. One command loop ran on the original daemon-held server the whole time (595 samples, every 2 s).
kept chat reattached, Working

Once that run ended, the chat moved to its own server for the new tool. Its first send was refused for about two minutes while the old server let the conversation go; the message stayed queued with Retry. This is listed as a known limit in the PR body.
first send after the move refused, message kept

Sending again worked:
resend works

An ordinary Codex chat replied on a shared, daemon-held server:
ordinary chat

A Codex bot chat's tool call went through Orca's tool relay and returned, on its own daemon-held server:
bot tool call

@brennanb2025
brennanb2025 merged commit e249d4f into main Nov 30, 2026
73 of 74 checks passed
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