#!/usr/bin/env bash
# Run these same commands in each disposable checkout, after vp i.
# Base: 507093152148c0d31c09bcd40e3ce4b5214a8557
# Head: 083351dd5b65d5f749b89727de6ca28168a7f618
# The caller supplies an empty scratch directory. No production data is used.
set -euo pipefail
scratch=$(realpath "$1")
mkdir -p .t3/userdata
cat > "$scratch/claude" <<'STUB'
#!/bin/sh
if [ "$1" = "--version" ]; then echo "2.1.302 (Claude Code)"; exit 0; fi
exit 1
STUB
chmod +x "$scratch/claude"
python3 - "$scratch/claude" <<'PY'
import json,sys
from pathlib import Path
Path('.t3/userdata/settings.json').write_text(json.dumps({'providerInstances':{'claudeAgent':{'driver':'claudeAgent','enabled':True,'config':{'binaryPath':sys.argv[1]}},'opencode':{'driver':'opencode','enabled':True}}}))
PY
# Run in a retained terminal: T3CODE_DEV_SEED=0 vp run dev
# Wait for the server's Listening line, then execute:
node apps/server/src/bin.ts project add . --title 'Model version evidence' --base-dir .t3
node apps/server/src/bin.ts thread start . 'Call orchestrator_capabilities once. Then call delegate_task exactly once with task "Reply OK", target {"providerInstanceId":"claudeAgent","model":"claude-fable-5-2"}. Do not substitute any provider or model, and do not retry. Finish by quoting the complete exact tool error JSON verbatim, including code and message. This is a diagnostic reproduction; do no other work.' --provider opencode --model opencode/glm-5.3-flash-free --title 'Claude model version diagnostic' --wait --json --base-dir .t3
