# Real Pi async idle-release reproduction

Environment: Linux x86_64, Pi 1.6.0, project-local pi-subagents 0.90.0,
Pi provider, openai/gpt-6-luna through the configured model endpoint.
Real T3 web and server from separate detached checkouts, fresh databases,
T3CODE_DEV_SEED=0, default idle/pin timeouts. Browser: 1280x800 CSS pixels,
light appearance, collapsed sidebar and thread-details panel.

Base: b5e1f91cba0e422e49e6ad33e666dd577e9af666
Head: 3d7e688d8dc5865e10ea4811c930a2294115788d

1. Install dependencies with `vp i`; install the extension project-locally with
   `pi install npm:pi-subagents@0.90.0 -l --approve`.
2. Start `T3CODE_DEV_SEED=0 vp run dev` in each checkout. Enable Pi with
   launch argument `--approve`. Add the checkout as a synthetic project through
   `t3 project add --title 'Async idle proof' .` against its own data directory.
3. Launch a Pi thread using model `openai/gpt-6-luna`. Authorize an async
   worker with the following exact pi-subagents call:

   ```json
   {"agent":"worker","task":"Execute bash sleep 2400 with timeout 2700 seconds, then reply exactly IDLE_SURVIVAL_COMPLETE.","model":"openai/gpt-6-luna","async":true,"label":"Idle survival","options":{"timeoutMs":3000000}}
   ```

   Tell the parent to report the run id and finish immediately without polling.
   Verify the actual child transcript contains the bash call
   `{"command":"sleep 2400","timeout":2700}`.
4. Leave each thread untouched past 30 minutes after the automatic four-minute long-running notice settles.
   Record the real conversation and collect lifecycle status with `observe.py`.
5. After 40 minutes, inspect completion or interruption. Send the same follow-up
   to both sides asking for the existing run's result without restarting it.

Setup: the preliminary 33-minute trial exposed the extension's default
four-minute long-running notice, which wakes the parent and resets idle time.
The final comparison therefore uses a fresh thread on each side, the same exact
prompt and tool call, and a 40-minute worker so it remains active past 30 minutes
following that notice. Neither timeout nor clock was modified.

Observed chronology (UTC): base last provider activity 21:40:40.863,
base session stopped 22:10:40.977, tracked child interrupted 22:10:40.884.
Head last provider activity 21:40:43.626; idle release deferred at 22:10:43.635.
The base native runner was absent while head's runner was alive at 22:12:56.
Head completed at 22:16:36.775, returned IDLE_SURVIVAL_COMPLETE, and its runner
exited with code 0. At 22:17 both sides received the same status-only follow-up.
Base reported that its runner disappeared before writing a result; head reported
complete, not interrupted. No run was restarted.

Recordings are continuous from 21:37:06 UTC until approximately 22:17:53 UTC.
The 40x copies accelerate playback only; real clocks and timeout values were
unchanged. Screenshots are unmodified, and each final still was taken after two
captures at least 500 ms apart had identical SHA-256 hashes.

Post-settlement check: after the identical status-only follow-up, head's original
session (created 21:36:16.183 UTC) was released normally at 22:47:10.690 UTC,
30 minutes after its final turn (22:17:10.585 UTC), with the child still completed.
Base's replacement session was created at 22:17:02.031 UTC and released at
22:47:12.384 UTC. The real-app comparison therefore also showed that settlement
removes the protection. The four-hour maximum pin expiration was not exercised,
since it exceeds the 100-minute evidence budget. Automatic workflow relaunch was
not exercised: the status-only follow-up explicitly forbade restarting work.
