Python: wake workflow streaming on iteration completion - #8231
Open
Naveen (1aifanatic) wants to merge 3 commits into
Open
Python: wake workflow streaming on iteration completion#8231Naveen (1aifanatic) wants to merge 3 commits into
Naveen (1aifanatic) wants to merge 3 commits into
Conversation
Naveen (1aifanatic)
temporarily deployed
to
github-app-auth
September 10, 2026 12:13 — with
GitHub Actions
Inactive
Naveen (1aifanatic)
temporarily deployed
to
github-app-auth
September 10, 2026 12:13 — with
GitHub Actions
Inactive
Naveen (1aifanatic)
temporarily deployed
to
github-app-auth
September 10, 2026 12:13 — with
GitHub Actions
Inactive
Naveen (1aifanatic)
temporarily deployed
to
github-app-auth
September 10, 2026 12:13 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation handles completion and event races correctly, cleans up owned tasks, and includes focused regression coverage.
Pull request overview
Eliminates workflow superstep polling latency by waking on iteration completion or event arrival, with robust task cleanup.
Changes:
- Replaces timer polling with concurrent task waiting.
- Adds event-ordering, failure, completion, and cleanup regressions.
- Makes concurrency testing deterministic with explicit gates.
File summaries
| File | Description |
|---|---|
python/packages/core/agent_framework/_workflows/_runner.py |
Implements completion-driven streaming and task cleanup. |
python/packages/core/tests/workflow/test_runner.py |
Covers wake-up, ordering, failures, and stream closure. |
python/packages/core/tests/workflow/test_workflow.py |
Removes timing dependence from concurrency testing. |
Review details
- Files reviewed: 3/3 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.
Naveen (1aifanatic)
marked this pull request as ready for review
September 10, 2026 12:16
Naveen (1aifanatic)
temporarily deployed
to
github-app-auth
September 10, 2026 12:16 — with
GitHub Actions
Inactive
Naveen (1aifanatic)
deployed
to
github-app-auth
September 11, 2026 02:21 — with
GitHub Actions
Active
Naveen (1aifanatic)
requested review from
SergeyMenshykh,
Roger Barreto (rogerbarreto) and
westey (westey-m)
as code owners
September 12, 2026 04:39
Naveen (1aifanatic)
deployed
to
github-app-auth
September 12, 2026 04:40 — 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
The workflow runner waits up to 50 ms for another event before noticing that a superstep has finished. For fast executors, that polling delay dominates execution time. This implements the runtime follow-up to the bottleneck identified by Shivani . (@Shivani767) in #3686, without duplicating the proposed benchmark script.
Description & Review Guide
Related Issue
Contributes to #3686. This addresses the reported polling bottleneck; it does not close the broader benchmark/performance-testing issue. No competing open runtime PR for this issue was found during preflight. Scope was proposed in the issue before implementation.
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.