Description
Track Wesley's follow-up suggestion from PR #7991: #7991 (comment).
Promote a reusable InMemoryAgentSessionStore to the Microsoft.Agents.AI package, alongside ChatClientAgent and DelegatingAgentSessionStore, and consolidate the existing implementations in Hosting and Foundry.Hosting. This is intentionally out of scope for #7991.
Both implementations store serialized sessions in concurrent dictionaries and deserialize independent session instances on lookup. Their agent identity behavior differs: Hosting uses agent.Id; Foundry.Hosting uses a resolved hosting identity, with an instance-ID fallback for unnamed agents. Define how that hosting-specific behavior is preserved without adding Foundry dependencies to the core package.
Expected outcome:
- One reusable core implementation, with hosting packages using it or a thin adapter where identity behavior requires one.
- Preserve partition isolation, independent restored sessions, and experimental API annotations.
- Update registrations, public API declarations, documentation, and tests.
Code Sample
Proposed usage after promotion:
using Microsoft.Agents.AI;
AgentSessionStore store = new InMemoryAgentSessionStore();
Language/SDK
.NET
Description
Track Wesley's follow-up suggestion from PR #7991: #7991 (comment).
Promote a reusable
InMemoryAgentSessionStoreto theMicrosoft.Agents.AIpackage, alongsideChatClientAgentandDelegatingAgentSessionStore, and consolidate the existing implementations in Hosting and Foundry.Hosting. This is intentionally out of scope for #7991.Both implementations store serialized sessions in concurrent dictionaries and deserialize independent session instances on lookup. Their agent identity behavior differs: Hosting uses
agent.Id; Foundry.Hosting uses a resolved hosting identity, with an instance-ID fallback for unnamed agents. Define how that hosting-specific behavior is preserved without adding Foundry dependencies to the core package.Expected outcome:
Code Sample
Proposed usage after promotion:
Language/SDK
.NET