mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
Every visit to /insights or any sub-route used to fire POST /api/insights/generate from InsightsLayoutShell. The mutation returned null on 422 (no provider configured) so the UI degraded gracefully, but the server kept absorbing the call on every cold mount and the dev-server logs filled with '422 Unprocessable Entity'. Read the operator's assistant flag matrix from /api/feature-flags (already cached server-side at 60s, client-side under the shared ['feature-flags'] query key) and skip the mutation entirely when 'enabled' or 'briefing' is false. The fail-open default in useFeatureFlags means a flags-endpoint hiccup still renders the advisor — the gate only takes effect when the operator has explicitly turned the surface off. Also update the per-metric InsightStatusCard's empty-state copy from the diagnostic 'KI-Provider nicht konfiguriert' / 'AI provider not configured' to the neutral 'Auswertung nicht verfügbar' / 'Assessment unavailable'. The diagnostic phrasing read as a setup failure even though the surface degrades cleanly; the neutral phrasing matches the rest of the empty-state language. Per .planning/round-v1433-audit-runtime.md F18.