fix(server-common): keep task streams open after messages - #1060
Open
dangzitou wants to merge 1 commit into
Open
fix(server-common): keep task streams open after messages#1060dangzitou wants to merge 1 commit into
dangzitou wants to merge 1 commit into
Conversation
dangzitou
marked this pull request as ready for review
August 12, 2026 19:54
kabir
requested changes
Aug 13, 2026
kabir
left a comment
Collaborator
There was a problem hiding this comment.
I believe this PR to be wrong for the same reasons as mentioned in #1040 (review)
Essentially the agents should either:
- Emit a Message. No Task is created, and is for single reply interactions
- Create a Task for long running tasks
The two are mutually exclusive
dangzitou
force-pushed
the
agent/fix-message-before-input-required
branch
from
August 13, 2026 15:08
1fcb46e to
85283a9
Compare
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
Keep a task stream open when an agent emits a
Messageafter the task lifecycle has started. A statelessMessageremains a complete response and still closes its stream.The new regression test covers
WORKING Task -> Message -> INPUT_REQUIRED -> COMPLETED, including a custom message without task/context IDs as accepted byAgentEmitter.sendMessage(Message).CONTRIBUTINGGuide.Reproduction
On current
main, the focused Java 17 regression was run three times. Every run failed after delivering only the working task and message:The following
INPUT_REQUIREDandCOMPLETEDupdates were lost because everyMessagewas treated as stream-terminal.Verification
Run with OpenJDK 17:
Results:
EventConsumerTest: 19 tests passedserver-common: 475 tests passedThis fixes #1037