Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for preserving MediaType and MessageId properties when converting between ChatMessage objects and their record representations in declarative workflows. The changes enable better fidelity in round-trip conversions, though the implementation relies partially on inference rather than explicit persistence.
Changes:
- Added MessageId preservation when converting from records to ChatMessage
- Added MediaType parameter support and inference logic for content conversion
- Added comprehensive round-trip unit tests for ChatMessage conversions
- Updated integration tests to support two workflow variants (conversation and auto-send)
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ChatMessageExtensions.cs | Added System.IO import, MessageId extraction, MediaType parameter handling, and InferMediaType helper method |
| AddConversationMessageExecutor.cs | Updated ToContent call to pass MediaType from content model |
| ChatMessageExtensionsTests.cs | Added round-trip tests for ChatMessage as Record and Table, with custom equivalence assertions |
| MediaInputTest.cs | Refactored to test two workflow variants, updated test parameters and assertions |
| MediaInputConversation.yaml | New workflow using conversation-based message handling |
| MediaInputAutoSend.yaml | New workflow using autoSend for message handling |
alliscode
reviewed
Jan 29, 2026
dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/ChatMessageExtensions.cs
Show resolved
Hide resolved
alliscode
approved these changes
Jan 29, 2026
TaoChenOSU
approved these changes
Jan 29, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 29, 2026
…ssage in declarative workflows (#3505) * Builds locally and tests pass * Fix typo * Updated * Updated * Fixed tests failing on net472 but not on dotnet10 --------- Co-authored-by: Chris Rickman <crickman@microsoft.com>
4 tasks
eavanvalkenburg
pushed a commit
to eavanvalkenburg/agent-framework
that referenced
this pull request
Feb 1, 2026
…ssage in declarative workflows (microsoft#3505) * Builds locally and tests pass * Fix typo * Updated * Updated * Fixed tests failing on net472 but not on dotnet10 --------- Co-authored-by: Chris Rickman <crickman@microsoft.com>
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.
This is a rebase of PR #3021 to main. Initial description of the change is copied below and the credit for this change goes to Chris (The original PR author).
Motivation and Context
Ensures media-type and message id are persisted when converting between ChatMessage and the object model representation.
Fixes: #3020
Description
Contribution Checklist