From b009880307298abea11efad92da2cd955afafe99 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 26 Mar 2026 05:10:56 +0000 Subject: 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 --- internal/storage/db.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/storage/db.go') diff --git a/internal/storage/db.go b/internal/storage/db.go index 24a6cd3..ee5ee77 100644 --- a/internal/storage/db.go +++ b/internal/storage/db.go @@ -1031,12 +1031,12 @@ func (s *DB) SetSetting(key, value string) error { // AgentEvent records a rate-limit state change for an agent. type AgentEvent struct { - ID string - Agent string - Event string // "rate_limited" | "available" - Timestamp time.Time - Until *time.Time // non-nil for "rate_limited" events - Reason string // "transient" | "quota" + ID string `json:"id"` + Agent string `json:"agent"` + Event string `json:"event"` // "rate_limited" | "available" + Timestamp time.Time `json:"timestamp"` + Until *time.Time `json:"until,omitempty"` // non-nil for "rate_limited" events + Reason string `json:"reason"` // "transient" | "quota" } // RecordAgentEvent inserts an agent rate-limit event. -- cgit v1.2.3