.NET: [BREAKING] Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient#4993
Merged
westey-m merged 3 commits intomicrosoft:mainfrom Mar 31, 2026
Conversation
…storyPersistingChatClient
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the naming around the chat-history-per-service-call behavior in the .NET ChatClientAgent pipeline to better reflect what the decorator actually does (per-service-call persistence + per-call ConversationId updates), and propagates the rename through tests, samples, and docs.
Changes:
- Renames the decorator to
PerServiceCallChatHistoryPersistingChatClientand updates references across the agent pipeline. - Renames the opt-in agent option and builder extension used to enable/insert this behavior.
- Updates unit tests, sample step 19, and ADR 0022 wording to use the new names.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/PerServiceCallChatHistoryPersistingChatClientTests.cs | Renames the test class + updates option/decorator references (but some test semantics/docs now read inconsistently). |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgentTestHelper.cs | Updates helper docs to reference the renamed decorator. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_ChatHistoryManagementTests.cs | Updates option name in chat history management tests. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_ApprovalsTests.cs | Updates option name in approvals flow tests. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/PerServiceCallChatHistoryPersistingChatClient.cs | Renames the decorator type and updates doc comments/error messages. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientExtensions.cs | Injects the renamed decorator based on the renamed option. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientBuilderExtensions.cs | Renames the builder extension method that inserts the decorator. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgentOptions.cs | Renames the public option and refreshes its documentation. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgentLogMessages.cs | Updates warning messages to reflect the renamed option/decorator/extension. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs | Updates internal naming and warning logic to use the renamed option/decorator. |
| dotnet/samples/02-agents/Agents/Agent_Step19_InFunctionLoopCheckpointing/README.md | Updates sample docs to use the new option/decorator names. |
| dotnet/samples/02-agents/Agents/Agent_Step19_InFunctionLoopCheckpointing/Program.cs | Updates sample code/comments to use the new option name. |
| docs/decisions/0022-chat-history-persistence-consistency.md | Updates ADR references to the renamed option/decorator (but implementation notes may now be stale). |
Comments suppressed due to low confidence (3)
dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/PerServiceCallChatHistoryPersistingChatClientTests.cs:19
- The XML summary describes the persistence semantics backwards: per-service-call persistence is enabled when RequirePerServiceCallChatHistoryPersistence is true, not "by default". This wording makes the tests hard to interpret and contradicts the option name/behavior.
dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/PerServiceCallChatHistoryPersistingChatClientTests.cs:54 - This test is labeled as verifying the default behavior when RequirePerServiceCallChatHistoryPersistence is false, but the agent options set RequirePerServiceCallChatHistoryPersistence = true. Update either the test name/docs or the option value so the test actually covers the default path.
dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/PerServiceCallChatHistoryPersistingChatClientTests.cs:101 - The test name and summary claim to verify end-of-run persistence when the option is enabled, but RequirePerServiceCallChatHistoryPersistence = true activates the per-service-call decorator and skips end-of-run persistence. To test end-of-run persistence, set the option to false (and ideally use a multi-call/tool-loop scenario so the assertion differentiates per-call vs end-of-run).
dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientBuilderExtensions.cs
Show resolved
Hide resolved
SergeyMenshykh
approved these changes
Mar 31, 2026
rogerbarreto
approved these changes
Mar 31, 2026
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.
Motivation and Context
The chat client updates both chat history and conversation ids, so it does more than simulate Service Storage. It also makes conversation id handling more consistent by updating it on the session after each service call, which causes this behavior to match the chat history storage behavior.
Description
UsemethodContribution Checklist