# Real Codex MCP workspace recovery proof

Base: f5f8c8d18baf6a194fea9c7a3734158c2b7ea57b (the requested merge-base).
Head: f6d5638ce21fe98456846f5076a3f7300dabc210.
Linux web dev app, separate checkouts and fresh T3 databases, real Codex CLI 0.170.0, Chromium, light theme, 1280 x 800 CSS viewport / 2560 x 1600 captures. No replay or mocked provider. No production database was seeded.

## Primary reproduction, same ordered steps on both commits

1. Create synthetic git workspaces projB and projA. Only projA has the project-scoped stdio MCP server in mcp.py. Trust both workspaces in an isolated Codex home. The server exposes projapp_show_card and projapp_ping and a real MCP app resource. Both tools are annotated read-only; no provider approval is needed for them.
2. Add B and A through the app's project CLI/API. In B, start a Codex thread with GPT-6.1-Sol and send `Reply with just READY`; wait for READY. In A, start with GPT-6-Luna and send `Call projapp_show_card once. Do not use shell tools. If the tool is unavailable, reply TOOL MISSING.` Wait for the completed turn.
3. Open A in the real browser. Its Project A card initializes. Click Ping project A and confirm PONG_A. Navigate away to B before stopping the server, so A's card cannot resume it during restart.
4. Stop and restart that side's dev stack on its own existing database and Codex home. **Send `Reply with just READY` to B again and wait for READY before opening A.** This explicitly makes B open the new shared app-server session. This was done in each uploaded run, not inferred from a previous recovery.
5. Open A and click Ping project A. Capture the card now, while A still has exactly its original show-card turn. Base shows `ERROR {"code":-32000,"message":"This app cannot call that tool."}`; head shows PONG_A.
6. Only after the card capture, send A `Call projapp_ping once. Do not use shell tools. Reply PONG_A if it succeeds, or PROJAPP TOOL MISSING if unavailable.` Capture the actual agent reply: base PROJAPP TOOL MISSING, head PONG_A. These later captures intentionally contain two turns and are paired separately from the one-turn card captures.

## Explicit restart ordering in the uploaded runs (UTC, 2026-11-18)

- Head: B's post-restart thread/resume at 08:55:26.845 returned cwd projB / model gpt-6.1-sol at 08:55:27.076. B completed its second READY turn before the browser opened A. A's recovery thread/resume at 08:56:24.886 omitted cwd/model; Codex returned cwd projA / model gpt-6-luna at 08:56:24.937. The card video and still precede A's second agent turn at 08:56:53.
- Base: B's post-restart thread/resume at 08:56:03.945 returned cwd projB / model gpt-6.1-sol at 08:56:04.018. B completed its second READY turn before the browser opened A. A's recovery thread/resume at 08:57:46.456 supplied cwd projB / model gpt-6.1-sol; Codex returned those same wrong settings at 08:57:46.528. The card video and still precede A's second agent turn at 08:58:07.
- The separate C thread was prepared around this time on both sides for the additional revert check. Its sidebar row is visible in both card stills. It did not add a turn to A or replace the shared session: the recorded A resume requests/responses above establish B's runtime settings as the failing precondition.

## Additional changed path: unloaded thread/revert

1. In projA, create a separate Codex GPT-6-Luna thread C, with `Reply with just FIRST`, then `Reply with just SECOND`; wait for both completed replies. C has no app iframe, so opening it does not trigger an MCP resume.
2. Restart each side again, with the browser away from C. Send B READY first again and wait for its reply (base B resumes at 08:59:03.397, head at 08:59:04.911).
3. Open C, expand its SECOND prompt, click Edit from here, then Revert and keep changes. The recordings show the real confirmation and completed rewind.
4. Base resumes C at 08:59:57.095 with projB / gpt-6.1-sol before thread/revert. Head resumes C at 09:01:00.019 without cwd/model before thread/revert, and Codex returns projA / gpt-6-luna. Both native thread/revert commands complete.
5. Send C the same projapp_ping prompt as step 6 above. Base replies PROJAPP TOOL MISSING; head replies PONG_A. The stills show these replies and that SECOND has been removed from conversation history (its prompt remains in the composer from the rewind).

## Artifacts and inspection

The six recordings show card interaction, subsequent agent turn, and UI rewind on each commit. Card stills were extracted from the corresponding video after the result settled; two frames one second apart are byte-identical on each side. Agent and rewind stills were also checked for stability. Every published still and a contact sheet spanning each recording was opened and visually inspected. The card error wraps fully and the agent replies are visible.

protocol-excerpts.json contains selected fields from actual native app-server requests and responses, with timestamps. Config/credentials and machine identifiers are omitted; the synthetic fixture root is replaced by <fixture>. It proves the returned model and workspace, rather than relying on the UI model selector label. extract.py documents the selection.

seed.py and mcp.py create the synthetic fixtures; drive.py seeds and sends the primary prompts through the running app CLI (run from each checkout root, with these scripts in a common fixture directory). Start each side with T3CODE_DEV_SEED=0, its own --home-dir final-base or final-head below that fixture directory, and its own trusted CODEX_HOME. Run `python3 drive.py base seed` / `head seed`, restart, then `ready`, perform the browser card interaction, then `ping`. C's two plain-text prompts and UI steps above are the supplemental revert driver.

Limit: this proves the restart-induced thread-not-found path and unloaded revert path. It does not claim a literal 30-minute idle-unload wait.

Work performed by gpt-6.1-sol through the Codex harness.
