diff --git a/backend/routers/dashboard.py b/backend/routers/dashboard.py index 466d286..4f9b6a2 100644 --- a/backend/routers/dashboard.py +++ b/backend/routers/dashboard.py @@ -1,7 +1,10 @@ """Dashboard aggregation endpoint (fleet-wide cockpit data).""" from __future__ import annotations -from fastapi import APIRouter, Depends +import logging +import traceback + +from fastapi import APIRouter, Depends, HTTPException from sqlmodel import Session from auth import get_current_user @@ -9,6 +12,8 @@ from database import get_session from models.user import User from services import dashboard_service +logger = logging.getLogger("stackpilot.dashboard") + router = APIRouter(prefix="/api/dashboard", tags=["dashboard"]) @@ -20,4 +25,15 @@ async def fleet( ) -> dict: """Fleet-wide 'needs attention' list, KPIs and per-host rollup across the local host and every agent — the data behind the operator cockpit.""" - return await dashboard_service.compute_fleet(session, refresh=refresh) + try: + return await dashboard_service.compute_fleet(session, refresh=refresh) + except Exception as exc: # noqa: BLE001 — surface the real cause for diagnosis + logger.exception("compute_fleet failed") + # Deepest frame pinpoints where it broke; safe to expose to the + # authenticated user and it makes the dashboard error banner actionable. + tb = traceback.extract_tb(exc.__traceback__) + where = f" at {tb[-1].filename.split('/')[-1]}:{tb[-1].lineno}" if tb else "" + raise HTTPException( + status_code=500, + detail=f"{type(exc).__name__}: {exc}{where}", + ) from exc diff --git a/backend/version.py b/backend/version.py index 1b3e05a..7833fbb 100644 --- a/backend/version.py +++ b/backend/version.py @@ -1,3 +1,3 @@ """Single source of truth for the StackPilot release version.""" -APP_VERSION = "0.38.1" +APP_VERSION = "0.38.2" diff --git a/frontend/package.json b/frontend/package.json index 3ed346d..28acc4b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "stackpilot-frontend", "private": true, - "version": "0.38.1", + "version": "0.38.2", "type": "module", "scripts": { "dev": "vite",