Uh oh!
There was an error while loading. Please reload this page.
.NET: Allow overriding the ChatMessageStore to be used per agent run. - #3330
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds functionality to allow overriding the ChatMessageStore on a per-agent-run basis via AdditionalProperties. The PR also reorganizes tests by moving ChatMessageStore and ConversationId related tests into a separate file.
Changes:
- Added AdditionalPropertiesExtensions with type-based key storage/retrieval for AdditionalPropertiesDictionary
- Implemented ResolveChatMessageStore to support ChatMessageStore overrides via AdditionalProperties
- Made ChatMessageStoreMessages nullable in InvokedContext to handle first-run scenarios
- Reorganized tests by moving chat history management tests to a dedicated file
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Abstractions/AdditionalPropertiesExtensions.cs | New extension methods for type-based storage/retrieval in AdditionalPropertiesDictionary |
| dotnet/src/Microsoft.Agents.AI.Abstractions/ChatMessageStore.cs | Made ChatMessageStoreMessages parameter nullable in InvokedContext constructor |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs | Added ResolveChatMessageStore method and updated all notification call sites to pass chatOptions |
| dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AdditionalPropertiesExtensionsTests.cs | Comprehensive tests for AdditionalPropertiesExtensions |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_ChatHistoryManagementTests.cs | New test file consolidating ChatMessageStore and ConversationId tests, including override test |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgentTests.cs | Removed tests that were moved to ChatHistoryManagementTests |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_DeserializeThreadTests.cs | Namespace changed for consistency |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_GetNewThreadTests.cs | Namespace changed for consistency |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgentContinuationTokenTests.cs | Namespace changed for consistency |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…#3330) * Allow overriding the ChatMessageStore to be used per agent run. * Fix typos * Fix Add and add TryAdd, Contains and Remove
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Motivation and Context
#3104
Description
Contribution Checklist