feat(tui-go): health-checks pane

Surface the health subsystem (llama/event-store/disk probes) in the TUI,
mirroring the session-stats pane: ClientMessage.GetHealthChecks ->
ServerMessage.HealthChecks (health.checks, reuses HealthReport) ->
StreamQueries.healthChecks via HealthInspectionService; Go OverlayHealth on
key H + palette 'health checks', pull-based fetch, per-subject status with
degraded loud. Empty/disabled -> visible fallback (no blank/lie). Go+Kotlin
golden tests pin the wire contract field-for-field. Observability spec §4/§3.
This commit is contained in:
2026-06-14 18:57:51 +04:00
parent 09f05549a0
commit fd67a6c68d
13 changed files with 285 additions and 3 deletions
+20
View File
@@ -178,6 +178,8 @@ func (m Model) handleNormalKey(k tea.KeyMsg) (tea.Model, tea.Cmd) {
m.openArtifacts()
case "I":
m.openIdeas()
case "H":
m.openHealth()
case "S":
m.openStats()
case "g":
@@ -444,6 +446,10 @@ func (m Model) handleOverlayKey(k tea.KeyMsg) (tea.Model, tea.Cmd) {
if runeIs(k, "S") {
m.overlay = OverlayNone
}
case OverlayHealth:
if runeIs(k, "H") {
m.overlay = OverlayNone
}
case OverlayIdeas:
switch {
case k.Type == tea.KeyUp || runeIs(k, "k"):
@@ -513,6 +519,17 @@ func (m *Model) openStats() {
m.client.Send(protocol.GetSessionStats(m.selectedID))
}
// openHealth opens the system health-checks pane and fetches the current report.
// Health is system-scoped (not session-scoped), so it opens from anywhere.
func (m *Model) openHealth() {
m.overlay = OverlayHealth
// Always re-fetch and show a loading state: health changes out from under us, so a
// cached report would be stale (TUI spec §2 — render from the fetched report).
m.health = nil
m.healthLoading = true
m.client.Send(protocol.GetHealthChecks())
}
// openModelsOverlay opens the model picker, pre-selecting the resident model.
func (m *Model) openModelsOverlay() {
m.overlay = OverlayModels
@@ -566,6 +583,7 @@ func paletteCommands() []paletteCmd {
{"events", "event inspector", "browse the event stream"},
{"artifacts", "view artifacts", "browse this session's artifacts"},
{"stats", "session stats", "metrics for the selected session"},
{"health", "health checks", "system health probe status"},
{"config", "edit config", "view / change correx settings"},
{"mode", "toggle mode", "switch chat / steering"},
{"cancel", "cancel session", "stop the selected session"},
@@ -605,6 +623,8 @@ func (m Model) execPalette(id string) (tea.Model, tea.Cmd) {
m.openArtifacts()
case "stats":
m.openStats()
case "health":
m.openHealth()
case "config":
m.openConfig()
case "mode":