Repository navigation
.NET: [BREAKING] Clarify Foundry storage docs and user identity accessor - #10217
Roger Barreto (rogerbarreto) merged 3 commits into
Conversation
Rename GetHostedUserId to GetFoundryHostedUserId to identify the Foundry-specific contract. Preserve the serialized session key. Clarify inference storage and encrypted reasoning XML documentation. Leave agent lifetime configuration for a separate change. BREAKING CHANGE: replace GetHostedUserId() calls with GetFoundryHostedUserId(). Refs microsoft#10132
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the Foundry-specific accessor rename and storage documentation updates.
No open issues 🎉
What changed in this PR
This follow-up to #10132 clarifies .NET Foundry Hosting storage documentation and makes the session identity accessor explicitly Foundry-specific. The accessor rename is breaking, but the saved identity key and hosting behavior remain unchanged.
Changes:
- Distinguish inference-service storage and encrypted reasoning requests from hosted response storage.
- Rename
GetHostedUserId()toGetFoundryHostedUserId()across callers, samples, tests, and API notes. - Add regression tests for reading the existing identity key and rejecting a null session.
| File | Description |
|---|---|
dotnet/tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests/HostedUserIdTests.cs |
Update identity assertions to the renamed accessor. |
dotnet/tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests/AgentSessionExtensionsTests.cs |
Rename accessor tests and add compatibility and null-input coverage. |
dotnet/tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests/AgentFrameworkResponseHandlerTests.cs |
Update the session-reuse identity assertion. |
dotnet/tests/Foundry.Hosting.IntegrationTests.TestContainer/UserIdentityEchoAgent.cs |
Use the renamed accessor when echoing identity. |
dotnet/tests/Foundry.Hosting.IntegrationTests.TestContainer/Program.cs |
Update per-user memory identity lookup. |
dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/FoundryResponsesServerOptions.cs |
Clarify storage and encrypted reasoning XML documentation. |
dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/AgentSessionExtensions.cs |
Rename the public accessor and document saved-session identity semantics. |
dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/AgentFrameworkResponseHandler.cs |
Use the renamed accessor for identity validation. |
dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-MemoryAgent/Program.cs |
Update the local-source accessor call and explanatory comment. |
docs/decisions/0034-hosted-platform-context-agentserver-2.0.md |
Update current API notes to the Foundry-specific name. |
Review effort: Balanced
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): 6d1c4928847a
Model: gpt-5.6-sol
Overview
This PR deliberately renames a preview Foundry-hosting accessor and clarifies the separation between inference-service storage and hosted-response storage. The rename is complete across production callers, tests, samples, and documentation; the persisted state key remains unchanged and is pinned by a regression test. The request-option documentation is consistent with the existing conversion paths, and no publishable correctness, compatibility, architectural, or security defect was established.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
|
I think the merged is blocked because of a flaky test, see #10231 |
Motivation & Context
Address deferred review feedback from #10132. The storage options did not clearly distinguish requests sent to the inference service from hosted responses returned to callers. The user identity accessor also needs an explicitly Foundry-specific name.
Description & Review Guide
GetHostedUserId()toGetFoundryHostedUserId()and update callers, tests, samples, and current API notes. Document that the accessor reads saved session identity and that Responses hosting currently assigns it.session.GetHostedUserId()withsession.GetFoundryHostedUserId(). The serialized identity key remains unchanged, so existing saved sessions remain readable. No session-storage, identity-isolation, or agent lifetime behavior changes. Agent lifetime configuration is deferred to a separate PR. The locked AgentServer A2A implementation exposes user identity to its handler, supporting the protocol-independent Foundry name; this PR does not add A2A session identity assignment or change dependencies.Related Issue
N/A: trivial change. Documentation corrections and an explicitly requested accessor naming correction address deferred feedback from merged #10132. No new hosting behavior or lifetime design is introduced.
AI Assistance
AI assistance details: Copilot assisted with source investigation, documentation, the accessor rename, regression tests, validation, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.Local validation on Windows using Debug/net10.0:
dotnet:dotnet test --project tests\Microsoft.Agents.AI.Foundry.Hosting.UnitTests\Microsoft.Agents.AI.Foundry.Hosting.UnitTests.csproj -f net10.0 -c Debug --no-restore: passed, 592 succeeded, 1 existing skip, 0 failures.dotnet:dotnet build samples\04-hosting\FoundryHostedAgents\responses\Hosted-MemoryAgent\HostedMemoryAgent.csproj -c Debug -f net10.0 --no-restore --tl:off: passed, 0 warnings and 0 errors.dotnet:dotnet build tests\Foundry.Hosting.IntegrationTests.TestContainer\Foundry.Hosting.IntegrationTests.TestContainer.csproj -c Debug -f net10.0 --no-restore --tl:off: passed, 0 warnings and 0 errors.mcr.microsoft.com/dotnet/sdk:10.0, fromdotnet,dotnet format <project> --verify-no-changes --verbosity diagnostic: passed separately forsrc/Microsoft.Agents.AI.Foundry.Hosting/Microsoft.Agents.AI.Foundry.Hosting.csproj,tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests.csproj,samples/04-hosting/FoundryHostedAgents/responses/Hosted-MemoryAgent/HostedMemoryAgent.csproj, andtests/Foundry.Hosting.IntegrationTests.TestContainer/Foundry.Hosting.IntegrationTests.TestContainer.csproj. No formatting changes.git diff --check: passed. Live Foundry integration tests and other target-framework test runs were not run.