Files
EventHubAiRouter/scripts/explain-logs.sh
T
aleksey a2d238d92e
CI / build-gateway (push) Failing after 16s
CI / sync-config (push) Failing after 0s
feat(agent): hierarchical executor with path resolve, runtime probe, quiet UI
Make Zed Agent closer to Cursor: deterministic DevOps path index, live Traefik
port probe before blind edits, stop-after-edit, and quieter Russian progress.
2026-08-13 11:41:27 +03:00

33 lines
1.4 KiB
Bash

#!/usr/bin/env bash
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
echo "== Spend last 25m =="
PG=$(docker ps -q -f name=ai-router_postgres | head -1)
docker exec -e PGPASSWORD="$POSTGRES_PASSWORD" "$PG" \
psql -U "${POSTGRES_USER:-litellm}" -d "${POSTGRES_DB:-litellm}" -c "
SELECT to_char(\"startTime\", 'HH24:MI:SS') AS t, status,
CASE
WHEN model LIKE '%qwen3.8-max%' THEN 'planner-Max'
WHEN model LIKE '%qwen3-coder%' THEN 'coder-30b'
WHEN model LIKE '%deepseek%' THEN 'DeepSeek'
WHEN model LIKE '%llama%' THEN 'Llama'
ELSE left(model, 40)
END AS role,
total_tokens AS tok, completion_tokens AS out,
coalesce(\"request_duration_ms\",0) AS ms,
left(coalesce(metadata->'error_information'->>'error_message',''), 80) AS er
FROM \"LiteLLM_SpendLogs\"
WHERE \"startTime\" >= now() - interval '25 minutes'
ORDER BY \"startTime\" ASC;
"
echo
echo "== Router agent timeline =="
docker service logs --since 25m --raw ai-router_router 2>&1 \
| grep -iE 'path_index|path_resolve|hierarchical_agent phase|executor forward|executor result|escalate|408|400|rewrite|kickstart|no tool|mid-loop|synth|Выполн|plan' \
| grep -vE 'metrics|health|Waiting for|Application|Uvicorn|Finished server|Started server|Shutting' \
| tail -80
REMOTE