fix: keep current status messages out of task history - #1122
Open
1fanwang wants to merge 2 commits into
Open
Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Signed-off-by: 1fanwang <1fannnw@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches server behavior and includes regression coverage for both supported client models.
Pull request overview
Updates client task reconstruction so only superseded status messages enter task history, aligning current and v0.3 clients with server behavior.
Changes:
- Archives the previous status message when processing an update.
- Keeps the current message exclusively in
Task.status. - Updates tests for both protocol versions.
File summaries
| File | Description |
|---|---|
client/base/.../ClientTaskManager.java |
Corrects current task-history reconstruction. |
client/base/.../ClientTaskManagerTest.java |
Updates status-message lifecycle assertions. |
compat-0.3/client/base/.../ClientTaskManager_v0_3.java |
Applies equivalent v0.3 behavior. |
compat-0.3/client/base/.../ClientTaskManager_v0_3_Test.java |
Adds v0.3 regression coverage. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Description
A streaming client currently puts the active status message in both
Task.status.messageandTask.history. A client that receives the update reconstructs different state from a later subscriber reading the server snapshot.The client now moves only the previous status message into history. This matches the Java server and the Python and Go SDKs. The v0.3 compatibility client uses the same rule.
End-to-end repro
I used the existing stream lifecycle example with this temporary instrumentation:
Before:
After:
CONTRIBUTINGGuide.mvn -pl client/base,compat-0.3/client/base -am test