Repository navigation
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/tasks/task_updater.py | 94.83% | 98.31% | 🟢 +3.48% |
| Total | 92.96% | 92.98% | 🟢 +0.02% |
Generated by coverage-comment.yml
Iwaniukooo11
requested changes
Oct 23, 2026
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_message_validation_failure_allows_terminal_retry( |
Member
There was a problem hiding this comment.
Please remove, it follows same path as test_timestamp_validation_failure_allows_terminal_retry, so it doesen't add useful coverage
Author
There was a problem hiding this comment.
Thanks for the review! Removed both tests and the unused import.
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_legacy_partial_publish_cancellation_keeps_terminal_guard() -> ( |
Member
There was a problem hiding this comment.
This test passes on main too, so it doesn't cover the change introduced here. Please remove it.
This branch has not been deployed
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.
Problem
TaskUpdater.update_status()sets the terminal flag before constructing the status event. An invalid timestamp, message, or metadata can then raise an exception before anything reaches the queue.For example, after a
COMPLETEDupdate with an invalid timestamp, callingfailed()to report the error raises aRuntimeErrorsaying the task is already terminal. The updater never published the completion event.Fix
Construct the complete
TaskStatusUpdateEventbefore setting the terminal flag, so a construction error leaves the updater able to report a failure. The flag is still set under the existing lock, before enqueueing.Tests
DefaultRequestHandlerV2returns and stores aFAILEDtask after the agent catches a status validation error.Local validation on Python 3.10:
./scripts/lint.shpasses (Ruff, formatting, and ty).UV_OFFLINE=1 uv run pytest --cov=a2a --cov-report=term --cov-fail-under=88: 2,312 passed, 183 skipped, 3 xfailed, 1 xpassed, with 92.95% coverage.The 183 skips are 182 PostgreSQL/MySQL tests without configured test databases and one SQLite row-lock test. The existing xfail/xpass cases reference #869. The first online runs hit the cross-version fixture's three-second startup timeout while uv downloaded or resolved legacy SDK dependencies; the full run passes with those dependencies cached and offline mode enabled.
GitHub CI for the updated commit is pending.