# Background work follow-up reproduction

AI-assisted; verified with the tests and tools listed above.

Run the same procedure separately in the base and head checkouts. Use fresh T3 homes and the same synthetic Git repository. Install dependencies with `vp i`.

Configure a Codex provider instance with `config.binaryPath` pointing to the adjacent `background-codex-replay.py`. Select an available model in both settings and the initial CLI turn so the client does not switch model between turns. The helper implements the provider protocol; it calls no model. It launches real sleep processes and retains the background command item after completing the first turn.

Start each checkout with `T3CODE_DEV_SEED=0 T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=0 vp run dev --home-dir <fresh-home>` and a separate `T3CODE_PORT_OFFSET`.

Create the synthetic Git project with `t3 project add <workspace> --title 'Background work demo' --base-dir <fresh-home>`.

Start the initial turn using `t3 thread start <workspace> 'Start sleep 600 as tracked background work and finish your turn without waiting.' --title 'Background task proof' --provider codex --model "$EVIDENCE_MODEL" --base-dir <fresh-home> --wait --json`.

Open the startup pairing URL in a fresh browser profile, submit its pairing token, and open Background task proof. Close the thread details sidebar and dismiss the provider probe warning (the replay helper implements the turn protocol, not the skills catalog). Hide the model picker for privacy. Use the same 1280 by 800 CSS-pixel viewport and light theme on both commits.

1. Confirm the first turn has completed and `Running · sleep 600`, Details, and enabled background Stop appear.
2. Start a browser recording.
3. Enter `Run sleep 15 in the foreground.` in the composer and press Enter.
4. During the 15-second foreground command, inspect the background-work indicator and background Stop. On head, open Details, confirm its only entry is `sleep 600`, and close it with Escape.
5. Wait for the foreground command to complete. Confirm the earlier background work remains and background Stop is enabled again.
6. Stop the recording. Stop the development servers; the helper terminates its captured child processes on shutdown.

Observed: base hides the background-work indicator for the foreground turn and restores it afterward. Head retains the earlier command, disables background Stop while foreground Stop owns interruption, lists only sleep 600 in Details, and enables background Stop when the foreground turn finishes.
