#!/usr/bin/env bash
# Run separately from each commit's checkout after vp i and starting
# T3CODE_DEV_SEED=0 vp run dev in a retained terminal.
set -euo pipefail
: "${DEMO_DIR:?Set DEMO_DIR to an empty synthetic git project directory}"
git init "$DEMO_DIR"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Approval demo' "$DEMO_DIR"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider codex --model gpt-6-luna --title 'Sandbox command approval' "$DEMO_DIR" "Run exactly this command in the sandbox: curl -sS -o /dev/null -w '%{http_code}' https://example.com. Do not change files." --json
cat <<'STEPS'
Open the returned thread in the paired web client (Chromium, 1280x800 CSS pixels, dark theme).
The initial CLI-created turn uses the default Full access setting and returns HTTP 200.
Close the thread details panel to keep environment identity out of captures.
Open the model picker, Permissions, and select Auto-accept edits.
Send: Run exactly this command in the sandbox: curl -sS -o /dev/null -w '%{http_code}' https://example.com. Do not change files.
Wait for the sandbox networking failure. If Codex automatically requests escalation, decline it.
Send: Rerun that same curl command outside the sandbox with escalated permissions. Use require_escalated and ask for approval with a reason.
Wait for Command approval. Inspect the Command field beside Decline and Approve.
Base: only the justification appears; no command line appears in the approval.
Fix: /bin/bash -lc "curl -sS -o /dev/null -w '%{http_code}' https://example.com" appears, with the justification beneath it.
Capture the pending card, then decline it.
STEPS
