Skip to content

Harden websocket reconnect after rapid desktop relaunch #464

Description

@shiny-code-bot

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

Validation

  1. Deterministic gated-plugin/list websocket regression, including a negative control against the old synchronous cleanup path.
  2. just test -p codex-app-server connection_handling_websocket — 14 passed.
  3. just test -p codex-app-server connection_cleanup — 3 passed.
  4. just test -p codex-app-server connection_rpc_gate — 6 passed.
  5. just test -p codex-app-server command_exec_process_ids_are_connection_scoped_and_disconnect_terminates_process — passed.
  6. just fix -p codex-app-server — completed with only pre-existing warnings.
  7. Full codex-app-server suite completed 888/896 tests; the eight failures were unrelated existing command-exec, remote-store, thread-history/rollback, turn-start, and web-search failures.
  8. 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.
  9. Pending: one real in-app desktop update followed by reconnect to the same supervised engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    planDurable planning issueplan:waitingDurable plan parked pending a decision, event, or non-issue condition; not for PR QA

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions