fix: rely on agent executor implementation for stream termination#988
Merged
fix: rely on agent executor implementation for stream termination#988
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the on_message_send and on_message_send_stream methods in the default request handler to adjust how message events trigger loop termination. The changes remove immediate breaks for Message events, relying instead on the AgentExecutor for control flow and error detection. Review feedback suggests adding a conditional break when return_immediately is active to prevent potential hangs and improving the clarity of the added comments regarding terminal task states.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/agent_execution/active_task.py | 95.39% | 96.48% | 🟢 +1.08% |
| src/a2a/server/request_handlers/default_request_handler_v2.py | 92.67% | 92.51% | 🔴 -0.16% |
| Total | 92.61% | 92.65% | 🟢 +0.04% |
Generated by coverage-comment.yml
sokoliva
approved these changes
Apr 20, 2026
This was referenced Apr 20, 2026
ishymko
added a commit
that referenced
this pull request
Apr 20, 2026
🤖 I have created a release *beep* *boop* --- ## [1.0.0](v1.0.0-alpha.3...v1.0.0) (2026-04-20) See the [**v0.3 → v1.0 migration guide**](docs/migrations/v1_0/README.md) and changelog entries for alpha versions below. ### ⚠ BREAKING CHANGES * remove Vertex AI Task Store integration ([#999](#999)) ### Bug Fixes * rely on agent executor implementation for stream termination ([#988](#988)) ([d77cd68](d77cd68)) ### Documentation * add comprehensive v0.3 to v1.0 migration guide ([#987](#987)) ([10dea8b](10dea8b)) ### Miscellaneous Chores * release 1.0.0 ([530ec37](530ec37)) * remove Vertex AI Task Store integration ([#999](#999)) ([7fce2ad](7fce2ad)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Ivan Shymko <ishymko@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
active_task.pyalready contains agent executor behavior validation, do not terminate the stream so that those errors can be raised, tests are updated to cover invalid behavior conditions.