diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-26 05:10:56 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-26 05:10:56 +0000 |
| commit | b009880307298abea11efad92da2cd955afafe99 (patch) | |
| tree | abcbc11d9808f4fd2abea5f235b71d1e3bc33107 /web/app.js | |
| parent | 5410069ae36bc5df5d7cc950fce5d2c5a251618a (diff) | |
fix: expose drained state in agent status API; fix AgentEvent JSON casing
AgentStatusInfo was missing drained field so UI couldn't show drain lock.
AgentEvent had no JSON tags so ev.agent/event/timestamp were undefined in
the stats timeline. UI now shows "Drain locked" card state with undrain CTA.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'web/app.js')
| -rw-r--r-- | web/app.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2873,7 +2873,7 @@ function renderStatsPanel(tasks, executions, agentData = { agents: [], events: [ for (const ag of agents) { const card = document.createElement('div'); card.className = 'stats-agent-card'; - const statusClass = ag.rate_limited ? 'agent-rate-limited' : 'agent-available'; + const statusClass = ag.drained ? 'agent-drained' : ag.rate_limited ? 'agent-rate-limited' : 'agent-available'; card.classList.add(statusClass); const nameEl = document.createElement('span'); @@ -2882,7 +2882,9 @@ function renderStatsPanel(tasks, executions, agentData = { agents: [], events: [ const statusEl = document.createElement('span'); statusEl.className = 'stats-agent-status'; - if (ag.rate_limited && ag.until) { + if (ag.drained) { + statusEl.textContent = 'Drain locked — needs manual undrain'; + } else if (ag.rate_limited && ag.until) { const untilDate = new Date(ag.until); const minsLeft = Math.max(0, Math.round((untilDate - Date.now()) / 60000)); statusEl.textContent = `Rate limited — ${minsLeft}m remaining`; |
