Python: Add OpenAI types to default checkpoint encoding allow list - #5297
Merged
Evan Mattson (moonbox3) merged 2 commits intoApr 16, 2026
Merged
Conversation
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Adds OpenAI SDK model types to the “always allowed” set for restricted checkpoint deserialization, so workflows using OpenAI objects can be checkpointed/restored without requiring users to manually extend allowed_checkpoint_types.
Changes:
- Expands restricted unpickling allow-list to include OpenAI SDK modules by prefix match.
- Updates FileCheckpointStorage docs to mention OpenAI SDK types are allowed by default.
- Adds tests asserting OpenAI Chat Completions and Responses usage types can round-trip through restricted checkpoint encoding.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py | Adds OpenAI module-prefix allowance to restricted unpickling logic. |
| python/packages/core/agent_framework/_workflows/_checkpoint.py | Updates FileCheckpointStorage docstring to describe OpenAI types as implicitly allowed. |
| python/packages/core/tests/workflow/test_checkpoint_unrestricted_pickle.py | Adds regression tests validating restricted decode accepts OpenAI SDK type instances. |
Evan Mattson (moonbox3)
approved these changes
Apr 16, 2026
Evan Mattson (moonbox3)
approved these changes
Apr 16, 2026
Tao Chen (TaoChenOSU)
deleted the
taochen/python-add-openai-types-to-allow-list
branch
April 16, 2026 03:58
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 and Context
When a workflow using OpenAI services get checkpointed, the file-based checkpoint storage raises the following warning:
Description
Common types should be automatically included. This PR adds OpenAI types.
Contribution Checklist