#!/usr/bin/env bash
# Scratch reproduction used for both revisions. No mocks or replay provider.
# Run from each installed worktree, with its dev server running on fresh state:
# T3CODE_DEV_SEED=0 vp run dev
# Timers in ProviderSessionManager.ts were changed identically on both sides:
# DEFAULT_IDLE_TIMEOUT_MS = 30 * 1000
# DEFAULT_MAX_IDLE_PIN_MS = 90 * 1000
# Pass an empty synthetic project folder as the only argument.
project_dir="$1"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Background task proof' "$project_dir"
node apps/server/src/bin.ts thread start --base-dir .t3 \
  --provider claudeAgent --model claude-haiku-5-5 \
  --title 'Background work across idle cap' "$project_dir" \
  'Start one Agent subagent with run_in_background: true. Ask it to run sleep 300 && date > background-result.txt using Bash run_in_background: true, then wait for that Bash task completion with TaskOutput block: true (timeout 600000). No progress messages. End your own turn immediately after launching with only launched. Do not poll or check on it.' --json
# Pair the browser, open the returned thread, and record until the five-minute
# command would finish. Observe the actual Claude and sleep child PIDs via /proc.
# On this runtime TaskOutput was unavailable; Claude used completion notification
# (head) and a Monitor (base). Neither emitted progress before idle cap expiry.
