fix: refresh idle ActiveTask snapshots on reuse - #1189
Open
KirschBluteX wants to merge 5 commits into
Open
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/agent_execution/active_task.py | 95.18% | 96.01% | 🟢 +0.83% |
| src/a2a/server/agent_execution/active_task_registry.py | 97.01% | 96.00% | 🔴 -1.01% |
| src/a2a/server/events/event_queue_v2.py | 91.79% | 92.27% | 🟢 +0.48% |
| src/a2a/server/request_handlers/default_request_handler_v2.py | 94.25% | 94.14% | 🔴 -0.11% |
| src/a2a/utils/telemetry.py | 90.70% | 91.47% | 🟢 +0.78% |
| Total | 93.12% | 93.18% | 🟢 +0.07% |
Generated by coverage-comment.yml
…tive-task # Conflicts: # src/a2a/server/agent_execution/active_task_registry.py # tests/server/agent_execution/test_active_task_registry.py
Author
|
Hi @a2aproject/google-a2a-eng, I have resolved the merge conflict with the latest main and pushed commit 2509967. The PR checks are green, including the Python 3.10–3.14 tests and install smoke tests. The fix refreshes an idle ActiveTask snapshot at the next request boundary while leaving in-flight streaming and artifact appends untouched. Could someone from the team take a look when you have a chance? Thanks. |
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.
Summary
ActiveTasksnapshot only when an actual new request enters an idle task boundary.Root cause
ActiveTaskRegistryretained anActiveTaskacrossinput_requiredinterruptions. ItsTaskManagertherefore reused an old_current_tasksnapshot even after another server replica persisted newer artifacts, history, and status to the sharedTaskStore. The next request could save that stale snapshot and silently overwrite the newer state.The registry now asks an existing
ActiveTaskto invalidate its cached task only at a real request boundary while its reference count is idle (<= 1), under the task lifecycle lock. Active subscribers and streaming requests are not refreshed mid-stream, and concurrent close/reuse paths share the same synchronization boundary.Tests
Fixes #1188