# Compaction idle-release comparison

Run the unmodified real app separately on base 1bc44f2732ce0a24c0608626d59409f1a0893db4 and head 2c147a26c1c9a5b0a0f7540d5875c0ab925bf256, each with a fresh data directory. Install dependencies with `vp i`.

1. Run `python3 delay-proxy.py --output <scratch> --settings <existing-Claude-settings.json>`. It forwards to the existing authenticated endpoint without logging credentials or message bodies. It creates an isolated Claude config in `<scratch>/claude`.
2. Start each app with `CLAUDE_CONFIG_DIR=<scratch>/claude T3CODE_DEV_SEED=0 vp run dev --home-dir <checkout>/.t3`.
3. Create a one-file git repository (`README.md`: `Small sample project for explaining git rebase.`), commit it with synthetic author Example <example@example.invalid>, and add it through `node apps/server/src/bin.ts project add <sample-project> --title "Rebase example" --base-dir .t3`.
4. Run `node apps/server/src/bin.ts thread start <sample-project> "explain git rebase" --provider claudeAgent --model claude-haiku-5-5 --title "Compaction session lifetime" --wait --json --base-dir .t3` on each side. Both ordinary turns must complete.
5. Pair the browser using the startup pairing link. Open the returned thread directly at `/<environmentId>/<encoded-threadId>`. Use the same light theme and viewport on both sides. Hide only private machine-name labels before recording; do not alter status, messages, or controls.
6. Create `<scratch>/hold`. The proxy now delays each messages request for 155 seconds before forwarding it. It does not emit heartbeat data during the delay.
7. In each thread composer type `/compact`, press Enter to select autocomplete, start recording, then press Enter again to submit. Wait with no further input. Hide the right details panel on both sides.
8. Observe at two minutes: base releases its provider session with `idle_timeout` and shows the provider-stream error; head remains Working with a Stop button. Let the head proxy request finish: compaction must finish normally. Capture screenshots and stop recordings.

This proxy script is a parameterized copy of the driver used for the captures; only local paths have been removed. Captures hide private machine-name labels. The two recordings retain wall-clock timing.
