| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Adds session-persisted routing so .NET agents can switch chat clients while retaining client-side conversation history.
Changes:
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file| File | Description |
|---|---|
| RoutePersistingRoutingChatClient.cs | Implements session-aware routing and ownership. |
| RoutePersistingRoutingChatClientOptions.cs | Defines routing configuration. |
| AgentSessionRoutingState.cs | Stores the active route. |
| AgentJsonUtilities.cs | Registers routing state serialization. |
| RoutePersistingRoutingChatClientTests.cs | Tests routing, state, services, and disposal. |
| Agents/README.md | Lists the new sample. |
| Agent_Step24_MultiModelRouting/README.md | Documents the sample. |
| Agent_Step24_MultiModelRouting/Program.cs | Demonstrates model switching. |
| Agent_Step24_MultiModelRouting.csproj | Configures the sample project. |
| Directory.Packages.props | Updates MEAI and related dependencies. |
| agent-framework-dotnet.slnx | Adds the sample to the solution. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was a problem hiding this comment.
Result: Findings reported
Scope: full PR (1 commit(s)): 01df470bfd59
Model: gpt-5.6-sol
The PR introduces a session-state-backed RoutingChatClient with explicit route validation, serialization coverage, session isolation tests, and documented constraints around route mutation and client-side history. The strongest guardrails fail closed for missing routes and keep routing state session-local. Residual risks remain around ambient-context lifetime, route-specific capability discovery, and ownership during mutable route replacement.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
3 verified findings remained after source verification (1 high, 2 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/src/Microsoft.Agents.AI/ChatClient/RoutePersistingRoutingChatClient.cs
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation & Context
Applications that switch the model or provider handling an existing conversation need to preserve the conversation history across that switch. Without shared client-side history, the newly selected provider loses the prior context and applications must rehydrate it manually.
Microsoft.Extensions.AI now provides the routing mechanism through its RoutingChatClient base type. Agent Framework still needs an agent-aware implementation that persists the active route in AgentSession state, allowing developers to inspect or change the route while keeping conversation history portable between routed clients.
Description & Review Guide
Related Issue
Fixes #6865
This supersedes #6932: the generic routing mechanism from that PR was moved into Microsoft.Extensions.AI in dotnet/extensions#7662. This PR builds on the MEAI RoutingChatClient and adds only the Agent Framework-specific session persistence layer.
Contribution Checklist