Files
HarborForge.Backend/app/api
hzhang 778a6c392a fix(calendar): read agent status by agent_id alone (cross-agent gate)
GET /calendar/agent/status went through _require_agent, which filters by
agent_id AND claw_identifier. But this is a cross-agent READ — the caller asks
about a DIFFERENT agent and passes its OWN X-Claw-Identifier (the CLI falls
back to hostname). So the query required target.claw == caller's-hostname and
spuriously 404'd whenever they differed: `hf agent status-of <other>` worked
only when the caller's host happened to equal the target's registered claw
(e.g. fine on the node whose hostname matched, 404 everywhere else). This broke
the delegate-task / on-call-handoff status gates.

Look the agent up by agent_id alone for the read; accept but ignore
X-Claw-Identifier (now optional). The POST (write own status) still identifies
the caller by agent_id + claw via _require_agent.

Verified: `hf agent status-of <agent>` now returns {agent_id, status} from any
caller/host; unknown agent still 404s.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 09:30:02 +01:00
..