#!/usr/bin/env bash
# Run from each checkout with its isolated server already running.
# Args: T3 home, synthetic workspace, advertised Claude model.
set -euo pipefail
home_dir=$1
workspace=$2
model_id=$3
node apps/server/src/bin.ts project add "$workspace" --title 'Compaction demo' --base-dir "$home_dir"
node apps/server/src/bin.ts thread start "$workspace" 'Prepare the synthetic history.' \
  --title 'Idle history' --provider claudeAgent --model "$model_id" --wait --json --base-dir "$home_dir"
# The accompanying provider.mjs responds through the Claude SDK protocol with
# 248000 tokens and a five-minute cache TTL. Wait six minutes before opening
# the idle thread. Settings: idleCompaction=onReturn, claudeAgent.config.binaryPath
# points to provider.mjs. This fixture checks the real mobile UI, not a live model.
