env | grep -i supabase
SUPABASE_DB_PASSWORD=<redacted:SUPABASE_DB_PASSWORD> SUPABASE_DB_URL=<redacted:SUPABASE_DB_URL> SUPABASE_URL=https://<ref>.supabase.co SUPABASE_SERVICE_ROLE_KEY=<redacted:SUPABASE_SERVICE_ROLE_KEY> SUPABASE_PROJECT_REF=<ref> SUPABASE_ANON_KEY=<redacted:SUPABASE_ANON_KEY>
which psql && psql --version; which xargs; which parallel 2>/dev/null; which bash
/usr/bin/psql psql (PostgreSQL) 18.4 (Debian 18.4-1.pgdg12+1) /usr/bin/xargs /usr/bin/bash
echo "$SUPABASE_DB_URL" | sed 's|:5432/|:6543/|'
postgresql://postgres.<ref>:<redacted:SUPABASE_DB_PASSWORD>@aws-0-us-east-1.pooler.supabase.com:6543/postgres
cat > pool_smoke.sh << 'SCRIPT'
#!/usr/bin/env bash
#
# pool_smoke.sh — prove the project's transaction-mode (Supavisor) pooler works
#
# Requirements:
# SUPABASE_DB_URL session-mode pooler URL (port 5432 on pooler host)
# We rewrite the port to 6543 (transaction mode).
# SUPABASE_DB_PASSWORD database password (read from env, never hardcoded)
#
# The script launches 20 concurrent one-shot psql queries, waits for all of
# them, and prints "POOL OK 20/20" only if every one succeeded.
set -euo pipefail
: "${SUPABASE_DB_URL:?SUPABASE_DB_URL must be set}"
: "${SUPABASE_DB_PASSWORD:?SUPABASE_DB_PASSWORD must be set}"
# --------------------------------------------------------------------
# Build the TRANSACTION-MODE connection string.
#
# The env var gives us a session-mode URL (port 5432 on the pooler host).
# Supabase's transaction-mode Supavisor pooler listens on port 6543.
# We swap the port to 6543 and inject the password from the environment
# so it is never hardcoded in the script.
# --------------------------------------------------------------------
TXN_URL=$(printf '%s' "$SUPABASE_DB_URL" \
| sed -E 's|^([^:]+://[^@]*@[^:]+):5432/|\1:6543/|; s|^([^:]+://)([^@]*@)([^:]+):([0-9]+)/|\1\2\3:6543/|')
# Make sure the password in the URL matches the env var (in case the URL
# has a stale or placeholder password).
TXN_URL=$(printf '%s' "$TXN_URL" \
| sed -E "s|://${USER}[^@]*@|://|; s|://([^:]*):[^@]*@|://\1:${SUPABASE_DB_PASSWORD}@|; s|://([^:@]*)@|://postgres:${SUPABASE_DB_PASSWORD}@|")
# Safety net: if the URL still has no password, append it.
if printf '%s' "$TXN_URL" | grep -qv ':[^:@]*@'; then
TXN_URL=$(printf '%s' "$TXN_URL" \
| sed -E "s|://([^@/]+)@|://postgres:${SUPABASE_DB_PASSWORD}@|")
fi
echo "Connecting to transaction-mode pooler:"
echo "$TXN_URL" | sed -E 's|://[^@]*@|://***@|'
echo
NUM_QUERIES=20
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
# --------------------------------------------------------------------
# Launch 20 concurrent one-shot queries through the transaction pooler.
# Each query runs in its own short-lived psql process — exactly what
# serverless workers do.
# --------------------------------------------------------------------
for i in $(seq 1 "$NUM_QUERIES"); do
(
psql "$TXN_URL" \
-v ON_ERROR_STOP=1 \
-t -A -c "SELECT pg_backend_pid();" \
> "$TMPDIR/out_$i.txt" 2> "$TMPDIR/err_$i.txt"
) &
done
# Wait for all background jobs and collect statuses.
FAIL=0
wait_count=0
for pid in $(jobs -p); do
if ! wait "$pid"; then
FAIL=$((FAIL + 1))
fi
wait_count=$((wait_count + 1))
done
SUCCESS=$((NUM_QUERIES - FAIL))
if [ "$SUCCESS" -eq "$NUM_QUERIES" ]; then
echo "POOL OK ${SUCCESS}/${NUM_QUERIES}"
exit 0
else
echo "POOL FAIL ${SUCCESS}/${NUM_QUERIES}"
echo "--- error logs ---"
cat "$TMPDIR"/err_*.txt 2>/dev/null || true
exit 1
fi
SCRIPT
chmod +x pool_smoke.sh./pool_smoke.sh
./pool_smoke.sh: line 32: USER: unbound variable
cat > pool_smoke.sh << 'SCRIPT'
#!/usr/bin/env bash
#
# pool_smoke.sh — prove the project's transaction-mode (Supavisor) pooler works
#
# Requirements:
# SUPABASE_DB_URL session-mode pooler URL (port 5432 on pooler host)
# SUPABASE_DB_PASSWORD database password (read from env, never hardcoded)
#
# The script launches 20 concurrent one-shot psql queries, waits for all of
# them, and prints "POOL OK 20/20" only if every one succeeded.
set -euo pipefail
: "${SUPABASE_DB_URL:?SUPABASE_DB_URL must be set}"
: "${SUPABASE_DB_PASSWORD:?SUPABASE_DB_PASSWORD must be set}"
# --------------------------------------------------------------------
# Build the TRANSACTION-MODE connection string.
#
# The env var gives a session-mode URL on port 5432 of the pooler host.
# Supabase's transaction-mode Supavisor pooler listens on port 6543.
# We swap the port to 6543 and inject the password from the environment.
# --------------------------------------------------------------------
# Extract the scheme, userinfo, host, port, and path from the URL.
# Format: postgresql://user:<redacted>@host:port/dbname
BASE_URL="$SUPABASE_DB_URL"
# Replace the port (5432 → 6543). This also handles URLs where the
# port may be different but we want to force 6543.
TXN_URL=$(printf '%s' "$BASE_URL" \
| sed -E 's|:5432/|:6543/|')
# Ensure the password in the URL matches SUPABASE_DB_PASSWORD.
# First strip any existing password, then set it from the env var.
TXN_URL=$(printf '%s' "$TXN_URL" \
| sed -E 's|://([^:@]*):[^@]*@|://\1@|') # strip pass → user@
TXN_URL=$(printf '%s' "$TXN_URL" \
| sed -E "s|://([^@/]+)@|://\1:${SUPABASE_DB_PASSWORD}@|") # inject pass
echo "Connecting to transaction-mode pooler (password hidden):"
printf '%s\n' "$TXN_URL" | sed -E 's|://[^@]*@|://***@|'
echo
NUM_QUERIES=20
TMPDIR_LOCAL=$(mktemp -d)
trap 'rm -rf "$TMPDIR_LOCAL"' EXIT
# --------------------------------------------------------------------
# Launch 20 concurrent one-shot queries through the transaction pooler.
# --------------------------------------------------------------------
for i in $(seq 1 "$NUM_QUERIES"); do
(
psql "$TXN_URL" \
-v ON_ERROR_STOP=1 \
-t -A -c "SELECT pg_backend_pid();" \
> "$TMPDIR_LOCAL/out_$i.txt" 2> "$TMPDIR_LOCAL/err_$i.txt"
) &
done
# Wait for all background jobs and collect failure count.
FAIL=0
for pid in $(jobs -p); do
if ! wait "$pid"; then
FAIL=$((FAIL + 1))
fi
done
SUCCESS=$((NUM_QUERIES - FAIL))
if [ "$SUCCESS" -eq "$NUM_QUERIES" ]; then
echo "POOL OK ${SUCCESS}/${NUM_QUERIES}"
exit 0
else
echo "POOL FAIL ${SUCCESS}/${NUM_QUERIES}"
echo "--- error logs ---"
cat "$TMPDIR_LOCAL"/err_*.txt 2>/dev/null || true
exit 1
fi
SCRIPT
chmod +x pool_smoke.sh./pool_smoke.sh
Connecting to transaction-mode pooler (password hidden): postgresql://***@aws-0-us-east-1.pooler.supabase.com:6543/postgres POOL OK 20/20
cat pool_smoke.sh
#!/usr/bin/env bash
#
# pool_smoke.sh — prove the project's transaction-mode (Supavisor) pooler works
#
# Requirements:
# SUPABASE_DB_URL session-mode pooler URL (port 5432 on pooler host)
# SUPABASE_DB_PASSWORD database password (read from env, never hardcoded)
#
# The script launches 20 concurrent one-shot psql queries, waits for all of
# them, and prints "POOL OK 20/20" only if every one succeeded.
set -euo pipefail
: "${SUPABASE_DB_URL:?SUPABASE_DB_URL must be set}"
: "${SUPABASE_DB_PASSWORD:?SUPABASE_DB_PASSWORD must be set}"
# --------------------------------------------------------------------
# Build the TRANSACTION-MODE connection string.
#
# The env var gives a session-mode URL on port 5432 of the pooler host.
# Supabase's transaction-mode Supavisor pooler listens on port 6543.
# We swap the port to 6543 and inject the password from the environment.
# --------------------------------------------------------------------
# Extract the scheme, userinfo, host, port, and path from the URL.
# Format: postgresql://user:<redacted>@host:port/dbname
BASE_URL="$SUPABASE_DB_URL"
# Replace the port (5432 → 6543). This also handles URLs where the
# port may be different but we want to force 6543.
TXN_URL=$(printf '%s' "$BASE_URL" \
| sed -E 's|:5432/|:6543/|')
# Ensure the password in the URL matches SUPABASE_DB_PASSWORD.
# First strip any existing password, then set it from the env var.
TXN_URL=$(printf '%s' "$TXN_URL" \
| sed -E 's|://([^:@]*):[^@]*@|://\1@|') # strip pass → user@
TXN_URL=$(printf '%s' "$TXN_URL" \
| sed -E "s|://([^@/]+)@|://\1:${SUPABASE_DB_PASSWORD}@|") # inject pass
echo "Connecting to transaction-mode pooler (password hidden):"
printf '%s\n' "$TXN_URL" | sed -E 's|://[^@]*@|://***@|'
echo
NUM_QUERIES=20
TMPDIR_LOCAL=$(mktemp -d)
trap 'rm -rf "$TMPDIR_LOCAL"' EXIT
# --------------------------------------------------------------------
# Launch 20 concurrent one-shot queries through the transaction pooler.
# --------------------------------------------------------------------
for i in $(seq 1 "$NUM_QUERIES"); do
(
psql "$TXN_URL" \
-v ON_ERROR_STOP=1 \
-t -A -c "SELECT pg_backend_pid();" \
> "$TMPDIR_LOCAL/out_$i.txt" 2> "$TMPDIR_LOCAL/err_$i.txt"
) &
done
# Wait for all background jobs and collect failure count.
FAIL=0
for pid in $(jobs -p); do
if ! wait "$pid"; then
FAIL=$((FAIL + 1))
fi
done
SUCCESS=$((NUM_QUERIES - FAIL))
if [ "$SUCCESS" -eq "$NUM_QUERIES" ]; then
echo "POOL OK ${SUCCESS}/${NUM_QUERIES}"
exit 0
else
echo "POOL FAIL ${SUCCESS}/${NUM_QUERIES}"
echo "--- error logs ---"
cat "$TMPDIR_LOCAL"/err_*.txt 2>/dev/null || true
exit 1
fi
1 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