mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
send_message took the responder identity from a client-supplied metadata.from_agent, so any caller could spoof anyone (e.g. from_agent='ceo') in the task's notes and in the spawn/notification routed back to the original requester. Stamp the authenticated caller's slug as the responder instead (CurrentAgentContext). cancel_task was ungated: no auth dependency and no role check, so any agent (or any caller) could cancel a task the lifecycle rule reserves to PM roles (Any -> cancelled: PM roles only) — and the cascade-cancel of all non-terminal descendants ran with a hardcoded cell_pm role and no recorded actor. Add require_any_authenticated_agent + a PM-or-above gate, and thread the authenticated role (into the cascade role gate) and slug (into the cancellation note) into A2AService.cancel_task. Tests: send_message ignores a spoofed from_agent and records the authenticated slug; cancel rejects a developer (403) and a missing auth header; a PM cancel threads role + slug into the service; the pre-existing cancel success/already-terminal/not-found tests now run under a PM context (the success test's body was missing the A2A 'name' field and false-passed on a 422 — now genuine).