Python: Forward invocation kwargs during nested workflow cancellation - #8602
Draft
WhaleTech (ryo-whaletech) wants to merge 2 commits into
Conversation
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 21, 2026 16:35 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 21, 2026 16:35 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 21, 2026 16:35 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 21, 2026 16:35 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
WhaleTech (ryo-whaletech)
September 21, 2026 16:36
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The stale omitted-channel clearing behavior needs targeted regression coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Forwards request-scoped invocation kwargs into nested workflow cancellation.
Changes:
- Extracts shared child-kwargs resolution logic.
- Adds nested cancellation regression coverage.
| File | Description |
|---|---|
_workflow_executor.py |
Forwards both kwargs channels during cancellation. |
test_workflow_kwargs.py |
Tests replacement kwargs in child cancellation. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 21, 2026 17:50 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 21, 2026 19:16 — with
GitHub Actions
Active
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 cancellation of a propagated child request supplies replacement function-invocation or client kwargs, the parent workflow commits those values but the nested
WorkflowExecutorforwards only runtime tools. The child then preserves its earlier kwargs instead of applying the active cancellation context. This change carries the request-scoped kwargs across that nested continuation boundary, consistent with the existing workflow replacement semantics. Supplying only one kwargs channel also clears the child's stale omitted peer channel rather than preserving it.Description & Review Guide
function_invocation_kwargs, and onlyclient_kwargs; each single-channel case verifies that the omitted peer is cleared.WorkflowInvocationKwargsresolution in the child namespace. PR Python: Scope workflow invocation kwargs by executor graph #8596 changes the same extraction path to enforce executor-graph scoping; if it lands first, this PR will be rebased so cancellation forwarding retains those scoping rules.Related Issue
Fixes #8601
Related: #8596 scopes invocation kwargs at nested workflow start boundaries, while this PR addresses the separate cancellation-continuation boundary. The cancellation regression still reproduces on #8596's current head, so the PRs are complementary rather than duplicates. Both modify
_workflow_executor.py; this PR remains a draft and will be rebased and revalidated if #8596 lands first. No other open PR directly addresses #8601.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.