Skip to content

Commit 4706c68

Browse files
committed
use json mode & internal error
1 parent 7af195a commit 4706c68

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/a2a/server/request_handlers/default_request_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ async def on_get_task_push_notification_config(
289289

290290
push_notification_config = await self._push_notifier.get_info(params.id)
291291
if not push_notification_config:
292-
raise ServerError(error=TaskNotFoundError())
292+
raise ServerError(error=InternalError())
293293

294294
return TaskPushNotificationConfig(
295295
taskId=params.id, pushNotificationConfig=push_notification_config

src/a2a/server/tasks/inmemory_push_notifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def send_notification(self, task: Task):
4141

4242
try:
4343
response = await self._client.post(
44-
url, json=task.model_dump(exclude_none=True)
44+
url, json=task.model_dump(mode='json', exclude_none=True)
4545
)
4646
response.raise_for_status()
4747
logger.info(f'Push-notification sent for URL: {url}')

tests/server/request_handlers/test_jsonrpc_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ async def streaming_coro():
527527
json={
528528
'contextId': 'session-xyz',
529529
'id': 'task_123',
530-
'status': {'state': TaskState.submitted},
530+
'status': {'state': 'submitted'},
531531
'type': 'task',
532532
},
533533
),
@@ -542,7 +542,7 @@ async def streaming_coro():
542542
],
543543
'contextId': 'session-xyz',
544544
'id': 'task_123',
545-
'status': {'state': TaskState.submitted},
545+
'status': {'state': 'submitted'},
546546
'type': 'task',
547547
},
548548
),
@@ -557,7 +557,7 @@ async def streaming_coro():
557557
],
558558
'contextId': 'session-xyz',
559559
'id': 'task_123',
560-
'status': {'state': TaskState.completed},
560+
'status': {'state': 'completed'},
561561
'type': 'task',
562562
},
563563
),

0 commit comments

Comments
 (0)