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 /internal/executor | |
| 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 'internal/executor')
| -rw-r--r-- | internal/executor/executor.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go index 9052bd7..b8979a1 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -626,6 +626,7 @@ type AgentStatusInfo struct { ActiveTasks int `json:"active_tasks"` RateLimited bool `json:"rate_limited"` Until *time.Time `json:"until,omitempty"` + Drained bool `json:"drained"` } // AgentStatuses returns the current status of all registered agents. @@ -638,6 +639,7 @@ func (p *Pool) AgentStatuses() []AgentStatusInfo { info := AgentStatusInfo{ Agent: agent, ActiveTasks: p.activePerAgent[agent], + Drained: p.drained[agent], } if deadline, ok := p.rateLimited[agent]; ok && now.Before(deadline) { info.RateLimited = true |
