From eaeaa1f24d118cf201a6b189fb9239cea56dafdc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Boschi?=
Date: Mon, 2 Mar 2026 11:20:19 +0100
Subject: [PATCH] fix(control-plane): observations count always showing 0 due
to wrong field name (#464)
The BankStats interface used total_mental_models but the API returns
total_observations, causing the Observations card to always display 0.
---
.../src/components/bank-profile-view.tsx | 6 +++---
hindsight-control-plane/src/components/bank-stats-view.tsx | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hindsight-control-plane/src/components/bank-profile-view.tsx b/hindsight-control-plane/src/components/bank-profile-view.tsx
index bdcc737d..93e2f6fe 100644
--- a/hindsight-control-plane/src/components/bank-profile-view.tsx
+++ b/hindsight-control-plane/src/components/bank-profile-view.tsx
@@ -100,7 +100,7 @@ interface BankStats {
// Consolidation stats
last_consolidated_at: string | null;
pending_consolidation: number;
- total_mental_models: number;
+ total_observations: number;
}
interface Operation {
@@ -607,8 +607,8 @@ export function BankProfileView({ hideReflectFields = false }: { hideReflectFiel
This will delete all consolidated knowledge. Observations will be regenerated the
next time consolidation runs.
- {stats && stats.total_mental_models > 0 && (
- This will delete {stats.total_mental_models} observations.
+ {stats && stats.total_observations > 0 && (
+ This will delete {stats.total_observations} observations.
)}
diff --git a/hindsight-control-plane/src/components/bank-stats-view.tsx b/hindsight-control-plane/src/components/bank-stats-view.tsx
index dbc79ab1..bfca2f49 100644
--- a/hindsight-control-plane/src/components/bank-stats-view.tsx
+++ b/hindsight-control-plane/src/components/bank-stats-view.tsx
@@ -26,7 +26,7 @@ interface BankStats {
failed_operations: number;
last_consolidated_at: string | null;
pending_consolidation: number;
- total_mental_models: number;
+ total_observations: number;
}
export function BankStatsView() {
@@ -183,7 +183,7 @@ export function BankStatsView() {
observationsEnabled ? "text-amber-600 dark:text-amber-400" : "text-muted-foreground"
}`}
>
- {observationsEnabled ? stats.total_mental_models || 0 : "—"}
+ {observationsEnabled ? stats.total_observations || 0 : "—"}