Skip to content

Python: fix(core): allow checkpoint deserialization for orchestrations - #8723

Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/checkpoint-orchestrations-allowlist
Open

Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/checkpoint-orchestrations-allowlist

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

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

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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>

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Sep 24, 2026

This branch was successfully deployed

1 active deployment
github-app-auth — 57721a13 Deployed Sep 24, 2026 by ManoharPaturi via team_check #5226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Python : checkpoint restore +pending request deserialization failure when hosting workflow as agent with ResponsesHostserver in foundry

2 participants