Skip to content

Conversation

@MaciejWarchalowski
Copy link

@MaciejWarchalowski MaciejWarchalowski commented Jan 22, 2026

This pull request ensures that the MessageId property is correctly set when converting AGUIToolMessage to ChatMessage objects, and updates the corresponding unit tests to verify this behavior. References #3365

Enhancements to message conversion logic:

  • AGUIChatMessageExtensions.cs: Sets the MessageId property when creating a ChatMessage from a AGUIToolMessage in the AsChatMessages method.

Testing improvements:

Copilot AI review requested due to automatic review settings January 22, 2026 07:40
@github-actions github-actions bot changed the title fix: include MessageId in AGUIToolMessage to ChatMessage transformation .NET: fix: include MessageId in AGUIToolMessage to ChatMessage transformation Jan 22, 2026
@MaciejWarchalowski
Copy link
Author

@microsoft-github-policy-service agree

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a bug where the MessageId property was not being set when converting AGUIToolMessage to ChatMessage objects. The fix ensures consistency with how other message types (assistant and default messages) already handle MessageId preservation during conversion.

Changes:

  • Sets MessageId property in the AsChatMessages method for AGUIToolMessage conversions
  • Adds test assertions to verify MessageId is correctly preserved for tool messages

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dotnet/src/Microsoft.Agents.AI.AGUI/Shared/AGUIChatMessageExtensions.cs Adds MessageId assignment to AGUIToolMessage conversion, making it consistent with other message type conversions
dotnet/tests/Microsoft.Agents.AI.AGUI.UnitTests/AGUIChatMessageExtensionsTests.cs Adds four assertions across different test cases to verify MessageId is correctly set for tool message conversions

@MaciejWarchalowski MaciejWarchalowski force-pushed the agui-tool-message-transformation-3365 branch from 4337513 to e9a1086 Compare January 22, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants