summaryrefslogtreecommitdiff
path: root/web/app.js
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-26 05:10:56 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-26 05:10:56 +0000
commitb009880307298abea11efad92da2cd955afafe99 (patch)
treeabcbc11d9808f4fd2abea5f235b71d1e3bc33107 /web/app.js
parent5410069ae36bc5df5d7cc950fce5d2c5a251618a (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.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/app.js b/web/app.js
index 25bdee6..c87c609 100644
--- a/web/app.js
+++ b/web/app.js
@@ -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`;