#!/usr/bin/env bash
set -euo pipefail
# Run separately in each checkout with a fresh T3 home and synthetic git project.
# PROVIDER and MODEL select the installed provider under test; keep identifiers private.
: "${PROVIDER:?}" "${MODEL:?}" "${PROJECT:?}" "${T3_HOME:?}"
node apps/server/src/bin.ts project add "$PROJECT" --title 'Queue recovery' --base-dir "$T3_HOME"
thread=$(node apps/server/src/bin.ts thread start "$PROJECT" Start --title 'Queue recovery' --provider "$PROVIDER" --model "$MODEL" --base-dir "$T3_HOME" --json)
id=$(printf '%s' "$thread" | python3 -c 'import json,sys;print(json.load(sys.stdin)["threadId"])')
node apps/server/src/bin.ts thread send "$id" 'Follow up' --base-dir "$T3_HOME"
# After the delayed HTTP 429: stop the captured server PID, restart with identical env.
# Pair the Android dev client; open Queue recovery > 1 queued > Resume queue.
# Record that tap on each commit; inspect the sheet and any visible refusal dialog.
