Skip to content

Python: fix Foundry handoff argument serialization#5861

Open
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/foundry-hosting-handoff-arguments
Open

Python: fix Foundry handoff argument serialization#5861
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/foundry-hosting-handoff-arguments

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • serialize dataclass arguments in Foundry hosting function-call output streams
  • keep existing string arguments unchanged and serialize framework objects through to_dict() when available
  • add a streaming regression test for handoff-like request arguments

Fixes #5858

To verify

  • uv run --package agent-framework-foundry-hosting pytest packages\foundry_hosting\tests\test_responses.py -q --basetemp .tmp\pytest -p no:cacheprovider
  • uv run --package agent-framework-foundry-hosting pytest packages\foundry_hosting\tests\test_responses.py::TestStreaming -q --basetemp .tmp\pytest -p no:cacheprovider
  • uv run ruff check packages\foundry_hosting\agent_framework_foundry_hosting\_responses.py packages\foundry_hosting\tests\test_responses.py
  • uv run ruff format --check packages\foundry_hosting\agent_framework_foundry_hosting\_responses.py packages\foundry_hosting\tests\test_responses.py
  • uv run python -m py_compile packages\foundry_hosting\agent_framework_foundry_hosting\_responses.py packages\foundry_hosting\tests\test_responses.py
  • uv run mypy --config-file packages\foundry_hosting\pyproject.toml packages\foundry_hosting\agent_framework_foundry_hosting
  • git diff --check

Copilot AI review requested due to automatic review settings May 14, 2026 19:15
@he-yufeng he-yufeng force-pushed the fix/foundry-hosting-handoff-arguments branch from 596df49 to 6c9fd46 Compare May 15, 2026 05:53
@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the overlap with the newer Foundry Hosting response changes.

Local validation:

uv run --package agent-framework-foundry-hosting pytest packages\foundry_hosting\tests\test_responses.py -q --basetemp .tmp\pytest -p no:cacheprovider
uv run ruff check packages\foundry_hosting\agent_framework_foundry_hosting\_responses.py packages\foundry_hosting\tests\test_responses.py
uv run ruff format --check packages\foundry_hosting\agent_framework_foundry_hosting\_responses.py packages\foundry_hosting\tests\test_responses.py
uv run python -m py_compile packages\foundry_hosting\agent_framework_foundry_hosting\_responses.py packages\foundry_hosting\tests\test_responses.py
git diff --check

Result: Foundry Hosting response tests passed; ruff, format, py_compile, and diff-check passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: Issue with Foundry hosted agents and handoff workflow pattern in agent framework

2 participants