#!/usr/bin/env bash
# Run once per checkout, using a fresh worktree-owned .t3 database.
set -euo pipefail
scratch=$(mktemp -d)
mkdir -p "$scratch/codex-home" "$scratch/demo"
cp "$(dirname "$0")/config.toml" "$scratch/codex-home/config.toml"
git init --quiet --initial-branch=main "$scratch/demo"
python3 "$(dirname "$0")/standin.py" &
standin_pid=$!
trap 'kill "$standin_pid"' EXIT
export CODEX_HOME="$scratch/codex-home"
export T3CODE_DEV_SEED=0
# Control: returns ok; adding -c model_reasoning_summary=detailed returns HTTP 400.
codex exec --skip-git-repo-check 'Reply with just: ok'
# Start this from the checkout under examination; use the printed pairing URL.
vp run dev
# In a second terminal, in the same checkout:
# node apps/server/src/bin.ts project add "$scratch/demo" --title 'Bedrock summary compatibility' --base-dir "$PWD/.t3"
# In the paired web client, create a Codex thread in that project, leave the
# default model and Medium effort selected, type 'Reply with just: ok', Enter.
# Base: unsupported_parameter error. Head: assistant replies ok.
