Skip to content

[BREAKING] Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store - #7533

Draft
TaoChenOSU wants to merge 4 commits into
mainfrom
taochen/issue-7532
Draft

[BREAKING] Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store#7533
TaoChenOSU wants to merge 4 commits into
mainfrom
taochen/issue-7532

Conversation

@TaoChenOSU

@TaoChenOSU TaoChenOSU commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

Closes #7532

FoundryStateStore is recently introduced in the latest azure.ai.agentserver SDK, 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.agentserver SDK.

Description & Review Guide

  • What are the major changes?
    • Remove FoundrySessionStore, which is an implementation of the SessionStore that persists MAF agent sessions in FHA sessions' file system.
    • Replace FoundrySessionStore with a new FoundryAgentSessionStore that is backed by the FoundryStateStore.
    • Introduce StoreProvider and the default implementations, including AgentSessionStoreProvider, CheckpointStoreProvider, and FunctionApprovalStoreProvider, 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.
    • Migrate all existing file-based store solutions to using FoundryStateStore, including FoundryAgentSessionStore, FoundryCheckpointStore, and FoundryFunctionApprovalStore.
    • Remove the non-streaming path of the inner agent, since Foundry manages streaming vs. non-streaming.
    • Changes across the board to match the breaking changes introduced by the new version.
  • What is the impact of these changes?
    • This is a breaking change in how MAF FHA persists states. No API surface change.
  • What do you want reviewers to focus on?
    • The provider pattern that switches between different underlying stores based on the runtime env.

Related Issue

Fixes #7352

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

@TaoChenOSU TaoChenOSU self-assigned this Aug 5, 2026
Copilot AI lite review requested due to automatic review settings August 5, 2026 18:43
@TaoChenOSU TaoChenOSU added python Usage: [Issues, PRs], Target: Python foundry Usage: [Issues, PRs], Target: all Foundry integrations labels Aug 5, 2026
@TaoChenOSU TaoChenOSU added the hosting Usage: [Issues, PRs], Target: all hosting related solutions label Aug 5, 2026
@github-actions github-actions Bot changed the title Migrate FHA to responses==2.0.0b1 and add Foundry state store Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store Aug 5, 2026
@agent-framework-automation agent-framework-automation Bot added the documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs label Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ResponsesHostServer integration to azure-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.

Comment thread python/packages/foundry_hosting/README.md Outdated
Comment thread python/packages/foundry_hosting/pyproject.toml
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/foundry_hosting/agent_framework_foundry_hosting
   _responses.py7119586%143–144, 158, 161–162, 212, 227, 289, 348–351, 387–388, 391, 395, 427, 506, 509, 513, 579, 641–642, 981, 993, 1445–1446, 1450, 1495, 1497, 1499, 1501, 1505, 1513, 1516–1520, 1522, 1532, 1536, 1549, 1583–1588, 1592–1593, 1601–1607, 1637–1638, 1640–1641, 1643, 1648, 1656–1657, 1659, 1664–1668, 1670, 1677–1678, 1680–1681, 1687, 1689–1693, 1703, 1709, 1733, 1739, 1745, 1747, 1749–1752, 1760, 1762
   _state_store.py142397%230–232
TOTAL44624410990% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
9083 34 💤 0 ❌ 0 🔥 2m 20s ⏱️

@TaoChenOSU TaoChenOSU changed the title Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store [BREAKING] Python: Migrate FHA to responses==2.0.0b1 and add Foundry state store Aug 5, 2026
@TaoChenOSU
TaoChenOSU deployed to github-app-auth August 5, 2026 22:15 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added the breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs foundry Usage: [Issues, PRs], Target: all Foundry integrations hosting Usage: [Issues, PRs], Target: all hosting related solutions python Usage: [Issues, PRs], Target: Python

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Python: Replace FHA file-based storage to new storage API

2 participants