Repository navigation
Python: Finalize abandoned graph workflow streams without OTel context leaks - #8398
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 3 commits intoSep 16, 2026
Conversation
WhaleTech (ryo-whaletech)
temporarily deployed
to
github-app-auth
September 15, 2026 14:15 — with
GitHub Actions
Inactive
WhaleTech (ryo-whaletech)
temporarily deployed
to
github-app-auth
September 15, 2026 14:15 — with
GitHub Actions
Inactive
WhaleTech (ryo-whaletech)
temporarily deployed
to
github-app-auth
September 15, 2026 14:16 — with
GitHub Actions
Inactive
WhaleTech (ryo-whaletech)
temporarily deployed
to
github-app-auth
September 15, 2026 14:16 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Pull request overview
Updates graph workflow tracing to prevent OpenTelemetry context leaks when streams are abandoned while preserving span parenting.
Changes:
- Scopes workflow span activation around execution and runner pulls.
- Adds abandoned-stream cleanup tests.
- Verifies span hierarchy and caller context preservation.
File summaries
| File | Summary |
|---|---|
python/packages/core/tests/workflow/test_workflow.py |
Tests abandoned-stream cleanup. |
python/packages/core/tests/workflow/test_workflow_observability.py |
Verifies span hierarchy and context preservation. |
python/packages/core/agent_framework/_workflows/_workflow.py |
Updates graph workflow span lifecycle. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Eduard van Valkenburg (eavanvalkenburg)
left a comment
Member
There was a problem hiding this comment.
I reviewed the complete diff and found no actionable code issues. Since this PR is still a draft, I’m leaving this as a comment rather than an approval; please mark it ready when you want the approval-gated checks and final review.
WhaleTech (ryo-whaletech)
temporarily deployed
to
github-app-auth
September 16, 2026 08:40 — with
GitHub Actions
Inactive
WhaleTech (ryo-whaletech)
marked this pull request as ready for review
September 16, 2026 08:52
WhaleTech (ryo-whaletech)
temporarily deployed
to
github-app-auth
September 16, 2026 08:52 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
September 16, 2026 10:35 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Sep 16, 2026
This branch was previously deployed
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
Abandoning a graph
Workflow.run(..., stream=True)after a visible event can finalize the generator from another PythonContextwhile itsworkflow.runspan is still attached, loggingFailed to detach context. #7798 established the corresponding lifecycle constraint for functional workflows and identified graph workflows as the remaining follow-up.Description & Review Guide
finally. Add abandonment cleanup coverage and assert the outer-to-workflow-to-executor span chain.Related Issue
Fixes #8397
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.