[BREAKING] Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store - #7533
[BREAKING] Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store#7533Tao Chen (TaoChenOSU) wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Python Foundry Hosting integration to the azure-ai-agentserver-responses 2.0.0b1 API and replaces prior file-based persistence with Foundry State Store–backed implementations for hosted scenarios, aligning with the new storage API direction (Issue #7532).
Changes:
- Migrate
ResponsesHostServerintegration toazure-ai-agentserver-responses==2.0.0b1(including streaming/event API adjustments). - Introduce Foundry State Store–backed persistence for agent sessions, workflow checkpoints, and function approvals (with providers for hosted vs local).
- Update public exports/docs and add targeted unit tests for the new state store behaviors.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/uv.lock | Updates locked dependency graph for new agentserver package versions. |
| python/packages/foundry_hosting/pyproject.toml | Adjusts declared dependencies to the new azure-ai-agentserver-responses version line. |
| python/packages/foundry_hosting/README.md | Re-documents state store behavior for sessions/checkpoints/approvals. |
| python/packages/foundry_hosting/agent_framework_foundry_hosting/_state_store.py | Adds FoundryStateStore-backed session/checkpoint/approval stores + provider abstractions. |
| python/packages/foundry_hosting/agent_framework_foundry_hosting/_session_store.py | Removes the previous file-backed FoundrySessionStore implementation. |
| python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py | Migrates host implementation to Responses 2.0 APIs and wires in new storage providers. |
| python/packages/foundry_hosting/agent_framework_foundry_hosting/init.py | Re-exports new state store types/providers as public surface area. |
| python/packages/foundry_hosting/tests/test_state_store.py | Adds unit coverage for the new Foundry-backed stores and providers. |
| python/packages/foundry_hosting/tests/test_responses.py | Updates/extends host tests for Responses 2.0 behavior and new storage/provider wiring. |
| python/packages/core/tests/core/test_foundry_namespace.py | Updates Foundry namespace exposure test for renamed session store symbol. |
| python/packages/core/AGENTS.md | Updates documentation for the Foundry session store symbol and backing implementation. |
| python/packages/core/agent_framework/foundry/init.pyi | Updates typing exports to include new hosting storage/provider symbols. |
| python/packages/core/agent_framework/foundry/init.py | Updates lazy re-export map for new hosting storage/provider symbols. |
| python/PACKAGE_STATUS.md | Updates package status references to the new hosted session store symbol/file. |
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||
|
/review |
There was a problem hiding this comment.
Agent Framework Review — Iteration 1
Completed passes: 4
Scope: full PR (4 commit(s)): ff8450b9fe0f, 4cf73d533ca7, 14cf002f7a00, 3df40fd8b17f
Review passes
- Correctness (
gpt-5.6-sol) — The request path permits both conversation_id and previous_response_id, which can restore one session and persist it under another conversation, potentially overwriting unrelated state. - Test Coverage (
gpt-5.6-sol) — Two high-severity test coverage gaps could allow regressions in durable state storage to pass unnoticed: checkpoint backend selection is not asserted, and Foundry agent-session writes are not tested. - Failure Modes (
claude-opus-4.8) — No high-confidence issues found in this pass. - Design Approach (
claude-opus-4.8) — No high-confidence issues found in this pass.
| "FoundryEvals": ("agent_framework_foundry", "agent-framework-foundry"), | ||
| "FoundryMemoryProvider": ("agent_framework_foundry", "agent-framework-foundry"), | ||
| "FoundrySessionStore": ("agent_framework_foundry_hosting", "agent-framework-foundry-hosting"), | ||
| "FoundryAgentSessionStore": ("agent_framework_foundry_hosting", "agent-framework-foundry-hosting"), |
There was a problem hiding this comment.
Shouldn't ContextScopedStoreProvider be included in the namespace shim too? It is exported from agent_framework_foundry_hosting/__init__.py, but it is missing from _IMPORTS here and from foundry/__init__.pyi (line 43 region), while StoreProvider and CheckpointStoreProvider are both there. An import agent_framework.foundry.ContextScopedStoreProvider would raises an error.
Motivation & Context
Closes #7532
FoundryStateStoreis recently introduced in the latestazure.ai.agentserverSDK, which allows us to durably save data within Foundry Hosted Agent sessions. See the "Durable state storage" section here: https://pypi.org/project/azure-ai-agentserver-core/Due to the package version bump, this PR also contains a lot of changes to accommodate the breaking changes introduced by the
azure.ai.agentserverSDK.Description & Review Guide
FoundrySessionStore, which is an implementation of theSessionStorethat persists MAF agent sessions in FHA sessions' file system.FoundrySessionStorewith a newFoundryAgentSessionStorethat is backed by theFoundryStateStore.StoreProviderand the default implementations, includingAgentSessionStoreProvider,CheckpointStoreProvider, andFunctionApprovalStoreProvider, which will provide the actual store instance based on the environment (i.e. if the agent is hosted vs local). This also allows customers to customize FHA to use their storage solution.FoundryStateStore, includingFoundryAgentSessionStore,FoundryCheckpointStore, andFoundryFunctionApprovalStore.Related Issue
Fixes #7352
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.