Python: fix(core): allow checkpoint deserialization for orchestrations - #8723
Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Conversation
When workflows using orchestrations request types like HandoffAgentUserRequest or MagenticPlanReviewRequest are checkpointed and restored under restricted decoding, deserialization fails because _FRAMEWORK_MODULE_PREFIX only matches the agent_framework. dotted prefix. Expanding the prefix tuple to include agent_framework_orchestrations. allows first party orchestration requests to roundtrip cleanly without manual allowlist additions. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
September 24, 2026 11:51 — with
GitHub Actions
Active
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
September 24, 2026 11:51 — with
GitHub Actions
Active
This branch was successfully deployed
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
When workflows using orchestrations request types such as HandoffAgentUserRequest or MagenticPlanReviewRequest are checkpointed and resumed under restricted decoding, deserialization fails with an error stating that deserialization is blocked for the type.
This occurs because _RestrictedUnpickler in _checkpoint_encoding.py checks whether the module begins with _FRAMEWORK_MODULE_PREFIX, which is set to "agent_framework.". That string matches the core package but rejects the sibling package agent_framework_orchestrations.
Description & Review Guide
What are the major changes?
Replaced _FRAMEWORK_MODULE_PREFIX with a tuple _FRAMEWORK_MODULE_PREFIXES containing both "agent_framework." and "agent_framework_orchestrations.". Updated _is_allowed_type and find_class to use startswith with the tuple. Updated the docstrings in _checkpoint_encoding.py and _checkpoint.py to reflect that orchestrations internal types are included in the default safe set. Added a regression test validating that pending orchestration requests roundtrip through restricted decoding.
What is the impact of these changes?
Workflows hosted as agents or persisted with checkpoint storage can now deserialize pending handoff and plan review requests without requiring callers to manually register those types.
What do you want reviewers to focus on?
Verification that the tuple prefix check in find_class and _is_allowed_type correctly allows the orchestration types while preserving existing safety restrictions against arbitrary nested dotted names.
Related Issue
Fixes #7618
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.