diff --git a/workspace-template/a2a_client.py b/workspace-template/a2a_client.py index 15038bce..0ae6dd28 100644 --- a/workspace-template/a2a_client.py +++ b/workspace-template/a2a_client.py @@ -52,6 +52,7 @@ async def send_a2a_message(target_url: str, message: str) -> str: try: resp = await client.post( target_url, + headers=auth_headers(), json={ "jsonrpc": "2.0", "id": str(uuid.uuid4()), diff --git a/workspace-template/a2a_tools.py b/workspace-template/a2a_tools.py index 5612b61c..6ba37a08 100644 --- a/workspace-template/a2a_tools.py +++ b/workspace-template/a2a_tools.py @@ -52,6 +52,7 @@ async def report_activity( await client.post( f"{PLATFORM_URL}/workspaces/{WORKSPACE_ID}/activity", json=payload, + headers=_auth_headers_for_heartbeat(), ) # Also push current_task via heartbeat for canvas card display if summary: @@ -127,6 +128,7 @@ async def tool_delegate_task_async(workspace_id: str, task: str) -> str: resp = await client.post( f"{PLATFORM_URL}/workspaces/{WORKSPACE_ID}/delegate", json={"target_id": workspace_id, "task": task}, + headers=_auth_headers_for_heartbeat(), ) if resp.status_code == 202: data = resp.json() @@ -151,7 +153,10 @@ async def tool_check_task_status(workspace_id: str, task_id: str) -> str: """ try: async with httpx.AsyncClient(timeout=10.0) as client: - resp = await client.get(f"{PLATFORM_URL}/workspaces/{WORKSPACE_ID}/delegations") + resp = await client.get( + f"{PLATFORM_URL}/workspaces/{WORKSPACE_ID}/delegations", + headers=_auth_headers_for_heartbeat(), + ) if resp.status_code != 200: return f"Error: failed to check delegations ({resp.status_code})" delegations = resp.json() @@ -185,6 +190,7 @@ async def tool_send_message_to_user(message: str) -> str: resp = await client.post( f"{PLATFORM_URL}/workspaces/{WORKSPACE_ID}/notify", json={"message": message}, + headers=_auth_headers_for_heartbeat(), ) if resp.status_code == 200: return "Message sent to user"