Python: restore WorkflowAgent pending request state across AgentSession resume#6122
Draft
Copilot wants to merge 4 commits into
Draft
Python: restore WorkflowAgent pending request state across AgentSession resume#6122Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix AgentSession pending request resume failure in Python
Python: restore WorkflowAgent pending request state across AgentSession resume
May 27, 2026
TaoChenOSU
reviewed
May 27, 2026
| ) | ||
| # combine the messages | ||
| session_messages: list[Message] = session_context.get_messages(include_input=True) | ||
| workflow_input_messages = input_messages if self.pending_requests else session_messages |
Contributor
Author
There was a problem hiding this comment.
Good catch — it wasn’t required for functionality. I reverted that simplification and restored the previous explicit form in commit aee043d.
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
Magentic workflows that pause on
request_info(human plan review) could not be resumed afterAgentSessionserialization/restore, even when replying with the originalrequest_id. The resumed run lost pending-request correlation and failed instead of continuing execution.Description
Pending request persistence in
AgentSessionWorkflowAgentnow stores pendingrequest_infometadata insession.state["workflow_agent"]["pending_request_info_events"]and rehydrates it on subsequent runs.Resume path now supports restore+response in one call
WorkflowAgentforwardscheckpoint_idandcheckpoint_storagetogether withresponsesintoworkflow.run(...), so checkpoint restore and request fulfillment happen on the same execution path.Pending-response input handling
Regression coverage
request_infoAgentSessionrequest_idContribution Checklist