Overview
The dashboard currently polls for run status. We need a WebSocket endpoint so the frontend can receive real-time push updates when a prediction job completes or fails.
Scope
Acceptance Criteria
- Opening a WebSocket connection to
/ws/runs/{run_id} receives status updates in real time
- Frontend replaces polling with WebSocket when supported
- Connection gracefully degrades to polling if WebSocket is unavailable
- All changes covered by at least basic tests
Resources
Difficulty: Intermediate
Labels: help wanted, backend, frontend, real-time
Overview
The dashboard currently polls for run status. We need a WebSocket endpoint so the frontend can receive real-time push updates when a prediction job completes or fails.
Scope
/ws/runs/{run_id}WebSocket endpoint in FastAPIrunning→completed/failedcompleted/failedeventuseRunPollinghook to prefer WebSocket, falling back to pollingNewAnalysisandRunHistorypages to listen for WebSocket eventsAcceptance Criteria
/ws/runs/{run_id}receives status updates in real timeResources
src/climatevision/api/main.py— existing FastAPI appfrontend/src/— React dashboardteam_docs/PM_ROLE_UPDATES_FOR_GAPS.md— gap [Good First Issue] Add frontend unit tests with Vitest + React Testing Library #9 detailsDifficulty: Intermediate
Labels:
help wanted,backend,frontend,real-time