Skip to content

.NET: [BREAKING] Rename GetNewSession to CreateSession - #3501

Merged
Mark Wallace (markwallace-microsoft) merged 6 commits into
microsoft:mainfrom
westey-m:create-session-rename
Feb 3, 2026
Merged

.NET: [BREAKING] Rename GetNewSession to CreateSession#3501
Mark Wallace (markwallace-microsoft) merged 6 commits into
microsoft:mainfrom
westey-m:create-session-rename

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation and Context

Since session is less tied to any specific underlying chat history storage mechanism, it is less likely to be confused for creating a service side artifact, so renaming to CreateSession.

#2542

Description

  • Rename GetNewSession to CreateSession

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.

CopilotAI review requested due to automatic review settings January 29, 2026 14:42
@markwallace-microsoftMark Wallace (markwallace-microsoft) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Jan 29, 2026
@github-actionsgithub-actionsBot changed the title [BREAKING] Rename GetNewSession to CreateSession.NET: [BREAKING] Rename GetNewSession to CreateSessionJan 29, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 implements a breaking API change that renames GetNewSessionAsync to CreateSessionAsync across the entire Agent Framework codebase. The motivation is that "CreateSession" better reflects the operation since sessions are less tied to specific underlying chat history storage mechanisms, reducing potential confusion about whether service-side artifacts are being created.

Changes:

  • Renamed the abstract method AIAgent.GetNewSessionAsync to AIAgent.CreateSessionAsync
  • Updated all concrete implementations across 11+ agent types (ChatClientAgent, DurableAIAgent, WorkflowHostAgent, A2AAgent, CopilotStudioAgent, GitHubCopilotAgent, PurviewAgent, etc.)
  • Updated all 115+ test files to use the new method name
  • Updated 50+ sample applications and demonstration code
  • Updated XML documentation comments, error messages, and README files to reference the new method name

Reviewed changes

Copilot reviewed 124 out of 124 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.csCore abstract method renamed with comprehensive XML documentation
dotnet/src/Microsoft.Agents.AI.Abstractions/AgentSession.csXML documentation references updated to new method name
dotnet/src/Microsoft.Agents.AI.Abstractions/DelegatingAIAgent.csDelegation to inner agent updated
dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.csCore implementation and 3 overloads renamed consistently
dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAIAgent.csDurableTask implementation updated with error message fix
dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAIAgentProxy.csProxy implementation updated with error message fix
dotnet/src/Microsoft.Agents.AI.DurableTask/AgentEntity.csEntity implementation updated
dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.csWorkflow host implementation updated
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.csInternal workflow executor updated
dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.csA2A agent and overload updated
dotnet/src/Microsoft.Agents.AI.CopilotStudio/CopilotStudioAgent.csCopilot Studio agent and overload updated
dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.csGitHub Copilot agent and overload updated
dotnet/src/Microsoft.Agents.AI.Purview/PurviewAgent.csPurview wrapper agent updated
dotnet/src/Microsoft.Agents.AI.Hosting/NoopAgentSessionStore.csSession store implementation updated
dotnet/src/Microsoft.Agents.AI.Hosting/Local/InMemoryAgentSessionStore.csIn-memory session store updated
dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/README.mdAzure Functions documentation updated
dotnet/tests/** (40+ files)All test implementations and test method names updated
dotnet/samples/** (60+ files)All sample code and documentation updated

Comment threaddotnet/tests/Microsoft.Agents.AI.UnitTests/TestAIAgent.cs Outdated
@westey-m
westey (westey-m) added this pull request to the merge queueJan 30, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationUsage: [Issues, PRs], Target: documentation in the code base and learn docs.NETUsage: [Issues, PRs], Target: .NetworkflowsUsage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@westey-m@markwallace-microsoft@SergeyMenshykh@peibekwe