Skip to content

Python: AgentSession Pending Request Resume Failure #5818

@GeekeRahul

Description

@GeekeRahul

I am using AgentSession to persist and restore workflow execution state in Python. The scenario that fails is Magentic orchestration with human plan review enabled.

When the workflow pauses for human plan review, the SSE stream emits a request_id. I persist the session state, including the pending request metadata, and then try to resume the same session by sending feedback for that same request_id. The session does not resume the pending request and instead errors.

Expected behavior :

If a session pauses on request_info and I restore that same AgentSession later, responding with the same request_id should resume execution successfully.

Question :

How should pending requests in AgentSession be handled after restoring a persisted session? Specifically, if human plan review in Magentic generates a request_id and that pending request is saved in session state, what is the correct way to resume it later using the same request_id?

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent orchestrationIssues related to agent orchestrationbugSomething isn't workingpythontriageworkflowsRelated to Workflows in agent-framework

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions