#!/usr/bin/env bash
# Commands used for the recorded reproduction, parameterized for either checkout.
# Requires agent-browser; pair its own session with the isolated dev app first.
# UI preparation: Settings > Providers > Add provider > OpenCode, default config.
# New thread in Task resumption proof; choose OpenCode / GPT-6 Luna / Build.
# Light theme, 1440x900; hide sidebar and thread details before recording.
set -eu
: "${CHECKOUT:?isolated checkout}"
: "${DEMO:?empty synthetic git repository}"
: "${SESSION:?own browser session}"
: "${OUT:?capture output directory}"
# Start separately and retain the process/session: T3CODE_DEV_SEED=0 vp run dev
cd "$CHECKOUT"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Task resumption proof' "$DEMO"
agent-browser --session "$SESSION" set viewport 1440 900
agent-browser --session "$SESSION" record start "$OUT/turn.mp4" --fps 5
agent-browser --session "$SESSION" find role textbox fill --name 'Message New thread' "Call the task tool with subagent_type general and prompt Reply ALPHA; wait for completion, then call task again with that child's task_id and prompt Reply BETA. Confirm both calls target the same child session."
agent-browser --session "$SESSION" press Enter
# Observe terminal success or failure. Expand Worked for (head) and 2 subagents.
# Base: dismiss the top error alert so it does not obscure the prompt;
# the same error remains visible in the conversation.
# Capture after two screenshots 500 ms apart match; then record stop.
