Skip to content

Conversation

@lokitoth
Copy link
Member

@lokitoth lokitoth commented Sep 9, 2025

Description

Fixes a crash in MessageMerger when there are no dangling updates.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • I didn't break anyone 😄

Copilot AI review requested due to automatic review settings September 9, 2025 12:33
@markwallace-microsoft markwallace-microsoft added .NET workflows Related to Workflows in agent-framework labels Sep 9, 2025
@github-actions github-actions bot changed the title fix: MessageMerger crashes when there are no dangling messages .NET: fix: MessageMerger crashes when there are no dangling messages Sep 9, 2025
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 PR fixes a crash in MessageMerger when there are no dangling message updates by adding proper null/empty checks before attempting to process dangling updates.

  • Added guard condition to prevent processing empty dangling updates in ComputeFlattened()
  • Enhanced ComputeMerged() method with better response merging logic and property handling
  • Added comprehensive test coverage for MessageMerger functionality

Reviewed Changes

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

File Description
MessageMerger.cs Added null safety checks for dangling updates and improved response merging logic
MessageMergerTests.cs Added new test file with unit tests for MessageMerger functionality
ChatMessageBuilder.cs Added helper utilities for creating test data and message streaming

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

If the parent "agent" instance received an Id or Name when being instantiated, we should avoid stomping over it with the subagents' ids. But if there is no parent identifier, and only a single subagent yielded identified messages, pull that in.
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/fix_message_merger branch from b6ec9da to e6b2ed3 Compare September 10, 2025 06:02
@lokitoth lokitoth enabled auto-merge September 10, 2025 06:09
@lokitoth lokitoth added this pull request to the merge queue Sep 10, 2025
Merged via the queue into main with commit 3b81164 Sep 10, 2025
14 checks passed
@crickman crickman deleted the dev/dotnet_workflow/fix_message_merger branch September 16, 2025 16:24
ReubenBond pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
…icrosoft#660)

* fix: MessageMerger crashes when there are no dangling messages

* refactor: Better logic for AgentId in Workflow-as-Agent

If the parent "agent" instance received an Id or Name when being instantiated, we should avoid stomping over it with the subagents' ids. But if there is no parent identifier, and only a single subagent yielded identified messages, pull that in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants