[dotnet-port] fix(agui): avoid tool result message ID collisions with streaming text messages - #193
Merged
qmuntal merged 1 commit intoMay 18, 2026
Conversation
…t messages Port of microsoft/agent-framework#5800. Tool result events (ToolCallResult) must not share the same message ID as the preceding streaming text/tool-call message. When an update contains FunctionResultContent, generate a fresh message ID for the tool result rather than reusing the update's msgID. This prevents AG-UI clients from incorrectly associating tool results with the wrong parent message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Ports a .NET fix (microsoft/agent-framework#5800) to ensure AG-UI tool result events get a distinct message ID from the preceding streaming text/tool-call message, preventing clients from associating tool results with the wrong parent message.
Changes:
- Generate a fresh
toolResultMsgIDwhen an update containsFunctionResultContentand route only those content items through it. - Adds helper
hasFunctionResultContentand a test verifying thatTOOL_CALL_RESULTevents use a different message ID thanTEXT_MESSAGE_START.
Show a summary per file
| File | Description |
|---|---|
| agent/hosting/aguihosting/events.go | Allocates a separate message ID for FunctionResultContent items within an update; adds hasFunctionResultContent helper. |
| agent/hosting/aguihosting/agui_test.go | Adds test asserting tool result message ID differs from the streaming text message ID. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
qmuntal
enabled auto-merge (squash)
May 18, 2026 08:41
gdams
approved these changes
May 18, 2026
qmuntal
deleted the
dotnet-port/agui-tool-result-message-id-5800-8c6a7fe5d95d95b3
branch
May 18, 2026 08:42
Contributor
Cross-repo parity review ✅This PR is a port of the .NET fix in microsoft/agent-framework#5800 and preserves semantic parity across all three SDK implementations:
No parity issues found. The change is internal to the AG-UI hosting adapter and does not affect any exported public API surface.
|
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.
Port of microsoft/agent-framework#5800.
Tool result events (ToolCallResult) must not share the same message ID as the preceding streaming text/tool-call message. When an update contains FunctionResultContent, generate a fresh message ID for the tool result rather than reusing the update's msgID. This prevents AG-UI clients from incorrectly associating tool results with the wrong parent message.