Skip to content

.NET: [BREAKING] Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient#4993

Merged
westey-m merged 3 commits intomicrosoft:mainfrom
westey-m:per-service-call-persistence-rename
Mar 31, 2026
Merged

.NET: [BREAKING] Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient#4993
westey-m merged 3 commits intomicrosoft:mainfrom
westey-m:per-service-call-persistence-rename

Conversation

@westey-m
Copy link
Copy Markdown
Contributor

@westey-m westey-m commented Mar 31, 2026

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

  • Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient
  • Rename Setting and Use method

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
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings March 31, 2026 13:06
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation .NET labels Mar 31, 2026
@github-actions github-actions bot changed the title Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient .NET: Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient Mar 31, 2026
Copy link
Copy Markdown
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 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 PerServiceCallChatHistoryPersistingChatClient and 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).

@westey-m westey-m changed the title .NET: Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient .NET: [BREAKING] Rename from ServiceStoredSimulatingChatClient to PerServiceCallChatHistoryPersistingChatClient Mar 31, 2026
@westey-m westey-m added this pull request to the merge queue Mar 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2026
@westey-m westey-m enabled auto-merge March 31, 2026 17:20
@westey-m westey-m added this pull request to the merge queue Mar 31, 2026
Merged via the queue into microsoft:main with commit 6e7254b Mar 31, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants