Skip to content

fix(codex): coordinate first app-server initialization per home - #68

Merged
xxchan merged 1 commit into
mainfrom
fix/codex-first-home-init
Oct 2, 2026
Merged

xxchan merged 1 commit into
mainfrom
fix/codex-first-home-init

Conversation

@xxchan

@xxchan xxchan commented Oct 2, 2026

Copy link
Copy Markdown
Member

Concurrent first opens on a fresh CODEX_HOME can fail inside Codex's SQLite initialization. Coordinate app-server startup within one loaded OAR adapter: wait for the first successful initialize/initialized handshake, then allow subsequent clients to start concurrently. This covers sessions, account usage and inventories without changing public records, query deadlines or adding retries.

The gate canonicalizes relative paths and symlinks using the actual child environment/cwd, invalidates readiness when the directory is replaced, cancels waiting clients before spawn, and waits for a failed initializer to exit before allowing its successor. Unit regressions cover these boundaries and preserve the open record's position ahead of same-chunk notifications. A real vendor regression opens eight sessions in an un-warmed fresh home.

Native model-listing controls and documentation explain why codex debug models stays outside the gate: on 0.160.0/Linux, 24 standalone model readers and 21 alongside three app-servers succeeded, models-only homes contained just their config, and file-system tracing found no SQLite paths. The native code uses a separate model catalog/cache. Coordination does not extend across host processes or separately loaded copies of OAR, and it is not a database migration lock.

Validation: CI=true pnpm run check (496 tests and mock behavior), Codex 0.160.0 vendor suite (11 applicable tests, including eight cold concurrent opens), Codex behavior suite (18/18), and pnpm run build. Native controls are reproducible with node experiments/codex-concurrent-startup.ts <native-binary> 8 3 models. Cross-platform CI remains the Windows evidence; the earlier Windows failures' cause is not established.

Refs #57. Follows #67 and upstream Codex issue #50290.

@xxchan
xxchan merged commit 590bf4f into main Oct 2, 2026
12 checks passed
@xxchan
xxchan deleted the fix/codex-first-home-init branch October 2, 2026 13:02
@xxchan xxchan mentioned this pull request Oct 2, 2026
xxchan added a commit that referenced this pull request Oct 2, 2026
Patch release:

- #65 codex: a thread's `subAgentActivity` changes only its own
children's tasks and edges. A subagent messaging a sibling or the root
no longer creates a phantom root task or reopens the sibling; a
grandchild's edge comes from its real parent (found by the daily
inspection, closes #60).
- #67 `--version` probe failures keep the native reason and stderr tail;
the codex test-home warmup waits for a successful handshake and exit.
- #68 codex: the first app-server initialization per `CODEX_HOME` is
coordinated within one OAR module. codex 0.160.0 fails SQLite
initialization when several processes first open a fresh home at once
(upstream openai/codex#50290); sessions, account usage and inventories
now wait for the first handshake, then start concurrently. Eight cold
concurrent opens went from 1/8 to 8/8.
- Docs: the 2026-10-02 maintenance pass (#62, #63, #64, #66).

Version bump only in this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: exe.dev user <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants