Repository navigation
Prove persistent Codex Lab engine behind official Mac and iOS clients #385
Description
Objective
Prove the final Codex Lab desktop architecture without building or cloning a GUI: a persistent, provenance-verified Codex Lab engine runs independently of the official clients; the signed ChatGPT macOS app connects to it locally, and the official iOS app connects to the same engine through native remote control.
The engine owns durable sessions, projects, account selection, five-hour and five-day reset awareness, prompt-cache affinity, approvals, and remote enrollment. The official Mac and iOS apps remain replaceable controllers. A ChatGPT app restart or update must reconnect to the same Lab engine rather than silently executing through bundled Codex.
Finish Line
Stock ChatGPT Mac and iOS clients use one persistent provenance-verified Codex Lab engine across client restart and update without silent bundled-Codex fallback.
Current Status
State: waiting historical persistent-engine/controller evidence. The old Lab engine and installation are retired.
Next action: use #974/#975 for the current iPhone-to-CLI proof, starting with the owner's three existing local sessions.
Waiting for: a demonstrated fresh-route gap for which this issue's historical canaries are useful. The old requirement to use only official clients with a persistent Lab engine is not carried into the fresh milestone.
Original canary comments and controller evidence remain unchanged. Current route selection is open under DIRECTION.md.
Last verified: 2026-09-26.
Relationships
- Child canary of Dogfood Codex Lab through ChatGPT GUI remote access #365.
- Builds on the split control/execution authentication implementation in Prove stable native remote control with separate execution auth #381.
- Feeds the end-to-end remote workflow validation in Validate Codex Lab remote control through ChatGPT GUI #367 and the daily-driver gate in Run bounded Codex Lab primary daily-driver canary #382.
- Related to Codex Lab identity and channel naming #4 for visible Codex Lab identity and provenance signaling.
- Retains Update Codex Lab launcher for current ChatGPT.app integration #366 only as historical launcher evidence and emergency rollback material, not as the target architecture.
- related: Prove stable native remote control with separate execution auth #381 - Prove stable native remote control with separate execution auth #381
- related: Codex Lab identity and channel naming #4 - Codex Lab identity and channel naming #4
- related: Update Codex Lab launcher for current ChatGPT.app integration #366 - Update Codex Lab launcher for current ChatGPT.app integration #366
- related: Make Background Review trustworthy for daily dogfood #570 - Make Background Review trustworthy for daily dogfood #570
Validation
- Headless daemon lifecycle and provenance checks in an isolated Codex Lab home.
- Direct Unix control-socket
initialize, version, and reconnect probes. - Stock Mac controller canary against the persistent engine.
- Stock iOS pairing, thread continuation, approval/input, reconnect, and revocation canary.
- Project/worktree, terminal/file, browser, and computer-use parity matrix.
- Split-auth quota/failover and prompt-cache accounting checks when an alternate account has usable quota.
- ChatGPT quit/relaunch, staged-update, daemon crash, login, and reboot recovery tests.
- Fail-closed tests for missing, corrupt, stale, and protocol-incompatible Lab engines.
Decisions
- The official ChatGPT Mac and iOS clients remain the only user-facing work surfaces.
- Codex Lab becomes a persistent engine/service, not a replacement GUI.
- The Mac path should be local and low-latency; iOS uses native remote control to the same engine.
- Launcher/menu-bar work is skipped unless a concrete canary failure proves an external recovery surface is necessary.
- Configuration is never accepted as proof of runtime identity; only live provenance from the serving engine can establish Lab status.
- Updates must reconnect to the persistent engine and must never silently switch execution to bundled Codex.
Open Questions
- Does the current stock Mac client preserve all local-host capabilities when connected through the existing local-daemon socket path?
- Can Lab identity and provenance be surfaced through the native host/environment UI, or is a minimal error-only status utility ultimately required?
- Which desktop/iOS app-server protocol changes require compatibility shims or coordinated Lab updates?
- Which native computer-use and browser host services must be bridged into the persistent daemon?
Acceptance Criteria
- A fixed Codex Lab engine starts from an immutable, provenance-verified candidate and cannot update itself to an upstream official binary.
- The current stock Mac client initializes against the engine over local websocket transport while preserving local-host semantics.
- The paired iOS client initializes against the same engine through native remote control.
- The Mac and iOS clients can observe and continue the same thread without duplicate turns or lost output.
- Existing projects and worktrees can be opened or mapped without accidental execution on the bundled Local host.
- Terminal streaming, file reads/edits, search, command/file approvals, and structured user input work from both relevant controllers. File reads and native iOS command approval are proven; search, structured input, and the full controller matrix remain.
- Browser use and native computer use are explicitly proven or recorded as a blocking parity gap.
- Control account identity remains stable while eligible execution accounts rotate only at safe turn boundaries and preserve per-thread cache affinity.
- ChatGPT quit/relaunch and one real in-app update reconnect to the same engine without re-pairing or bundled-Codex fallback.
- Engine absence and provenance failure are visible and fail closed; required V8 JIT entitlement validation is now merged, while client/engine protocol incompatibility remains to be exercised explicitly.
- A durable supervisor recovers the engine after crash, login-equivalent reload, and reinstall without launching ChatGPT automatically.
- Rollback restores the previous Lab engine or intentionally returns to stock Codex without stale launchd state.
Activity
cbusillo commentedon Jul 21, 2026
July 21 Mac canary evidence
The final-form Mac transport is now proven against the stock signed ChatGPT app.
Live state
~/.codex-lab/packages/standalone/current/codexcom.shinycomputers.codex-lab.engine8664887188~/.codex-lab/app-server-control/app-server-control.sockStock GUI evidence
From
codex-desktop-265abc52-d084-4231-8f60-ac2505795d41-87188-t0-i1-225539-0.log:Process inspection showed only the managed daemon app-server. No ChatGPT-bundled or legacy candidate stdio app-server existed, and the GUI log contained no SQLite initialization failure.
Root causes resolved in the canary
InitializeResponse.userAgenthad reused the outbound compatibility-clamped user agent, reporting0.120.0; ChatGPT 26.715.70719 requires>=0.141.0or the exact0.0.0development sentinel.login statusauthorization solved this without weakening Keychain access.transport=stdioplaceholder, then reports the selected local daemon astransport=websocket. Final-state logs, not the initial placeholder, are authoritative.Remaining release work
cbusillo commentedon Jul 21, 2026
iOS remote-control canary passed — July 21, 2026
The persistent signed Codex Lab daemon successfully paired with the official ChatGPT iOS client while the desktop GUI remained attached over the local WebSocket transport.
Verified directly through app-server RPC:
remoteControl/status/readreturnedconnectedclaimed: trueremoteControl/client/listreturned one authorizedphone/iosclient1.2026.188Important implementation finding:
account/switchActiveupdates the shared auth manager, but an already-connected remote-control WebSocket does not currently terminate on the auth-change notification. For this canary, cyclingremoteControl/disablethenremoteControl/enableforced a clean relay re-authentication and produced a new environment for the designated control identity. The final architecture should establish the fixed control identity before starting the relay—or explicitly reconnect the relay when its control identity changes—while execution-account selection remains independent.cbusillo commentedon Jul 22, 2026
Official iOS local-mode canary passed — July 22, 2026
The first complete official-GUI + official-iOS local-control path is now proven end to end.
Root cause of the earlier mobile rejection:
CODE_VERSIONapp_server_version = 0.0.00.0.0Canary remediation:
CODE_VERSION=0.145.0-alpha.27, matching the Codex binary bundled in the installed official desktop application0.145.0-alpha.27Observed iOS proof:
REMOTE CANARY 1Codex Lab active. Remote canary 1 acknowledged.thread/readRPC against the persistent daemon returned both the user and agent messages and reported the thread idleThis closes pairing, authorization, mobile version compatibility, remote thread creation, remote prompt delivery, model execution, response persistence, and desktop-daemon continuity for the single fixed control identity. Remaining decisive gate: keep this remote control identity fixed while assigning execution for a subsequent turn/thread to a different stored account.
Packaging follow-up: release/dev installers must always inject explicit
CODE_VERSION;0.0.0is not a valid remotely usable package identity. The top-level CLI--versionpath still reports the Cargo workspace version and should be reconciled with build provenance separately.cbusillo commentedon Jul 22, 2026
Fixed-control / pooled-execution canary passed
The remaining architectural gate from the prior comment passed in the same
REMOTE CANARY 1run.Direct evidence:
thread/startarrived fromcodex_chatgpt_ios_remoteversion1.2026.188resolved execution account leasefor a different stored accountgpt-5.6-lunacompleted the turn and the response was returned to/persisted for the iOS-created threadthread/readreturned bothREMOTE CANARY 1andCodex Lab active. Remote canary 1 acknowledged.Therefore the canary proves this topology:
This is the core product result: official desktop GUI and official iOS remote control can remain stable on one account while Codex Lab selects another paid account for model execution. Remaining work is production hardening rather than architectural feasibility: release-version injection, update/restart continuity, quota/reset-aware selection, stable same-thread affinity for prompt caching, and controlled failover tests.
cbusillo commentedon Jul 22, 2026
Same-thread affinity and mobile task-stream recovery passed
After the first successful remote turn, the iOS task view entered
Reconnecting to taskand disabled Send.Diagnosis:
connectedRecovery:
remoteControl/disable→remoteControl/enableFollow-up proof:
REMOTE CANARY 2in the original threadCodex Lab active. Remote canary 2 acknowledged.thread/readreported two turns and all four expected user/agent messagesThis validates stable same-thread execution affinity—the behavior needed to avoid gratuitous account switching and preserve prompt-cache locality. It also establishes a narrow recovery primitive for a stale mobile task view: relay-only reconnect, with no daemon/session/pairing disruption.
Production hardening should detect this stale-task condition and perform or offer the relay-only recovery automatically rather than leaving the mobile UI indefinitely disabled.
shiny-code-app commentedon Sep 27, 2026
Backlog reconciliation — 2026-09-26
Closing against the merged DIRECTION.md. Main is now upstream
2deb542491plus the fresh-start files and thetools/account-routersidecar; the old Lab code stays preserved onarchive/lab-main-2026-09-24. Evidence and history in this thread are kept.Disposition: superseded (not planned). DIRECTION.md retires "the installed Lab build and its services", including the remote-control app-server, housekeeping jobs, and the self-hosted release and signing runners. The fresh remote route is #974/#975/#976 on stock Codex. The July canaries stay here as evidence.