Skip to content

Python: Restore runtime tools on nested workflow response resume - #8345

Open
WhaleTech (ryo-whaletech) wants to merge 2 commits into
microsoft:mainfrom
ryo-whaletech:codex/restore-nested-workflow-runtime-tools
Open

Python: Restore runtime tools on nested workflow response resume#8345
WhaleTech (ryo-whaletech) wants to merge 2 commits into
microsoft:mainfrom
ryo-whaletech:codex/restore-nested-workflow-runtime-tools

Conversation

@ryo-whaletech

Copy link
Copy Markdown
Contributor

Motivation & Context

A nested WorkflowExecutor forwards request-scoped runtime tools to its child during initial execution and nested cancellation, but currently omits them when resuming the child from a response.

As a result, the resumed child does not receive runtime tools supplied to the current parent continuation, leaving its response handling and subsequent child execution without that request-scoped context.

This restores the response-continuation propagation previously introduced in #7776 and later lost during the nested workflow invocation-kwargs changes in #7963.

Per the repository guidance for approval-resume-related changes, I am opening this as a draft so the concrete regression test and minimal fix are available for review while the core team confirms the intended direction.

Description & Review Guide

  • What are the major changes?

    • Forward the active parent continuation's runtime tools when WorkflowExecutor._handle_response() resumes its child.
    • Add a provider-free regression test covering the nested propagated-response path.
  • What is the impact of these changes?

    • Resumed nested workflows receive the request-scoped runtime tools supplied to the current parent continuation.
    • Existing child function_invocation_kwargs and client_kwargs continuation semantics remain unchanged.
    • Unknown or already-handled response validation remains unchanged.
    • There are no public API, checkpoint/storage-format, cancellation, serialization, or exception-handling changes.
  • What do you want reviewers to focus on?

    • Whether forwarding the active continuation's runtime tools at _handle_response() is the intended restoration of the behavior introduced in Python: Fix AG-UI workflow-as-agent approval resumes #7776.
    • Whether the focused regression coverage captures the nested response-continuation boundary without expanding into the separate nested-cancellation kwargs behavior.

Related Issue

Fixes #8344

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.

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.

🔵 Needs a closer look

The fix is focused and tested, but it modifies a sensitive approval-resume continuation path requiring core-team review.

Pull request overview

Restores request-scoped runtime tools when resuming nested Python workflows.

Changes:

  • Forwards active runtime tools during nested response continuation.
  • Adds regression coverage for propagated responses.
File summaries
File Description
python/packages/core/agent_framework/_workflows/_workflow_executor.py Propagates runtime tools to resumed child workflows.
python/packages/core/tests/workflow/test_sub_workflow.py Verifies tools reach the child response handler.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

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: [Bug]: Nested WorkflowExecutor response resume drops request-scoped runtime tools

3 participants