Python: Fix workflow kwargs collision with __global__ executor IDs - #8311
Open
WhaleTech (ryo-whaletech) wants to merge 3 commits into
Open
Python: Fix workflow kwargs collision with __global__ executor IDs#8311WhaleTech (ryo-whaletech) wants to merge 3 commits into
WhaleTech (ryo-whaletech) wants to merge 3 commits into
Conversation
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 17:20 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 17:20 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 17:20 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
WhaleTech (ryo-whaletech)
September 11, 2026 17:21
View session
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 17:21 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Declarative workflow executors cannot consume the new non-mapping state object and will fail when forwarding invocation kwargs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Introduces collision-free workflow kwargs routing while preserving legacy checkpoint compatibility.
Changes:
- Separates global and executor-specific kwargs.
- Updates nested workflow and agent resolution.
- Adds routing and checkpoint regression tests.
File summaries
| File | Description |
|---|---|
_const.py |
Defines structured resolved kwargs. |
_workflow.py |
Normalizes invocation kwargs. |
_workflow_executor.py |
Forwards kwargs to nested workflows. |
_agent_executor.py |
Resolves kwargs for agents. |
test_workflow_kwargs.py |
Adds routing and restoration coverage. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 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 11, 2026 17:43 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 17:45 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
WhaleTech (ryo-whaletech)
September 11, 2026 17:46
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Plain mixed global and executor-specific mappings no longer preserve their established merge behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 19:51 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 11, 2026 20:01 — 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
Workflow invocation kwargs previously used the
__global__string as both an internal global marker and a valid executor ID. When a workflow contained an executor named__global__, typed kwargs could overwrite the real global mapping, while plain per-executor mappings could be interpreted as global and leak to sibling executors.This affects both
function_invocation_kwargsandclient_kwargs, including nested workflows and checkpoint continuation. The issue is reproduced in #8310.Review of #7963 had previously identified this namespace collision and established that plain mappings and executor IDs named
__global__should retain their behavior.Description & Review Guide
What are the major changes?
ResolvedWorkflowInvocationKwargsrepresentation with separate global and executor-specific namespaces.What is the impact of these changes?
__global__receives only its targeted kwargs plus any actual global kwargs.__global__executor.__global__remains ordinary global data when it is not an executor ID.Old flattened state involving an actual executor ID named
__global__is intrinsically ambiguous: it cannot reliably distinguish the global namespace from per-executor kwargs for that executor. This limitation belongs to the old representation itself.What do you want reviewers to focus on?
InvokeAzureAgentExecutor.function_invocation_kwargsandclient_kwargs.Validation
uv run poe syntax -P coreanduv run poe syntax -P declarative— passedWorkflow.run()kwargs regressions —8 passeduv run pytest packages/core/tests/workflow/test_workflow_kwargs.py—66 passed, 1 xfailedAgentExecutortests —40 passeduv run pytest packages/declarative/tests—756 passed, 268 skippeduv run pytest packages/core/tests—5179 passed, 23 skipped, 2 xfailed0 errors, 0 warnings, 0 informationsuv run python scripts/workspace_poe_tasks.py build -P coreand-P declarative— passed36/36baseline-required observations matched;0unexpected differencesfunction_invocation_kwargsandclient_kwargscovered across plain, typed, nested, declarative, and checkpoint pathsFileCheckpointStoragerun → checkpoint → restore → continue regression passed__global__remains ordinary global data when no executor routing match existsgit diff --check— passedRelated Issue
Fixes #8310
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.