Skip to content

Python: Test - #5344

Closed
Tao Chen (TaoChenOSU) wants to merge 11 commits into
mainfrom
feature/python-foundry-hosted-agent-vnext
Closed

Python: Test#5344
Tao Chen (TaoChenOSU) wants to merge 11 commits into
mainfrom
feature/python-foundry-hosted-agent-vnext

Conversation

@TaoChenOSU

Copy link
Copy Markdown
Contributor

Motivation and Context

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

* Experiment

* Update dependency and add non streaming

* Add more samples

* Rename samples

* Add invocations

* Comments 1

* Comments 2

* Comments 3

* Improve README

* Add local shell sample

* WIP: Add eval and memory samples

* Update user agent prefix

* Update user agent prefix doc
* Add tests

* fix tests and sample

* Fix formatting

* Remove function approval contents
* Refine samples and upgrade pacakges

* Upgrade to a new package that fixes a bug

* Update model env var
* Upgrade agentserver packages

* Fix new types
* Add special handling for workflows

* Address comments
Copilot AI review requested due to automatic review settings April 17, 2026 22:31
@moonbox3 Evan Mattson (moonbox3) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python labels Apr 17, 2026
@github-actions github-actions Bot changed the title Test Python: Test Apr 17, 2026
@moonbox3

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _telemetry.py28196%81
packages/foundry_hosting/agent_framework_foundry_hosting
   _invocations.py342429%34, 36–37, 39–42, 46–47, 49–55, 57, 59, 61–63, 65, 71–72
   _responses.py37317154%110–111, 120–121, 125, 130, 152–154, 174–176, 191–193, 204–206, 226–227, 229–231, 233–235, 239–242, 245–250, 257, 262, 265, 271–272, 274–275, 277, 279, 281–284, 286–288, 291, 295, 297–304, 307–308, 310–312, 320–325, 397–398, 503–504, 526, 542–545, 547–550, 552–554, 559–562, 567–573, 575, 590–595, 597, 612–644, 646, 664, 667, 702–706, 710–716, 723–727, 733–739, 746, 752, 755
TOTAL28741349487% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
5667 30 💤 0 ❌ 0 🔥 1m 35s ⏱️

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 new Python package for hosting Agent Framework agents/workflows on Foundry Agent Server (Responses + Invocations APIs), updates telemetry to allow hosting layers to prepend a user-agent prefix, and replaces older “hosted_agents” end-to-end samples with a new set of Foundry-hosted-agent samples.

