# Codex retry and failure ordering proof

Use a checkout of current main with dependencies installed. Apply `codex-scenario-settings.patch`, put `later-codex-retry.e2e.ts` in `scripts/scenarios`, and make `codex-replay.py` executable. Set `T3_SCENARIO_CODEX_BINARY` to the replay executable's absolute path and `T3_SCENARIO_INHERIT_ENV=T3_SCENARIO_CODEX_BINARY,T3CODE_DEV_SEED`, then run:

```sh
T3CODE_DEV_SEED=0 vp run scenarios:prove scripts/scenarios/later-codex-retry.e2e.ts --base 0356d68835b7b579bb7151abf2f7919d9cce84f3 --head e37930ef458ba0c10b26e2204d5a0d2aef24ddc7 --upload-command 'ghdrop upload'
```

The local executable speaks the Codex app-server JSON-RPC protocol. It does not call a model. Both commits run their own unmodified Codex adapter, orchestration, persistence, WebSocket and web client with fresh synthetic state. Only the runner's provider settings are changed to point at the executable. The scenario creates the project and threads through the real CLI/API, opens each by its link, expands the completed activity log, and captures rendered order.

Replay A: initialize/config/thread/turn handshake; retry 1/5 (529); start/complete pwd; retry 2/5 (529); completed turn.

Replay B: same handshake, retry 1/5 and pwd, then a failed turn with responseStreamDisconnected 529.

Expected: the later retry recovery or terminal error appears below pwd. Multiple notices without intervening provider progress should update one row; that separate invariant is not exercised here.
