Skip to content

Conversation

@MackinnonBuck
Copy link
Member

@MackinnonBuck MackinnonBuck commented Dec 9, 2025

Overview

There were some recent changes made to SummarizingChatReducer to avoid orphaning an assistant response from the user message, so long as the unsummarized message count remains within the configured limit. The functional tests were updated, but the integration tests weren't, causing SummarizingChatReducer_PreservesConversationContext to fail with:

Message: 
Assert.Equal() Failure: Values differ
Expected: 3
Actual:   4

  Stack Trace: 
ChatClientIntegrationTests.SummarizingChatReducer_PreservesConversationContext() line 1160
--- End of stack trace from previous location ---

Changes

This PR updates the expected message count to 4 (summary + user message + assistant response + user message).

Microsoft Reviewers: Open in CodeFlow

@MackinnonBuck MackinnonBuck requested a review from a team as a code owner December 9, 2025 22:13
Copilot AI review requested due to automatic review settings December 9, 2025 22:13
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Dec 9, 2025
@stephentoub stephentoub enabled auto-merge (squash) December 9, 2025 22:20
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 addresses a test failure in the integration tests for SummarizingChatReducer following recent changes (PR #6908) that modified the reducer's behavior to avoid orphaning assistant responses from user messages when within the configured threshold limit.

Key Changes:

  • Updates the expected message count from 3 to 4 in the SummarizingChatReducer_PreservesConversationContext test to reflect the new behavior where the reducer searches backwards for a User message within the threshold window

Critical Issue Identified:
The PR updates the count assertion but does not update the subsequent Assert.Collection call, which still only validates 3 messages instead of the expected 4. This will cause the test to fail with an "Expected 4 elements but got 3" error.

@stephentoub stephentoub merged commit a544ccc into main Dec 9, 2025
6 checks passed
@stephentoub stephentoub deleted the mbuck/fix-summarizing-chat-reducer-integration-test branch December 9, 2025 23:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants