feat: realtime WebSocket layer for live events and streaming logs

- Backend: ConnectionManager, Redis-backed bus with in-process fallback,
  channel authorization, and typed emit helpers wired into workers
  (ai_runtime, sandbox_gateway), workforce/sandbox/billing/audit/error services.
- Frontend: single shared WS client with backoff + heartbeat, RealtimeProvider,
  useLiveChannel/useLiveEvent hooks, live indicators on task detail, manager
  chat, dashboard, traces, sandbox terminal, admin errors, and billing.
- Contracts: WsEvent/WsServerFrame/WsClientFrame types mirroring the port.

All 255 backend tests pass; web typecheck and build pass.
This commit is contained in:
mjalmoudy94
2026-10-13 12:56:36 +03:30
parent afdef4b444
commit f1e5df29ce
31 changed files with 2981 additions and 28 deletions
+13
View File
@@ -255,6 +255,19 @@ async def record_error(
request_id or "-",
fingerprint,
)
# Live push to the platform-owner console. Best-effort like everything here:
# a failed publish must not turn a recorded error into an unrecorded one.
from app.application.ports.realtime import emit_error_recorded
await emit_error_recorded(
error_id=event.id,
kind=event.kind,
message=event.message,
severity=str(severity),
source=str(source),
organization_id=event.organization_id,
)
return event.id