# ACP background lifecycle manual driver

Environment for all captures: Linux x64, Chromium browser, 1280x800 CSS viewport
(2x device scale), light theme. Separate fresh dev databases for base and head;
T3CODE_DEV_SEED=0, same scratch git project, real GitHub Copilot CLI 1.0.121 via
ACP Registry, Claude Sonnet 5.5, default Agent/medium mode. No replay or stub.

Start `vp run dev` in each checkout, with an existing Copilot-enabled GitHub
credential inherited as COPILOT_GITHUB_TOKEN (never log it). Add the GitHub
Copilot registry provider, instance acpRegistry_github_copilot. Run seed.py with
that checkout and the scratch project, once per variant. Open the returned
thread directly in the paired browser. Hide sidebar and thread details to keep
host details out of recordings.

## Stop variant

1. Use seed.py --variant stop. Wait for Launched., Running subagent, Waiting.
2. In the composer type /clear and Enter. Type `Reply with exactly: hello`, Enter.
3. Confirm the fresh-session guard rejects it while the background work lives.
4. Click Stop in the Waiting row. Wait for the card to show Stopped.
5. Focus the retained draft and Enter again after about 12 seconds.
6. Base: same guard rejects again. Copilot and sleep 600 are still alive.
7. Head: new session accepts the message and replies hello. Prior runtime and
   sleep 600 are gone. Recording includes the Running -> Stopped transition.

## Runtime exit variant

1. Use seed.py --variant exit. Wait for Launched., Running subagent, Waiting.
2. Record the exact runtime PID belonging to this thread and its sleep 900 child.
   Verify its executable belongs to this checkout and cwd is the scratch project.
3. Start recording; send SIGTERM only to that runtime PID. Confirm both the
   runtime and its sleep child disappear. Action/process JSON files record this.
4. In the composer type /clear, Enter, then `Reply with exactly: hello`, Enter.
5. Base: Running/Waiting remain and the fresh-session guard rejects the message.
6. Head: background card becomes Failed (expand Worked for to inspect); Waiting
   disappears; a new session accepts the message and replies hello.

Recordings begin with the settled foreground turn and live background card.
Runtime-exit recordings show the app while SIGTERM is issued from the shell.
The base's continuing elapsed timer is itself part of the stale Waiting state;
its recording is the evidence for that dynamic state.
