Performance: - SSE dashboard streaming endpoint (GET /v1/admin/status/stream) - Web Worker for markdown rendering (offload from main thread) - IndexedDB chat persistence (replace localStorage, 500msg support) Security: - CSRF protection middleware (Origin/Referer validation) - Content Security Policy + security headers middleware - API key rotation endpoint (POST /v1/admin/keys/rotate) Observability: - OpenTelemetry tracing with graceful NoOp fallback - Structured error codes (FAGI-xxxx taxonomy with ErrorResponse schema) - Audit log export (CSV + JSON at /v1/admin/audit/export/*) Features: - Multi-session management hook (parallel conversations) - Conversation export (markdown/JSON/text download + clipboard) - Head customization UI (enable/disable + weight sliders for 12 heads) Infrastructure: - Kubernetes Helm chart (Deployment, Service, HPA, Ingress) - Database migration versioning (generate, verify commands) - Blue-green deployment manifests (color-based traffic switching) Tests: 598 Python + 56 frontend = 654 total, 0 ruff errors Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>
21 lines
669 B
Python
21 lines
669 B
Python
"""Tests for SSE dashboard streaming endpoint."""
|
|
|
|
from fusionagi.api.routes.dashboard_sse import _get_system_snapshot
|
|
|
|
|
|
def test_system_snapshot_format():
|
|
"""Snapshot should contain all expected fields."""
|
|
snapshot = _get_system_snapshot()
|
|
assert snapshot["status"] == "healthy"
|
|
assert "uptime_seconds" in snapshot
|
|
assert "active_agents" in snapshot
|
|
assert "memory_usage_mb" in snapshot
|
|
assert "timestamp" in snapshot
|
|
assert isinstance(snapshot["timestamp"], float)
|
|
|
|
|
|
def test_system_snapshot_memory():
|
|
"""Memory usage should be a positive number."""
|
|
snapshot = _get_system_snapshot()
|
|
assert snapshot["memory_usage_mb"] > 0
|