a2d238d92e
Make Zed Agent closer to Cursor: deterministic DevOps path index, live Traefik port probe before blind edits, stop-after-edit, and quieter Russian progress.
37 lines
1.1 KiB
Bash
37 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# Explain + delete spurious LiteLLM failure logs from restart disconnects
|
|
set -euo pipefail
|
|
ssh -o BatchMode=yes eventhub-ift bash -s <<'REMOTE'
|
|
set -euo pipefail
|
|
cd /opt/ai-router-stack
|
|
set -a; source .env; set +a
|
|
PG=$(docker ps -q -f name=ai-router_postgres | head -1)
|
|
USER="${POSTGRES_USER:-litellm}"
|
|
DB="${POSTGRES_DB:-litellm}"
|
|
|
|
echo "== Error message sample =="
|
|
docker exec -e PGPASSWORD="$POSTGRES_PASSWORD" "$PG" \
|
|
psql -U "$USER" -d "$DB" -t -A -c "
|
|
SELECT left(metadata->'error_information'->>'error_message', 200)
|
|
FROM \"LiteLLM_SpendLogs\"
|
|
WHERE status='failure'
|
|
LIMIT 3;
|
|
"
|
|
|
|
echo "== Delete empty-model restart failures =="
|
|
docker exec -e PGPASSWORD="$POSTGRES_PASSWORD" "$PG" \
|
|
psql -U "$USER" -d "$DB" -c "
|
|
DELETE FROM \"LiteLLM_SpendLogs\"
|
|
WHERE status = 'failure'
|
|
AND (model IS NULL OR model = '')
|
|
AND (call_type IS NULL OR call_type = '');
|
|
"
|
|
|
|
echo "== Remaining =="
|
|
docker exec -e PGPASSWORD="$POSTGRES_PASSWORD" "$PG" \
|
|
psql -U "$USER" -d "$DB" -c "
|
|
SELECT status, count(*) FROM \"LiteLLM_SpendLogs\" GROUP BY 1;
|
|
"
|
|
echo CLEANED_SPURIOUS_FAILS_OK
|
|
REMOTE
|