Bug
Dashboard Token Savings at http://localhost:3113/#dashboard always shows 0% (~0 tokens), regardless of how many sessions have run.
Root Cause
In renderDashboard(), the injection token estimate uses d.sessions.length which counts all sessions — including completed ones that are no longer injecting context:
var estInjected = d.sessions.length * tokenBudget; // BUG: 110 sessions → 220,000
The variable activeSessions is already computed earlier in the same function:
var activeSessions = d.sessions.filter(function(s) { return s.status === 'active'; }).length;
Fix (one line)
- var estInjected = d.sessions.length * tokenBudget;
+ var estInjected = activeSessions * tokenBudget;
Real-world reproduction (v0.9.27, zero-LLM mode)
110 sessions total, 2 active, 108 completed, 1,533 observations:
|
Buggy |
Fixed |
| estFull |
122,640 |
122,640 |
| estInjected |
220,000 |
4,000 |
| Savings |
-84% → clamped to 0% |
97% |
| Tokens saved |
0 |
~118,720 |
Environment
- agentmemory v0.9.27
- Zero-LLM mode (BM25 + local embeddings)
- Windows 11 Pro
Bug
Dashboard Token Savings at
http://localhost:3113/#dashboardalways shows 0% (~0 tokens), regardless of how many sessions have run.Root Cause
In
renderDashboard(), the injection token estimate usesd.sessions.lengthwhich counts all sessions — including completed ones that are no longer injecting context:The variable
activeSessionsis already computed earlier in the same function:Fix (one line)
Real-world reproduction (v0.9.27, zero-LLM mode)
110 sessions total, 2 active, 108 completed, 1,533 observations:
Environment