Skip to content

Python: Add Foundry Hosted Agent history provider#6593

Open
eavanvalkenburg wants to merge 3 commits into
microsoft:mainfrom
eavanvalkenburg:eavan/python-hosting-foundry-helper
Open

Python: Add Foundry Hosted Agent history provider#6593
eavanvalkenburg wants to merge 3 commits into
microsoft:mainfrom
eavanvalkenburg:eavan/python-hosting-foundry-helper

Conversation

@eavanvalkenburg

@eavanvalkenburg eavanvalkenburg commented Jun 18, 2026

Copy link
Copy Markdown
Member

Motivation & Context

Adds the smallest Foundry Hosted Agent history-provider slice needed by the broader hosting/channel work. On its own this is not especially useful: it becomes meaningful together with the new agent-framework-hosting packages, where it provides the persistence piece for building Foundry Hosted Agents using the new host/channel model.

This gives apps an alternative path to the existing ResponsesHostServer setup: use the new hosting packages for route/channel composition, while this provider handles Foundry-compatible response history. This PR intentionally avoids the broader Foundry hosting rewrites from the original feature branch. See ADR-0027 and ADR-0028 for the purpose, intended use, and follow-up boundaries of the hosting work.

Description & Review Guide

  • What are the major changes?
    • Adds FoundryHostedAgentHistoryProvider in agent_framework_foundry_hosting.
    • Adds Foundry-compatible foundry_response_id helpers used by the provider/channel response-id flow.
    • Marks the hosting provider APIs as experimental under ExperimentalFeature.HOSTING.
    • Adds provider tests for local round-trip persistence, chained response history, hosted credential validation, experimental metadata, and ID shape.
  • What is the impact of these changes?
    • Later hosted-agent samples can use a Foundry-compatible history provider with the new host/channel packages.
    • Existing ResponsesHostServer and InvocationsHostServer behavior is unchanged.
  • What do you want reviewers to focus on?
    • Correctness of the code in this slice. The broader purpose and intended use are covered by the hosting ADRs.

Related Issue

Fixes #6586
Refs #6265

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 18, 2026 08:15
@moonbox3 moonbox3 added the python Issues related to the Python codebase label Jun 18, 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

This PR introduces a minimal public helper in the agent_framework_foundry_hosting Python package to mint Foundry-hosted-agent-compatible response IDs, so upcoming hosting/channel samples can generate accepted IDs without reaching into Azure SDK implementation details at call sites.

Changes:

  • Added a new agent_framework_foundry_hosting.hosted_agents helper module providing foundry_response_id() and foundry_response_id_factory().
  • Added unit tests validating response ID shape, partition-key reuse across chained responses, and the factory hook behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/packages/foundry_hosting/agent_framework_foundry_hosting/hosted_agents.py Adds the Foundry response ID helper functions and factory type alias.
python/packages/foundry_hosting/tests/foundry_hosting/test_hosted_agents.py Adds focused tests for ID shape, partition key reuse, and factory behavior.

Comment thread python/packages/foundry_hosting/agent_framework_foundry_hosting/hosted_agents.py Outdated
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _feature_stage.py1691094%110, 156, 211, 222, 242, 280, 291, 297, 328, 356
packages/foundry_hosting/agent_framework_foundry_hosting
   _history_provider.py1252480%76, 90–98, 211–212, 215, 225–230, 244, 250, 266, 305, 308
TOTAL39976452188% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
7993 34 💤 0 ❌ 0 🔥 2m 9s ⏱️

@github-actions github-actions Bot 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.

Automated Code Review

Reviewers: 5 | Confidence: 83% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by eavanvalkenburg's agents

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eavanvalkenburg eavanvalkenburg changed the title Python: Add Foundry hosted response ID helper Python: Add Foundry Hosted Agent history provider Jun 18, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Issues related to the Python codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosting: minimal Foundry Hosted Agent helper

3 participants