#!/usr/bin/env bash
# Commands used on each running fresh checkout; supply its isolated home and synthetic project.
set -euo pipefail
checkout=$1
data=$2
project=$3
cd "$checkout"
node apps/server/src/bin.ts project add "$project" --title 'Shared agent demo' --base-dir "$data"
node apps/server/src/bin.ts thread start "$project" 'Run exactly this shell command and wait for it to finish: sleep 900. Do not run any other commands.' --title 'Thread A' --provider codex --model gpt-6.1-sol --option reasoningEffort=low --base-dir "$data" --json
node apps/server/src/bin.ts thread start "$project" 'Run exactly this shell command and wait for it to finish: sleep 901. Do not run any other commands.' --title 'Thread B' --provider codex --model gpt-6.1-sol --option reasoningEffort=low --base-dir "$data" --json
