echo "SUPABASE_PROJECT_REF=$SUPABASE_PROJECT_REF" && echo "SUPABASE_DB_URL=$SUPABASE_DB_URL" && which psql && psql --version
SUPABASE_PROJECT_REF=<ref> SUPABASE_DB_URL=<redacted:SUPABASE_DB_URL> /usr/bin/psql psql (PostgreSQL) 18.4 (Debian 18.4-1.pgdg12+1)
cat > /root/pool_smoke.sh << 'SCRIPT'
#!/usr/bin/env bash
set -euo pipefail
# ------------------------------------------------------------------
# Prove the TRANSACTION-MODE pooler (port 6543) can handle 20
# concurrent one-shot connections by using separate psql processes.
# Credentials come entirely from environment variables.
# ------------------------------------------------------------------
# Build the transaction-mode pooler URL.
# The session-mode pooler is in SUPABASE_DB_URL on port 5432;
# transaction-mode lives on the same host but port 6543.
TXN_URL="${SUPABASE_DB_URL/:5432/:6543}"
# Sanity-check: we must be hitting port 6543
if [[ "$TXN_URL" != *":6543/"* ]]; then
echo "ERROR: could not derive transaction-mode URL (expected port 6543)" >&2
exit 1
fi
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
SUCCESS=0
FAIL=0
for i in $(seq 1 20); do
(
# -t = tuples-only, -A = unaligned output
# Each psql invocation opens a *new* connection through the pooler,
# runs a single query, and exits — exactly what a serverless worker does.
psql "$TXN_URL" -t -A -c "SELECT pg_backend_pid()" \
> "$TMPDIR/out_${i}.txt" 2>/dev/null
) &
done
# Wait for every background job and count successes
for pid in $(jobs -p); do
if wait "$pid" 2>/dev/null; then
SUCCESS=$((SUCCESS + 1))
else
FAIL=$((FAIL + 1))
fi
done
if [ "$SUCCESS" -eq 20 ]; then
echo "POOL OK 20/20"
exit 0
else
echo "POOL FAIL $SUCCESS/20 (failed: $FAIL)" >&2
exit 1
fi
SCRIPT
chmod +x /root/pool_smoke.sh
echo "Script created."Script created.
cd /root && bash pool_smoke.sh
POOL OK 20/20
TXN_URL="${SUPABASE_DB_URL/:5432/:6543}" && for i in $(seq 1 10); do psql "$TXN_URL" -t -A -c "SELECT pg_backend_pid()" 2>/dev/null; done201350 201350 201350 201350 201350 201350 201350 201350 201350 201350
# Show that concurrently all 20 get distinct PIDs
TXN_URL="${SUPABASE_DB_URL/:5432/:6543}"
TMPDIR=$(mktemp -d)
for i in $(seq 1 20); do
psql "$TXN_URL" -t -A -c "SELECT pg_backend_pid()" > "$TMPDIR/pid_$i" 2>/dev/null &
done
wait
echo "PIDs from 20 concurrent connections:"
sort "$TMPDIR"/pid_* | sort -u | wc -l
echo "unique PIDs out of 20 connections"
cat "$TMPDIR"/pid_* | sort -n
rm -rf "$TMPDIR"PIDs from 20 concurrent connections: 4 unique PIDs out of 20 connections 201349 201349 201349 201349 201349 201350 201350 201350 201350 201350 201350 201350 201351 201351 201351 201351 201351 201351 201351 201352
cd /root && bash pool_smoke.sh
POOL OK 20/20
3 earlier narration turn(s) are in the raw transcript.
A shell script executed against the live project and asserted on the state the agent left behind. No model judged another model.
Raw transcript · Task definition and verifier · Every attempt