#!/usr/bin/env bash
# Run from either checked-out commit after vp i and starting its fresh dev server
# with T3CODE_DEV_SEED=0 and GOOGLE_GEMINI_BASE_URL set to the test gateway.
set -eu
workspace=${1:?Pass a scratch git workspace path}
mkdir -p "$workspace"
git init "$workspace"
python3 - "$workspace/sample.csv" <<'PY'
import sys
from pathlib import Path
Path(sys.argv[1]).write_bytes('オーダー番号,ステータス\n1001,完了\n'.encode('cp932'))
PY
node apps/server/src/bin.ts project add --base-dir .t3 --title 'CSV attachment proof' "$workspace"
# In the paired web client: Settings > Providers > Add provider > Antigravity.
# Keep instance id antigravity. Choose Gemini API key, enter a dummy nonempty key,
# Add instance, then Connect. Confirm Authenticated and runtime 1.5.16.
# Then run the command below and open the returned thread in the web client.
node apps/server/src/bin.ts thread start --base-dir .t3 --provider antigravity --model gemini-3.8-flash --title 'CSV attachment proof' "$workspace" 'Reply ready.' --json
# Wait for the plain-text turn to terminate (the proof run received quota 429).
# Attach sample.csv using Attach files. Type 'How many rows does this CSV have?'.
# At 1280x800 CSS pixels, light theme, hide sidebar and thread details.
# Start recording, click Submit message, and capture the terminal result.
# Base: generic provider-start error; trace: Attachment 'sample.csv' is not a UTF-8 text file.
# Head: prompt builder succeeds; session/prompt is sent; quota 429 comes from the model gateway.
