Python: Allow branching from hosted Foundry conversations - #7526
Open
cecheta wants to merge 3 commits into
Open
Conversation
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python Foundry Hosting integration to support conversation branching by ensuring every Responses turn persists state under its immutable response_id, while conversations also maintain a conversation_id latest-state alias for continuation.
Changes:
- Persist regular-agent session snapshots under every
response_id, and additionally update theconversation_idsnapshot as a “latest turn” alias when a conversation is supplied. - For workflow agents, write checkpoints per-turn under
response_idand update aconversation_idcheckpoint alias to the latest checkpoint after each conversation turn. - Add/extend tests to validate branching behavior for both regular agents and workflow agents (streaming and non-streaming), and update Foundry Hosting docs to reflect the new persistence model.
Show a summary per file
| File | Description |
|---|---|
| python/packages/foundry_hosting/tests/test_responses.py | Adds branching-focused tests for both session snapshots and workflow checkpoints (including streaming). |
| python/packages/foundry_hosting/README.md | Documents the new model: always store under response_id plus a conversation_id latest-state alias. |
| python/packages/foundry_hosting/agent_framework_foundry_hosting/_session_store.py | Updates Foundry session store docstring to describe response-first storage plus conversation aliasing. |
| python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py | Implements response-id-first persistence for sessions and checkpoints; introduces workflow checkpoint finalization to update conversation aliases. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
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.
Motivation & Context
Allow branching from previous response in a conversation, by always storing state for response ID, plus conversation if applicable.
Description & Review Guide
State is now always stored under the response ID. If a conversation is supplied:
Related Issue
Fixes #7524
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.