Skip to content

Python: [wip]: Prototype foundry hosting workflow adapter#6610

Draft
moonbox3 wants to merge 2 commits into
microsoft:mainfrom
moonbox3:prototype/hosted-workflow-conversation-adapter
Draft

Python: [wip]: Prototype foundry hosting workflow adapter#6610
moonbox3 wants to merge 2 commits into
microsoft:mainfrom
moonbox3:prototype/hosted-workflow-conversation-adapter

Conversation

@moonbox3

@moonbox3 moonbox3 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

An example of using a foundry hosted adapter for workflows

Copilot AI review requested due to automatic review settings June 19, 2026 04:43
@moonbox3 moonbox3 added the python Issues related to the Python codebase label Jun 19, 2026
@github-actions github-actions Bot changed the title [wip]: Prototype foundry hosting workflow adapter Python: [wip]: Prototype foundry hosting workflow adapter Jun 19, 2026
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/foundry_hosting/agent_framework_foundry_hosting
   _hosted_workflow_conversation.py79593%47, 108, 132–133, 179
   _responses.py7527989%191–194, 273–274, 288, 291–292, 340–341, 351, 388, 447, 461, 534, 539, 541, 617–618, 921, 934, 1403–1405, 1407, 1454–1455, 1457–1458, 1460–1461, 1463–1464, 1469, 1478, 1481–1483, 1485, 1495, 1499, 1512, 1557–1558, 1560, 1565–1569, 1571, 1578–1579, 1581–1582, 1588, 1590–1594, 1601, 1607, 1629, 1635, 1641, 1643, 1645–1648, 1656, 1658, 1709–1711, 1721–1722
TOTAL40137448588% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
8034 34 💤 0 ❌ 0 🔥 2m 5s ⏱️

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

Prototypes a hosted workflow “conversation adapter” to manage how workflow checkpoints are restored/written across Responses turns, while ensuring per-request workflow agent state isolation.

Changes:

  • Adds HostedWorkflowConversationAdapter / HostedWorkflowConversationTurn to centralize checkpoint context selection (fresh / previous_response_id / conversation_id) and pruning behavior.
  • Updates ResponsesHostServer._handle_inner_workflow to use a per-turn workflow agent copy plus the new adapter for restore/write checkpoint storage decisions.
  • Extends tests to validate that (a) fresh requests don’t share workflow state and (b) previous_response_id continues from the latest checkpoint; adds dedicated adapter unit tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
python/packages/foundry_hosting/tests/test_responses.py Updates workflow-hosting tests to account for per-turn workflow agent copying and adds state-continuation/isolation coverage.
python/packages/foundry_hosting/tests/test_hosted_workflow_conversation.py New focused tests for the hosted workflow conversation adapter’s checkpoint planning and pruning behavior.
python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py Refactors workflow handling to delegate checkpoint context logic to the new adapter and to run a per-turn copied workflow agent.
python/packages/foundry_hosting/agent_framework_foundry_hosting/_hosted_workflow_conversation.py New adapter module implementing checkpoint storage selection, agent copying, restore, and checkpoint pruning for hosted workflow turns.

@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: 89% | Result: All clear

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


Automated review by moonbox3's agents

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.

2 participants