test: add more scenarios to test_end_to_end#954
Conversation
Based on https://a2a-protocol.org/latest/specification/#312-send-streaming-message: 1. `Message` based flow. 2. Emit `Task` as a first event. WIP: switches to the old request handler as there are known issues in the new one.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/client/base_client.py | 92.59% | 95.56% | 🟢 +2.96% |
| src/a2a/server/agent_execution/active_task.py | 93.40% | 94.06% | 🟢 +0.66% |
| src/a2a/server/request_handlers/default_request_handler.py | 97.82% | 98.13% | 🟢 +0.31% |
| src/a2a/server/tasks/task_manager.py | 97.44% | 98.29% | 🟢 +0.85% |
| Total | 92.23% | 92.33% | 🟢 +0.09% |
Generated by coverage-comment.yml
There was a problem hiding this comment.
Code Review
This pull request refactors the MockAgentExecutor to support direct message responses without creating a task, and updates the task creation and status update logic. It introduces a LegacyRequestHandler and adjusts imports accordingly. Existing end-to-end tests were updated to align with the new task event structure and the removal of the explicit 'task submitted' message from the history. Additionally, new end-to-end tests were added to cover the direct message response functionality across different client configurations (blocking, streaming, and return_immediately). The review suggests combining the newly added direct message tests into a single parameterized test to improve maintainability and reduce code duplication, referencing a style guide rule about test class definition.
Based on https://a2a-protocol.org/latest/specification/#312-send-streaming-message:
Messagebased flow.Taskas a first event.TODO: switches to the old request handler as there are known issues in the new one
With a new handler failures are caused by
Taskevents are not streamedreturn_immediately+ direct message - V2 returns a phantomTaskbefore the executor produces itsMessage