#!/usr/bin/env bash # Hotfix: quiet progress + executor timeout/escalate set -euo pipefail AIR=/mnt/c/Users/alexc/IdeaProjects/eventHub/EventHubAiRouter cd "$AIR" python3 -m py_compile router/hierarchical.py router/agent_stream.py router/router.py router/agent_hier.py python3 -m unittest discover -s test/unit -q PRIMARY_PROVIDER=hybrid LITELLM_MODEL_TIMEOUT=180 python3 scripts/gen-litellm-config.py scp router/hierarchical.py router/agent_stream.py router/router.py router/agent_hier.py \ eventhub-ift:/opt/ai-router-stack/router/ scp config/orchestration.yaml eventhub-ift:/opt/ai-router-stack/config/ scp litellm_config.yaml eventhub-ift:/opt/ai-router-stack/litellm_config.yaml ssh -o BatchMode=yes eventhub-ift bash -s <<'REMOTE' set -euo pipefail cd /opt/ai-router-stack set -a; source .env; set +a sed -i 's/\r$//' router/*.py config/orchestration.yaml litellm_config.yaml || true docker build -f router/Dockerfile -t "${ROUTER_IMAGE:-git.sabilin.com/eventhub/ai-router-gateway:ift}" . TS=$(date +%Y%m%d%H%M%S) ORCH="orchestration_config_${TS}" LITC="litellm_config_${TS}" docker config create "$ORCH" ./config/orchestration.yaml docker config create "$LITC" ./litellm_config.yaml OLD_ORCH=$(docker service inspect ai-router_router --format '{{range .Spec.TaskTemplate.ContainerSpec.Configs}}{{println .ConfigName}}{{end}}' | grep orchestration | tail -1 || true) OLD_LIT=$(docker service inspect ai-router_litellm --format '{{range .Spec.TaskTemplate.ContainerSpec.Configs}}{{println .ConfigName}}{{end}}' | grep litellm_config | grep -v entrypoint | tail -1 || true) RARGS=(--image "${ROUTER_IMAGE:-git.sabilin.com/eventhub/ai-router-gateway:ift}" --force) RARGS+=(--config-add "source=${ORCH},target=/app/config/orchestration.yaml") [[ -n "${OLD_ORCH:-}" ]] && RARGS+=(--config-rm "$OLD_ORCH") docker service update "${RARGS[@]}" ai-router_router >/dev/null LARGS=(--force --config-add "source=${LITC},target=/app/config.yaml") [[ -n "${OLD_LIT:-}" ]] && LARGS+=(--config-rm "$OLD_LIT") docker service update "${LARGS[@]}" ai-router_litellm >/dev/null for i in $(seq 1 50); do curl -sf --max-time 5 https://ai-router.ift.calentiq.com/health >/dev/null && \ curl -sf --max-time 5 https://litellm.ift.calentiq.com/health/liveliness >/dev/null && break sleep 3 done RID=$(docker ps -q -f name=ai-router_router | head -1) LID=$(docker ps -q -f name=ai-router_litellm | head -1) docker exec "$RID" grep -E 'progress_verbose|executor_timeout|executor_midloop_escalate|show_context_fill' /app/config/orchestration.yaml docker exec "$LID" sh -c 'grep -A5 "model_name: a-medium-code" /app/config.yaml | head -8' echo QUIET_PROGRESS_TIMEOUT_OK REMOTE