Skip to content

Reuse Codex launch preparation from every entry point - #43365

Merged
brennanb2025 merged 8 commits into
mainfrom
brennanb2025/launch-prep-42225
Nov 17, 2026
Merged

brennanb2025 merged 8 commits into
mainfrom
brennanb2025/launch-prep-42225

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

#42225 let Orca skip Codex's launch preparation when nothing had changed, but in practice only CLI-started chats got that. Two things kept changing Codex's managed settings file, so the next launch always saw a "changed" file and redid all the work:

  • Re-saving an unchanged hook approval dropped a blank line, and Orca's settings refresh put it back.
  • Codex counts how often it has shown its "new model available" tip, and Orca reset that count before every launch. That also made the tip show up every session.

This PR stops both, so launches from the New tab menu, terminals and every other Orca-managed Codex entry point reuse the finished preparation. Codex's tip now stops after 4 shows, as it does outside Orca.

Tracked in #42225.

Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​130 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​130
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​159 $\color{#cf222e}{\Huge{\mathbf{−}}}$​34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​125

What Changed

  • Hook approvals: an unchanged approval is left byte-identical. The gap after a replaced block is kept, including for Windows paths, where each approval is written in both spellings. Orca's settings mirror and hook installer now produce the same bytes.
  • Codex's tip counter: the managed home keeps Codex's own [tui.model_availability_nux] table instead of overwriting it from ~/.codex. Before Codex writes one, ~/.codex seeds it. If ~/.codex spells that value any other way (inside [tui], dotted, escaped, or an inline tui = {…}), Orca keeps the old behavior, so the file can never define it twice.
  • Probes: the Codex model and skills probes skip the settings mirror when the last completed launch preparation still matches every input file. This is the same check the launch itself uses. Sign-in and resource syncing still run.

Why

These fix the causes instead of special-casing each caller of the mirror, and the probes reuse the launch's own input check rather than adding a second cache. At fleet scale (a ~/.codex/config.toml with 1,900 trusted projects), each full preparation costs ~155–165 ms of main-thread work. A mirror pass costs ~61–72 ms. The check that replaces it costs ~4.6 ms and runs off the main thread's synchronous path.

Visual Proof

N/A: no UI or layout change. The user-visible effects are faster Codex terminal starts and Codex's model tip no longer repeating; both are measured below.

Testing

Real app, OLD (003683d2ad3, main) vs NEW (this head), alternating sessions from the same pristine files. Codex 0.169 through the load balancer, hooks on, one approved user hook, a ~/.codex/config.toml with 1,900 [projects] tables. Two modes: Orca's managed home (M) and the system-default real ~/.codex (R, control).

Final head (59545b9), M4Air: 16 sessions, 196/196 launches replied, user hook fired on all 180 Codex launches, Claude native chat replied 16/16 on both builds.

Managed home, warm terminal launch (after Codex's tip count settles) OLD NEW
Codex-prep main-thread CPU (median ms) 164.3 0.4
click → terminal process spawned (ms) 330.5 104
main event-loop max delay (ms) 192.8 31.5
files Orca writes per launch 4 (config.toml ×2, .bak, 2 provenance) 1 (auth provenance, same as OLD)
Codex tip count after 7 sessions stuck at 1 (tip every session) 4, then stays
  • Chat launches and New-tab opens: NEW is no worse than OLD (chat main-thread CPU 36.1 vs 31.5 ms over 20 vs 20 launches, not significant (Mann-Whitney p ≈ 0.19), no function consistently higher; Codex prep ~1 ms both; 0 .bak rotations on NEW vs 2 per OLD chat session; New-tab open wrote 0 files on both builds, 12/12).
  • Mode R control: level over 21 launches per build (click→spawn 87 vs 89 ms, prep 15.5 vs 15.9 ms).
  • Settings edit in ~/.codex (effort medium→low): reached the managed config on the next launch on both builds; hook approval intact.
  • Fallback: with the tip count written inline in ~/.codex, NEW behaves like OLD (no duplicate table, Codex starts cleanly), minus the .bak rotation.
  • Rates and fan-out (OLD vs NEW):
    • IPC frames/s main→renderer and renderer→main, plus DOM mutation records/s, are level in idle windows (0.2 / 0.6 IPC/s, ~18 mutations/s) and in terminal launch windows (~27 / ~37 IPC/s, ~72 mutations/s).
    • Chat windows differ only by when the reply happened to land inside the 5 s window, which goes in both directions across modes.
  • Earlier fleet-scale run (this Mac, ~1.7k workspaces, ~1.8k chat tabs, intermediate head): the managed home's first chat after start went from rewriting config.toml and rotating .bak (2/2) to neither (0/2). Warm terminal .bak rotation went from 10/10 to 0/10, with the same rate parity.
  • Unit tests:
    • Writer regression: an unchanged approval followed by another table, and the Windows two-spelling pair at end of file.
    • Launch-prep currency check: turns false after a source edit.
    • Mirror: Codex's tip count is kept, and four other spellings in ~/.codex never produce a duplicate table.
    • Each new case fails on the previous code.
    • One existing expectation that encoded the dropped blank line was updated.
  • Reviewers validated 1,350 generated config pairs with a real TOML parser: every merge was valid and kept the ~/.codex values.
  • pnpm check:changed and CI pass on this head.

Risk

Level: Medium. This touches how the managed Codex config.toml is merged.

  • Riskiest part: keeping the tip-count table. A wrong merge could make Codex refuse its config. Every spelling other than Codex's own separate table falls back to the old merge, so that can't happen. Reviewers and QA confirmed with a real TOML parser and real Codex starts.
  • Writer: the only difference is the kept gap after a replaced approval.
  • Probes: they skip the mirror only when every input file is byte-identical to a completed preparation's.
  • Back-out: no wire format changes; a plain revert restores the old behavior.

Limits:

  • The first few terminal launches in a managed home still redo preparation while Codex raises its tip count to 4.
  • Every launch still rewrites shared-runtime-auth-provenance.json (unchanged here).
  • System-default real-home launches keep their separate ~15–20 ms hook check per terminal.
  • WSL homes are not accelerated.
  • Usage polling still runs the settings mirror synchronously (no write when unchanged).

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Home preparation now checks whether cached hook configuration matches current inputs before synchronizing system configuration. Probe preparation callbacks can return promises, and the skills and model catalog probe paths await them. The skills probe excludes requests canceled during preparation. TOML trust upserts preserve existing separators when replacing matching entries or blocks. Managed configuration merging handles the Codex TUI bookkeeping table and includes tests for duplicate tables and repeated synchronization.

Merge Risk: Low · up to 59545

Rarely, a skills discovery request can fail spuriously when it arrives right after another request was cancelled during home preparation. Unchanged hook approvals may also be rewritten with different line endings. Both are minor and worth fixing, but neither blocks the performance goal of this change.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Reuse Codex launch preparation from every entry point" matches the main objective: Orca-managed Codex entry points (New tab, terminals, chats) now reuse completed launch preparation when in…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template and covers ELI5, What Changed, Why, Visual Proof (N/A with reason), Testing with detailed measurements, Risk with level and back-out, and the upstream boundary che…
Full details: Title check

Explanation

The title "Reuse Codex launch preparation from every entry point" matches the main objective: Orca-managed Codex entry points (New tab, terminals, chats) now reuse completed launch preparation when inputs are unchanged. The changeset also includes hook-approval byte preservation and tip-counter retention, which support that goal, and the title does not describe anything absent from the changes.

Full details: Description check

Explanation

The description follows the template and covers ELI5, What Changed, Why, Visual Proof (N/A with reason), Testing with detailed measurements, Risk with level and back-out, and the upstream boundary checkbox. The Linked Issue section is not filled in with a 'Fixes #' reference; it says 'Tracked in #42225' and the template asks for an actual linked issue. The Review section and Notes section are not addressed. The AI Disclosure section is blank, and the Testing checkboxes are not ticked, though the Testing body describes manual testing and unit tests. Most required content is present, so the check passes, with minor gaps noted in the resolution.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

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: d79fba6d-f4f9-4601-adaa-dbd4ee7586e0
Commits

Reviewing files that changed from the base of the PR and between 5c9cae2 and a752083.

Files selected for processing: 12

  • src/main/codex-accounts/runtime-home/routing/runtime-home-service-home-routing.ts
  • src/main/codex/hooks/installation/codex-hook-launch-preparation.ts
  • src/main/codex/hooks/installation/codex-hook-service-implementation.ts
  • src/main/codex/hooks/installation/hook-service-launch-preparation.test.ts
  • src/main/codex/structured/catalog/codex-at-rest-skills-probe-pools.ts
  • src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts
  • src/main/codex/structured/catalog/codex-model-catalog-probe.ts
  • src/main/codex/trust/toml/config-toml-hook-trust-edit.ts
  • src/main/codex/trust/toml/config-toml-trust-hook-upsert.test.ts
  • src/main/orcad/account-launch/orcad-account-services.ts
  • src/main/runtime/agent-session/installation/structured-agent-session-runtime-contract.ts
  • src/main/runtime/construction/runtime-construction-dependencies.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status: ready for review.

Problem: #42225's reuse of finished Codex launch preparation only reached CLI-started chats. Two things kept changing the managed config.toml between launches:

  • Orca's hook-approval writer dropped a blank line, and Orca's settings mirror (model and skills probes, usage polling, serve startup) put it back.
  • Orca reset Codex's own "new model available" tip counter before every launch.

So every UI chat and every warm terminal launch redid ~155 ms of main-thread preparation (1,900-project config), rotated config.toml.bak, and Codex re-showed its tip every session.

User-facing change:

  • Warm Codex terminal launches in a managed home start ~210 ms sooner on the Orca side (click→spawn 318.5 → 107.5 ms) and do ~0 ms of preparation once Codex's tip count settles.
  • The tip stops after 4 shows, as it does outside Orca.
  • Opening the New tab menu no longer re-merges the settings file.

Fixed during review:

  • Windows two-spelling approval pairs at end of file still ping-ponged. Found by both reviewers in pass 1, fixed.
  • When ~/.codex writes the tip count inside [tui] (inline, dotted, escaped) or uses an inline tui = {…}, keeping the managed copy could define it twice, which is invalid TOML. Found in passes 3 and 4, fixed with a structural check that falls back to the old behavior. Pass 5: both reviewers READY; 1,350 generated config pairs validated with a real TOML parser.

Verified:

  • Real app, OLD (main) vs NEW (this head), final head, M4Air: 128/128 launches replied and the hook fired on all of them. Managed-home warm terminals: prep 155.1 → 0.2 ms, event-loop max 197 → 30.5 ms, files written per launch 4 → 1. Chat launches, New-tab opens and the real-home control are level. A settings edit in ~/.codex still applies. The inline-spelling fallback behaves like main.
  • Rates and fan-out: IPC frames/s in both directions and DOM mutations/s are level OLD vs NEW in idle and launch windows.
  • Earlier fleet-scale run (~1.7k workspaces, ~1.8k chat tabs, intermediate head): first-chat config rewrite and .bak rotation 2/2 → 0/2, terminal .bak rotation 10/10 → 0/10, rates level.
  • Mode R terminal timing: an interleaved A/B ruled out an Orca-side slowdown (click→spawn 86.5 vs 91 ms, within session spread).
  • /perf-scan on this head: no findings.
  • check:changed and CI: green. One unrelated orchestration test shard was flaky and passed on rerun.

Deferred / follow-ups (not changed here):

  • In managed homes, Orca's mirror also drops other settings Codex writes itself ([notice] dismissals, /pet, session picker view, realtime voice…). They reset every launch. This is a separate settings-persistence decision (keep per home vs. promote to ~/.codex).
  • shared-runtime-auth-provenance.json is rewritten on every launch (both builds).
  • Usage polling still runs the settings mirror synchronously (~61 ms at 1,900 projects; no write when unchanged).
  • Real-home terminal launches keep a ~15–20 ms hook check per terminal.
  • WSL homes are not accelerated.

Screenshots: N/A (no UI change); evidence is file-write timelines and CPU profiles from the QA runs.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan (fresh reviewer) on 59545b9

Perf review: PR #43365 at 59545b9f979. Verdict: clean, with no P0 or P1 findings

The earlier P1 is fixed. At 3b6105a9c07, upsertTrustSlots ran while (kept.next && slots.includes(kept.next)), which is O(D²) over D adjacent duplicate approvals. HEAD replaces it with a single index walk at src/main/codex/trust/toml/config-toml-hook-trust-edit.ts:170-173: it stops at the first non-adjacent slot, so it costs at most D−1 steps.

  • Same result as before: slotsByKey is filled in document order. indexHookTrustSlot appends during the scan. replaceHookTrustSlots deletes the key and indexes only the new slots, which sit where the first old slot was, and later appends go to the end (config-toml-hook-trust-blocks.ts:107-160,180-190). So kept.next === slots[index] matches exactly the adjacent run the old includes walk found.
  • Total cost per write is linear: the walk is O(D), and kept.chunks.join('') plus keepBlockSeparator cost the bytes of one slot. Writes per upsert are E (one per hook handler, a small constant).
  • The fallback upsertTrustBlocks (lines 201-208) is also linear: one ranges.slice(1) plus one slice of a single range, both O(D).

Main path: the probe's prepareHome (Electron main and orcad)

Trace:

  • Trigger: a model-catalog probe run (once per discovery), or a skills-probe run (once at start, then once per batch of up to MAX_FOLDERS_PER_REQUEST folders).
  • Owner: CodexRuntimeHomeRouting.prepareHostCodexHomeForReadOnlyAppServer (runtime-home-service-home-routing.ts:289-306). It runs on Electron main through main-process-runtime-service.ts:108 and in the orcad process through orcad-account-services.ts:98.
  • Work before (base): a synchronous syncSystemConfigIntoManagedCodexHome() full TOML merge on every call. The author reports 61–72 ms at 1,900 project tables.
  • Work now:
    • No completed config prep for the mirror home: isConfigPreparationCurrent returns false after three Map.has lookups, with no I/O. Cost is identical to base.
    • Keys present and inputs unchanged (hit): readCodexLaunchPreparationInputs runs about 40 async fs operations (lstat, stat, realpath, bounded read, .bak and held-path checks over 2 homes × 2 files plus 4 extra files). Main pays only SHA-256 over those bytes and one small JSON.stringify. The merge is skipped.
    • Keys present but inputs changed (miss): the same digest read, then the merge as on base.
  • Price at fleet scale: at the reference fleet, config.toml is about 750 project tables × ~100 B ≈ 75 KB. At 10× it is about 750 KB–1 MB, below the 4 MB MAX_AGENT_STATE_FILE_BYTES cap. SHA-256 at roughly 1 GB/s costs about 0.1 ms (reference) to 2 ms (10×) on main per call.
    • On a miss, that is added to a merge whose cost grows with the same bytes. Scaling the author's ~65 ms at 1,900 tables gives roughly 250 ms at 10×, so the overhead is about 1–3%.
    • On a hit, it replaces the whole merge.
    • The digest cost scales with config bytes, not with the number of probes or owners. It is the minimum price of the skip check, since it reads the same inputs the merge would.
    • Conclusion: dismissed with numbers. Not a finding.
  • Evidence: source-proven counts. Timings (155→0.2 ms warm terminal prep; 61–72→4.6 ms bench) are author-reported; I did not reproduce them.

Smaller changes I traced:

  • Skills-probe batch filter: batch.filter(pool.active.has) at codex-at-rest-skills-probe.ts:212 is O(batch) and capped at MAX_FOLDERS_PER_REQUEST. It skips answer when nothing in the batch is still live, which removes work.
  • Catalog-probe guards: assertStructuredAgentResolutionCurrent and throwIfAborted after prepare (codex-model-catalog-probe.ts:132-134, codex-at-rest-skills-probe-pools.ts:91-92) add O(1) checks that drop abandoned work.
  • Config merge: definesCodexTuiBookkeepingOnlyAsTable (config-toml-runtime-owned-sections.ts:121-154) adds one O(lines) pass over the system config per merge. Each structural line costs one key parse plus short joins. That is a constant factor on top of the existing getTomlSections passes in the same merge, and it runs on the same trigger, so it is not a growth regression. The new section predicates use sectionLeafKey on the already-parsed section.table, which is O(1).
  • Write churn goes down: keeping the runtime [tui.model_availability_nux] section, and keeping the original block separator, makes unchanged merges and approvals produce byte-identical output. The existing nextRuntimeConfig !== runtimeConfig check then skips the rewrite.
  • Type-only files: orcad-account-services.ts, structured-agent-session-runtime-contract.ts and runtime-construction-dependencies.ts only widen the type to void | Promise<void>. They add no runtime work.
  • Cache size: codex-hook-launch-preparation.ts adds an inputs string to each completedLaunchPrep entry. The map is still capped at 32 entries (line 262).
  • codex-hook-service-implementation.ts: a one-line delegate.

Regression classes the diff touches

Class Disposition
Hot-path rescans Matched (the old slots.includes loop). The fix is source-proven linear, as above. The final diff against main has no remaining quadratic, and the predicates and filter above are O(1) or capped per item.
Sync fs on Electron main Matched and disproved. The new check uses async fs/promises. The sync merge it can skip already ran on every call on base, so the change only removes sync work.
Re-reading unchanged input Matched and disproved. The check reads its inputs once per probe prepare, keyed by digest, in place of a full read, merge and compare.
Whole-file rewrite per change Matched and disproved. Byte-identical output plus the existing equal-content check means fewer writes than base.
Per-entity state outlives the entity Matched and disproved. completedLaunchPrep is capped at 32 with FIFO eviction, and one string was added per entry.
Unbounded fan-out or queues Matched and disproved. No new Promise.all. prepareHome holds a processes slot across its awaits but never acquires from that pool, so it cannot deadlock.
Eager startup imports Matched and disproved. hook-service is already on both startup graphs: main via main-process-pty-startup.ts, orcad via codex-runtime-home-launch-preparation.ts:5. No new module is loaded.

The other classes (store, selector, streaming, poll, hidden-owner, subprocess, publish) have no matching code; the change is main-process only.

Six scan questions

  1. Unused work before the skip check: reviewed. The check costs a digest of exactly the inputs the merge would read, and the zero-key case does no I/O.
  2. Ownership multiplying work: reviewed. One process-wide codexHookService, one check per prepare, and no new per-row, per-pane or per-worktree owners.
  3. Thread and storage layer: reviewed. File reads run on the libuv threadpool. Main pays SHA-256 (about 0.1–2 ms from reference to 10× fleet) and nothing else new. The merge stays synchronous, as on base, and is skipped on a hit.
  4. Growth and progress: reviewed. All new work is linear in config bytes or in D duplicates, with no retries or cursors.
  5. Execution host: reviewed statically.
    • Windows: about 40 async fs operations take longer in wall time but do not block main.
    • orcad and remote hosts: the daemon's codexHookService may have no completed prep, which makes the check an O(1) false and leaves base behavior.
    • Not measured on Windows or Linux.
  6. Obsolete work stops: reviewed. The new abort and currency checks after prepareHome drop work the caller has abandoned. A merge already started inside prepareHome is not cancellable. Base had the same behavior and it is a single bounded operation.

Coverage and remaining gaps

  • Verified by running: the PR's 3 changed test files (config-toml-trust-hook-upsert, codex-config-mirror, hook-service-launch-preparation): 29 of 29 pass.
  • No scale test for the D-duplicate path: none of the tests exercises many adjacent duplicates. The linear bound is proven from source only, so a future regression to quadratic would not be caught.
  • Not measured: timings and CPU, and anything on Windows or Linux. All millisecond figures are either author-reported or my estimates from byte counts, as noted above.
  • Not read: the author's QA reports.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (3)

Minor · Keep new requests separate from an aborted preparation… · codex-at-rest-skills-probe.ts:145-148

src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts:145-148
Minor · Stability & Availability · Quick win

Keep new requests separate from an aborted preparation owner.

While prepareHome is pending, cancellation of the last request aborts the unstarted owner. If another request arrives before preparation finishes, this branch adds it to that aborted owner. The pool's post-preparation abort check then rejects the new request, although its signal is not aborted.

Queue the new request for a replacement owner after the cancelled owner releases its resources. Keep sharing the owner when its controller is still live.

Minor · Preserve line endings in unchanged approvals. · config-toml-hook-trust-edit.ts:242

src/main/codex/trust/toml/config-toml-hook-trust-edit.ts:242
Minor · Data Integrity & Integration · Quick win

Preserve line endings in unchanged approvals.

If an unchanged approval uses CRLF, buildTrustBlock replaces its internal CRLFs with LFs. The caller then writes the file even though the approval did not change. Preserve the original block when it already represents the requested approval.

Minor · Preserve an unchanged approval without a final newline. · config-toml-hook-trust-edit.ts:224

src/main/codex/trust/toml/config-toml-hook-trust-edit.ts:224
Minor · Data Integrity & Integration · Quick win

Preserve an unchanged approval without a final newline.

If an unchanged approval ends at EOF without a newline, this fallback adds one. The caller then writes different bytes, contrary to the unchanged-approval requirement. Preserve the empty separator at EOF while retaining a separator before following content.

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: 8c1eeebf-a1ed-4d2f-8052-1fec160840d7
Commits

Reviewing files that changed from the base of the PR and between 1c3579c and 59545b9.

Files selected for processing: 4

  • src/main/codex/structured/catalog/codex-at-rest-skills-probe-pools.ts
  • src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts
  • src/main/codex/structured/catalog/codex-model-catalog-probe.ts
  • src/main/codex/trust/toml/config-toml-hook-trust-edit.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status: ready for review.

Problem: #42225's reuse of finished Codex launch preparation only reached CLI-started chats. Two things kept changing the managed config.toml between launches:

  • Orca's hook-approval writer dropped a blank line, and Orca's settings mirror (model and skills probes, usage polling, serve startup) put it back.
  • Orca reset Codex's own "new model available" tip counter before every launch.

So every UI chat and every warm terminal launch redid ~155–165 ms of main-thread preparation (1,900-project config), rotated config.toml.bak, and Codex re-showed its tip every session.

User-facing change:

  • Warm Codex terminal launches in a managed home reach a running process ~225 ms sooner (click→spawn 330.5 → 104 ms) and do ~0 ms of preparation once Codex's tip count settles.
  • The tip stops after 4 shows, as it does outside Orca.
  • Opening the New tab menu no longer re-merges the settings file.

Fixed during review:

  • Windows two-spelling approval pairs at end of file still ping-ponged (pass 1, both reviewers). Fixed.
  • When ~/.codex spells the tip count inside [tui] (inline, dotted, escaped) or as an inline tui = {…}, keeping the managed copy could define it twice (invalid TOML). Fixed with a structural check that falls back to the old behavior (passes 3–5; 1,350 generated config pairs validated with a real TOML parser).
  • The model and skills probes recheck their operation after the now-awaited home preparation, and skills requests cancelled during it are no longer sent (bot review thread + pass 6).
  • The perf reviewer found a quadratic walk over adjacent duplicate approvals in the approval writer; it is now linear. Fresh perf scan on this head: clean. Repair pass 8 (both reviewers): READY.

Verified on this head (59545b9):

  • Real app, OLD (main) vs NEW, M4Air, 16 sessions: 196/196 launches replied, user hook fired on all 180 Codex launches, Claude native chat replied 16/16 on both builds.

    Managed home, warm terminal launch (tip count settled) OLD NEW
    Codex-prep main-thread CPU (median ms) 164.3 0.4
    click → terminal process spawned (ms) 330.5 104
    main event-loop max delay (ms) 192.8 31.5
    files Orca writes per launch 4 1 (auth provenance, same as OLD)
    managed .bak rotations per session 13 0
  • Chats, New-tab opens and the real-home control: level (chat main CPU 36.1 vs 31.5 ms over 20 vs 20 launches, not significant, no function consistently higher; real-home click→spawn 87 vs 89 ms over 21 launches each). New-tab opens write nothing on either build.

  • Rates and fan-out: IPC frames/s in both directions and DOM mutations/s are level in idle (0.2 / 0.6 IPC/s, ~18 mutations/s) and launch windows.

  • A settings edit in ~/.codex still reaches the managed config on the next launch, with the hook approval intact. The inline-spelling fallback behaves like main, minus the .bak rotation.

  • Benchmark: head=59545b9f97916cdeeca7c12bd5f25a49e46e4597 gate=PASS real-app OLD vs NEW capture on M4Air (Codex terminal, Codex chat, Claude chat, New-tab menu, settings edit; main-process CPU profiles, fs-write hook, IPC and DOM-mutation counters).

  • check:changed (Omarchy) and CI: green on this head.

Deferred / follow-ups (not changed here):

  • In managed homes, Orca's mirror also drops other settings Codex writes itself ([notice] dismissals, /pet, session picker view, realtime voice…), so they reset every launch. That's a separate settings-persistence decision (keep per home vs. promote to ~/.codex).
  • shared-runtime-auth-provenance.json is rewritten on every launch (both builds).
  • Usage polling still runs the settings mirror synchronously (~61 ms at 1,900 projects; no write when unchanged).
  • Real-home terminal launches keep a ~15–20 ms hook check per terminal. WSL homes are not accelerated.
  • QA could only use a fresh Orca profile on the M4Air (Codex side fleet-sized); fleet-scale chat/workspace load was measured in an earlier stage on an intermediate head.

Screenshots (NEW, hidden window via CDP): Codex terminal, Codex native chat and Claude native chat, each after its "OK" reply.

Codex terminal
Codex chat
Claude chat

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