Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ sagemaker = [
]

a2a = [
"a2a-sdk>=0.2.16,<1.0.0",
"a2a-sdk[sql]>=0.2.11,<1.0.0",
"a2a-sdk>=0.3.0,<0.4.0",
"a2a-sdk[sql]>=0.3.0,<0.4.0",
"uvicorn>=0.34.2,<1.0.0",
"httpx>=0.28.1,<1.0.0",
"fastapi>=0.115.12,<1.0.0",
Expand Down Expand Up @@ -143,7 +143,7 @@ all = [
"opentelemetry-exporter-otlp-proto-http>=1.30.0,<2.0.0",

# a2a
"a2a-sdk[sql]>=0.2.11,<1.0.0",
"a2a-sdk[sql]>=0.3.0,<0.4.0",
"uvicorn>=0.34.2,<1.0.0",
"httpx>=0.28.1,<1.0.0",
"fastapi>=0.115.12,<1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/strands/multiagent/a2a/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def execute(
task = new_task(context.message) # type: ignore
await event_queue.enqueue_event(task)

updater = TaskUpdater(event_queue, task.id, task.contextId)
updater = TaskUpdater(event_queue, task.id, task.context_id)

try:
await self._execute_streaming(context, updater)
Expand Down
16 changes: 8 additions & 8 deletions tests/strands/multiagent/a2a/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -65,7 +65,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -95,7 +95,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -125,7 +125,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -156,7 +156,7 @@ async def mock_stream(user_input):
mock_request_context.current_task = None

with patch("strands.multiagent.a2a.executor.new_task") as mock_new_task:
mock_new_task.return_value = MagicMock(id="new-task-id", contextId="new-context-id")
mock_new_task.return_value = MagicMock(id="new-task-id", context_id="new-context-id")

await executor.execute(mock_request_context, mock_event_queue)

Expand All @@ -180,7 +180,7 @@ async def test_execute_streaming_mode_handles_agent_exception(
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

with pytest.raises(ServerError):
Expand Down Expand Up @@ -210,7 +210,7 @@ async def test_handle_agent_result_with_none_result(mock_strands_agent, mock_req
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

# Mock TaskUpdater
Expand All @@ -235,7 +235,7 @@ async def test_handle_agent_result_with_result_but_no_message(
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

# Mock TaskUpdater
Expand Down
4 changes: 2 additions & 2 deletions tests/strands/multiagent/a2a/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def test_public_agent_card(mock_strands_agent):
assert card.description == "A test agent for unit testing"
assert card.url == "http://0.0.0.0:9000/"
assert card.version == "0.0.1"
assert card.defaultInputModes == ["text"]
assert card.defaultOutputModes == ["text"]
assert card.default_input_modes == ["text"]
assert card.default_output_modes == ["text"]
assert card.skills == []
assert card.capabilities == a2a_agent.capabilities

Expand Down
Loading