Repository navigation
Harden websocket reconnect after rapid desktop relaunch #464
Description
Objective
Make repeated stock ChatGPT quit/relaunch cycles reliably initialize against the persistent websocket engine without requiring a manual service restart.
Finish Line
A bounded rapid-relaunch stress canary repeatedly closes and reopens the official app against one supervised engine; every launch completes the websocket initialize handshake or performs an automatic, fail-closed recovery.
Current Status
State: waiting final acceptance gate for milestone Codex Lab 0.1.0-lab.5 as of August 14, 2026.
Implementation and rapid-relaunch stress acceptance remain complete. The only missing criterion is one real desktop update/relaunch against the supervised engine. That opportunity requires the published and installed lab.5 artifact produced during #624, but it does not require #624 itself to close.
Next action after #624 publishes and installs lab.5: quit/relaunch the official desktop app through Codex Lab, confirm websocket initialize against the same exact-provenance supervised engine without stdio fallback or manual restart, and record the result in both issues before #624 closes.
Blocked by: no native issue blocker.
Waiting for: the published and installed lab.5 artifact from #624.
Last verified: August 14, 2026 during the full open-issue and dependency audit.
Acceptance Criteria
- A deterministic stress test distinguishes clean app shutdown from lingering helper/connection state.
- Five consecutive quit/relaunch cycles initialize against the same supervised engine without manual intervention.
- The rapid-relaunch initialize path stays within its deadline; service preflight remains fail-closed with an actionable visible error.
- Recovery never switches the local host to bundled stdio.
- App-server and desktop logs identify whether the stall is stale client state, stale server connection state, or protocol-level initialize handling.
- One real desktop app update/relaunch passes after the stress behavior is resolved or bounded.
Relationships
- Sub-issue of Prove persistent Codex Lab engine behind official Mac and iOS clients #385.
- Builds on merged PR Supervise the pinned websocket app-server with launchd #461 and PR Connect the desktop launcher to the supervised websocket engine #463.
- Related to the remaining ChatGPT quit/relaunch and real-update acceptance criterion in Prove persistent Codex Lab engine behind official Mac and iOS clients #385.
- Sequenced after the publication and installation portion of Publish and prove Codex Lab lab.5 #624; this issue supplies evidence required before Publish and prove Codex Lab lab.5 #624 closes but does not wait for Publish and prove Codex Lab lab.5 #624's closure.
Validation
- Deterministic gated-
plugin/listwebsocket regression, including a negative control against the old synchronous cleanup path. just test -p codex-app-server connection_handling_websocket— 14 passed.just test -p codex-app-server connection_cleanup— 3 passed.just test -p codex-app-server connection_rpc_gate— 6 passed.just test -p codex-app-server command_exec_process_ids_are_connection_scoped_and_disconnect_terminates_process— passed.just fix -p codex-app-server— completed with only pre-existing warnings.- Full
codex-app-serversuite completed 888/896 tests; the eight failures were unrelated existing command-exec, remote-store, thread-history/rollback, turn-start, and web-search failures. - Signed desktop canary: five clean cycles plus five immediate rapid cycles against engine PID 61289, all over websocket with matching provenance and no stdio fallback.
- Pending: one real in-app desktop update followed by reconnect to the same supervised engine.
Activity
shiny-code-bot commentedon Aug 22, 2026
Completed by the installed
codex-lab-v0.1.0-lab.5acceptance recorded in #624 on August 22, 2026.The real desktop update/relaunch gate passed against the exact-provenance supervised engine from source commit
482e8dd04c0bc078a05c5cb5962dc4542feaa099. The desktop relaunched without bundled-stdio fallback or manual engine restart, and the installed engine remained healthy through/healthzand/readyz. This satisfies the sole unchecked acceptance criterion here; implementation and five-cycle rapid-relaunch stress evidence were already complete.