Python: [wip]: Prototype foundry hosting workflow adapter#6610
Draft
moonbox3 wants to merge 2 commits into
Draft
Python: [wip]: Prototype foundry hosting workflow adapter#6610moonbox3 wants to merge 2 commits into
moonbox3 wants to merge 2 commits into
Conversation
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
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/HostedWorkflowConversationTurnto centralize checkpoint context selection (fresh / previous_response_id / conversation_id) and pruning behavior. - Updates
ResponsesHostServer._handle_inner_workflowto 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_idcontinues 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An example of using a foundry hosted adapter for workflows