Skip to content

Commit c181de7

Browse files
committed
fix(client): update rest transport URL construction and integration tests
Signed-off-by: Luca Muscariello <muscariello@ieee.org>
1 parent 38d266a commit c181de7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/a2a/client/transports/rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ async def subscribe(
339339
async with aconnect_sse(
340340
self.httpx_client,
341341
'GET',
342-
f'{self.url}/v1/{request.id}:subscribe',
342+
f'{self.url}/v1/tasks/{request.id}:subscribe',
343343
**modified_kwargs,
344344
) as event_source:
345345
try:

tests/integration/test_client_server_integration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def channel_factory(address: str) -> Channel:
491491
transport = GrpcTransport(channel=channel, agent_card=agent_card)
492492

493493
# Use CancelTaskRequest with name (AIP resource format)
494-
params = CancelTaskRequest(id=CANCEL_TASK_RESPONSE.id)
494+
params = CancelTaskRequest(id=f'tasks/{CANCEL_TASK_RESPONSE.id}')
495495
result = await transport.cancel_task(request=params)
496496

497497
assert result.id == CANCEL_TASK_RESPONSE.id
@@ -556,7 +556,7 @@ def channel_factory(address: str) -> Channel:
556556

557557
# Create CreateTaskPushNotificationConfigRequest with required fields
558558
params = CreateTaskPushNotificationConfigRequest(
559-
task_id='task-callback-123',
559+
task_id='tasks/task-callback-123',
560560
config_id='pnc-abc',
561561
config=CALLBACK_CONFIG.push_notification_config,
562562
)
@@ -631,7 +631,7 @@ def channel_factory(address: str) -> Channel:
631631

632632
# Use GetTaskPushNotificationConfigRequest with name field (resource name)
633633
params = GetTaskPushNotificationConfigRequest(
634-
task_id=CALLBACK_CONFIG.task_id, id=CALLBACK_CONFIG.id
634+
task_id=f'tasks/{CALLBACK_CONFIG.task_id}', id=CALLBACK_CONFIG.id
635635
)
636636
result = await transport.get_task_callback(request=params)
637637

@@ -668,7 +668,7 @@ async def test_http_transport_resubscribe(
668668
handler = transport_setup.handler
669669

670670
# Use SubscribeToTaskRequest with name (AIP resource format)
671-
params = SubscribeToTaskRequest(id=f'tasks/{RESUBSCRIBE_EVENT.task_id}')
671+
params = SubscribeToTaskRequest(id=RESUBSCRIBE_EVENT.task_id)
672672
stream = transport.subscribe(request=params)
673673
first_event = await anext(stream)
674674

0 commit comments

Comments
 (0)