Skip to content

Commit 1c5c005

Browse files
stonks-gitclaude
andcommitted
Show System 1/2 models and escalation stats in dashboard
Status panel now shows both System 1 and System 2 model names, plus escalation statistics (S2 calls, retries, retry successes). Live Feed already tags events as [S1] or [S2]. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d685e49 commit 1c5c005

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/dashboard.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class AgentState:
4848
# Shared with cognitive_loop (same list object)
4949
conversation: list = field(default_factory=list)
5050
exchange_count: int = 0
51+
escalation_stats: dict = field(default_factory=lambda: {"retries": 0, "retry_successes": 0, "escalations": 0})
5152

5253
# SSE broadcast
5354
_sse_subscribers: list = field(default_factory=list)
@@ -143,6 +144,7 @@ async def api_status(request):
143144

144145
if state.config:
145146
data["model"] = state.config.models.system1.model
147+
data["model_s2"] = state.config.models.system2.model if state.config.models.system2 else None
146148

147149
if state.memory:
148150
try:
@@ -153,6 +155,9 @@ async def api_status(request):
153155
if state.attention:
154156
data["attention_queue_size"] = state.attention.queue_size
155157

158+
if state.escalation_stats:
159+
data["escalation"] = state.escalation_stats
160+
156161
if state.bootstrap:
157162
achieved, total = state.bootstrap.progress
158163
data["bootstrap"] = {"achieved": achieved, "total": total}
@@ -693,11 +698,13 @@ def _json_default(obj):
693698
p.replaceChildren();
694699
p.appendChild(mkStat('Agent', d.agent_id || '-'));
695700
p.appendChild(mkStat('Phase', d.phase || '-'));
696-
p.appendChild(mkStat('Model', d.model || '-'));
701+
p.appendChild(mkStat('System 1', d.model || '-'));
702+
p.appendChild(mkStat('System 2', d.model_s2 || '-'));
697703
p.appendChild(mkStat('Memories', d.memory_count));
698704
p.appendChild(mkStat('Conversation', d.conversation_length + ' msgs'));
699705
p.appendChild(mkStat('Exchanges/Flush', d.exchange_count + '/5'));
700706
p.appendChild(mkStat('Attention Queue', d.attention_queue_size));
707+
if (d.escalation) p.appendChild(mkStat('Escalations', 'S2: ' + d.escalation.escalations + ', retries: ' + d.escalation.retries + ' (' + d.escalation.retry_successes + ' ok)'));
701708
if (d.bootstrap) p.appendChild(mkStat('Bootstrap', d.bootstrap.achieved + '/' + d.bootstrap.total));
702709
if (d.gut) {
703710
p.appendChild(mkStat('Gut', d.gut.summary));

src/loop.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# How many exchanges between exit gate flushes
4040
EXIT_GATE_FLUSH_INTERVAL = 5
4141

42-
# Escalation tracking
42+
# Escalation tracking (module-level, shared with dashboard via agent_state)
4343
_escalation_stats = {"retries": 0, "retry_successes": 0, "escalations": 0}
4444

4545

@@ -313,6 +313,10 @@ async def cognitive_loop(config, layers, memory, shutdown_event, input_queue: as
313313
conversation = agent_state.conversation if agent_state else []
314314
exchange_count = 0
315315

316+
# Share escalation stats with dashboard
317+
if agent_state:
318+
agent_state.escalation_stats = _escalation_stats
319+
316320
# Ensure L0/L1 embeddings cached for context assembly
317321
await layers.ensure_embeddings(memory)
318322

0 commit comments

Comments
 (0)