fix(a2a): start a new task after a terminal task state#960
Open
radugheo wants to merge 1 commit into
Open
Conversation
An A2A task in a terminal state (completed/canceled/failed/rejected) is immutable, and a spec-compliant server rejects any further message that references its task_id. The A2A tool persisted the returned task_id unconditionally, so once a task completed the next turn reused it and the remote call was rejected. Clear the stored task_id when the task reaches a terminal state, keeping the context_id so the next message starts a fresh task in the same conversation.
There was a problem hiding this comment.
Pull request overview
This PR updates the A2A tool’s conversation persistence logic so that once a remote task reaches a terminal state (completed/canceled/failed/rejected), the stored task_id is cleared while context_id is retained—ensuring the next turn starts a fresh task within the same conversation context and avoids server rejections for “terminal task” reuse.
Changes:
- Clear
task_idin tool state persistence when the returnedtask_stateis terminal, while keepingcontext_id. - Add regression tests covering both terminal (
completed) and non-terminal (input_required) task states. - Bump package version to
0.13.19(including lockfile update).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/uipath_langchain/agent/tools/a2a/a2a_tool.py |
Adds terminal-state detection and clears persisted task_id after terminal task completion while preserving context_id. |
tests/agent/tools/test_a2a_tool.py |
Adds regression tests asserting task_id is dropped for terminal states and retained for non-terminal states. |
pyproject.toml |
Bumps project version to 0.13.19. |
uv.lock |
Updates locked package version to 0.13.19 to match CI’s uv sync --locked behavior. |
|
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.



task_idand start a new task on the next call, keepingcontext_idso the conversation continues.Task ... is in terminal state).task_idcleared on a terminal state, kept on a non-terminal one (input-required).