-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET: [BREAKING] Rename GetNewSession to CreateSession #3501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 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.GetNewSessionAsynctoAIAgent.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
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs | Core abstract method renamed with comprehensive XML documentation |
| dotnet/src/Microsoft.Agents.AI.Abstractions/AgentSession.cs | XML documentation references updated to new method name |
| dotnet/src/Microsoft.Agents.AI.Abstractions/DelegatingAIAgent.cs | Delegation to inner agent updated |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs | Core implementation and 3 overloads renamed consistently |
| dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAIAgent.cs | DurableTask implementation updated with error message fix |
| dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAIAgentProxy.cs | Proxy implementation updated with error message fix |
| dotnet/src/Microsoft.Agents.AI.DurableTask/AgentEntity.cs | Entity implementation updated |
| dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs | Workflow host implementation updated |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs | Internal workflow executor updated |
| dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.cs | A2A agent and overload updated |
| dotnet/src/Microsoft.Agents.AI.CopilotStudio/CopilotStudioAgent.cs | Copilot Studio agent and overload updated |
| dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs | GitHub Copilot agent and overload updated |
| dotnet/src/Microsoft.Agents.AI.Purview/PurviewAgent.cs | Purview wrapper agent updated |
| dotnet/src/Microsoft.Agents.AI.Hosting/NoopAgentSessionStore.cs | Session store implementation updated |
| dotnet/src/Microsoft.Agents.AI.Hosting/Local/InMemoryAgentSessionStore.cs | In-memory session store updated |
| dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/README.md | Azure 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 |
* Rename GetNewSession to CreateSession * Address copilot feedback * Suppress warning * Suppress warning * Fix further warnings.
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
Contribution Checklist