fix: derive agent phase from container status in runtime List methods#124
Conversation
The podman, docker, and apple container runtimes all hardcoded Phase: "created" for every container returned by List(), relying on AgentManager to override it from agent-info.json. When the Claude harness overwrites agent-info.json with only the activity field (dropping the phase), the next heartbeat falls back to the hardcoded "created" and the hub overwrites the correct "running" phase. Derive the phase from the container status string instead: "Up ..." → running, "Exited ..." → stopped, anything else → created. This matches the hub's own legacy heartbeat derivation logic and makes the heartbeat resilient to incomplete agent-info.json data.
PR #124 Review: fix: derive agent phase from container status in runtime List methodsExecutive SummaryLow risk. This is a small, well-scoped bug fix that replaces hardcoded Critical IssuesNone. Observations1. Slight behavioral divergence from hub logic (Minor)Location: The hub's legacy path (handlers.go:5286-5292) treats This is likely intentional and correct for the Severity: Informational — no action needed. 2. No unit tests for
|
Summary
Phase: "created"for all containers inList()agent-info.jsonloses its phase field (e.g. harness overwrites it with only the activity), the heartbeat sendscreatedto the hub, reverting running agentsUp ...→running,Exited ...→stopped, elsecreatedpkg/hub/handlers.go:5280-5293Fixes #123
Test plan
runningagent-info.json)runningthrough subsequent heartbeatsstopped