Changes:

  • Add agent-framework-foundry-hosting package (ResponsesHostServer, InvocationsHostServer) plus HTTP round-trip tests for Responses.
  • Add new python/samples/04-hosting/foundry-hosted-agents/** sample set (Responses + Invocations).
  • Remove older python/samples/05-end-to-end/hosted_agents/** sample set and update workspace/lock/cspell accordingly.

Reviewed changes

Copilot reviewed 67 out of 71 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
python/uv.lock Adds the new workspace package and its pinned dependencies to the lockfile.
python/pyproject.toml Registers agent-framework-foundry-hosting as a workspace dependency.
python/.cspell.json Adds “agentserver” to the spellchecker dictionary.
python/packages/core/agent_framework/_telemetry.py Adds support for prepending user-agent prefixes (used by hosting layers).
python/packages/foundry_hosting/pyproject.toml New package definition for agent-framework-foundry-hosting.
python/packages/foundry_hosting/agent_framework_foundry_hosting/init.py Exposes hosting servers from the new package.
python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py Implements Responses API hosting adapter for agents/workflows.
python/packages/foundry_hosting/agent_framework_foundry_hosting/_invocations.py Implements Invocations API hosting adapter for agents.
python/packages/foundry_hosting/tests/test_responses.py Adds HTTP round-trip tests for ResponsesHostServer.
python/packages/foundry_hosting/README.md Placeholder README for the new hosting package.
python/packages/foundry_hosting/LICENSE Adds MIT license for the new package.
python/samples/04-hosting/foundry-hosted-agents/responses/README.md New top-level Responses hosting sample docs and index.
python/samples/04-hosting/foundry-hosted-agents/responses/using_deployed_agent.py New client-side example for talking to a deployed agent.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/requirements.txt New basic Responses hosting sample dependencies.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/main.py New basic Responses hosting sample server.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/agent.yaml New basic sample agent config.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/agent.manifest.yaml New basic sample manifest for deployment.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/README.md New basic sample documentation.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/Dockerfile Container recipe for the basic sample.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/.env.example Example env file for the basic sample.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/.dockerignore Docker ignore for the basic sample.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/requirements.txt Local tools sample dependencies.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/main.py Local tools Responses hosting sample server.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/agent.yaml Local tools agent config.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/agent.manifest.yaml Local tools deployment manifest.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/README.md Local tools sample docs.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/Dockerfile Container recipe for local tools sample.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/.env.example Env example for local tools sample.
python/samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/.dockerignore Docker ignore for local tools sample.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/requirements.txt Remote MCP sample dependencies.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/main.py Remote MCP Responses hosting sample server.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/agent.yaml Remote MCP agent config.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/agent.manifest.yaml Remote MCP deployment manifest.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/README.md Remote MCP sample docs.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/Dockerfile Container recipe for remote MCP sample.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/.env.example Env example for remote MCP sample.
python/samples/04-hosting/foundry-hosted-agents/responses/03_remote_mcp/.dockerignore Docker ignore for remote MCP sample.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/requirements.txt Workflow sample dependencies.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/main.py Workflow Responses hosting sample server.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/agent.yaml Workflow agent config.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/agent.manifest.yaml Workflow deployment manifest.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/README.md Workflow sample docs.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/Dockerfile Container recipe for workflow sample.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/.env.example Env example for workflow sample.
python/samples/04-hosting/foundry-hosted-agents/responses/04_workflows/.dockerignore Docker ignore for workflow sample.
python/samples/04-hosting/foundry-hosted-agents/invocations/01-basic/requirements.txt Invocations basic sample dependencies.
python/samples/04-hosting/foundry-hosted-agents/invocations/01-basic/main.py Invocations basic sample server.
python/samples/04-hosting/foundry-hosted-agents/invocations/01-basic/README.md Invocations basic sample docs.
python/samples/05-end-to-end/hosted_agents/README.md Removes legacy hosted agent samples index.
python/samples/05-end-to-end/hosted_agents/agent_with_hosted_mcp/requirements.txt Removes legacy sample dependencies file.
python/samples/05-end-to-end/hosted_agents/agent_with_hosted_mcp/main.py Removes legacy sample implementation.
python/samples/05-end-to-end/hosted_agents/agent_with_hosted_mcp/agent.yaml Removes legacy sample agent config.
python/samples/05-end-to-end/hosted_agents/agent_with_text_search_rag/requirements.txt Removes legacy sample dependencies file.
python/samples/05-end-to-end/hosted_agents/agent_with_text_search_rag/main.py Removes legacy sample implementation.
python/samples/05-end-to-end/hosted_agents/agent_with_text_search_rag/agent.yaml Removes legacy sample agent config.
python/samples/05-end-to-end/hosted_agents/agents_in_workflow/requirements.txt Removes legacy sample dependencies file.
python/samples/05-end-to-end/hosted_agents/agents_in_workflow/main.py Removes legacy sample implementation.
python/samples/05-end-to-end/hosted_agents/agents_in_workflow/agent.yaml Removes legacy sample agent config.
python/samples/05-end-to-end/hosted_agents/agent_with_local_tools/requirements.txt Removes legacy sample dependencies file.
python/samples/05-end-to-end/hosted_agents/agent_with_local_tools/main.py Removes legacy sample implementation.
python/samples/05-end-to-end/hosted_agents/agent_with_local_tools/agent.yaml Removes legacy sample agent config.
python/samples/05-end-to-end/hosted_agents/agent_with_local_tools/README.md Removes legacy sample documentation.
python/samples/05-end-to-end/hosted_agents/agent_with_local_tools/.env.sample Removes legacy env sample.
python/samples/05-end-to-end/hosted_agents/agent_with_local_tools/.dockerignore Removes legacy docker ignore.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/requirements.txt Removes legacy sample dependencies file.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/main.py Removes legacy sample implementation.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/agent.yaml Removes legacy sample agent config.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/README.md Removes legacy sample documentation.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/Dockerfile Removes legacy Dockerfile.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/.env.sample Removes legacy env sample.
python/samples/05-end-to-end/hosted_agents/writer_reviewer_agents_in_workflow/.dockerignore Removes legacy docker ignore.

Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/README.md
Comment thread python/packages/core/agent_framework/_telemetry.py
@TaoChenOSU
Tao Chen (TaoChenOSU) marked this pull request as ready for review April 17, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants