Python: Align AG-UI run continuity - #7662
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aadad05d-2646-405f-8c62-a7a223abfc92
There was a problem hiding this comment.
Pull request overview
Aligns AG-UI runtime behavior across sequential, interrupted, snapshot-backed, and checkpoint-backed runs.
Changes:
- Makes client tool declarations request-scoped.
- Adds workflow interrupt ownership validation and persistence.
- Expands security guidance and regression coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
python/packages/ag-ui/agent_framework_ag_ui/_workflow.py |
Adds workflow interrupt ownership tracking. |
python/packages/ag-ui/agent_framework_ag_ui/_tooling.py |
Removes persistent client-tool registration. |
python/packages/ag-ui/agent_framework_ag_ui/_agent_run.py |
Uses run-local merged tools. |
python/packages/ag-ui/tests/ag_ui/test_endpoint.py |
Adds lifecycle and ownership regressions. |
python/packages/ag-ui/tests/ag_ui/test_tooling.py |
Removes obsolete registration tests. |
python/packages/ag-ui/README.md |
Documents conversation trust boundaries. |
python/packages/ag-ui/AGENTS.md |
Adds security guidance for contributors. |
docs/specs/004-python-function-calling-loop.md |
Records new continuity guarantees. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 3866974e66a6
Model: gpt-5.6-sol
Overview
The PR removes shared chat-client mutation for request-scoped client tools and adds ownership checks for direct shared-workflow interrupts, with focused cross-thread, cross-scope, disconnect, and restart tests. The request-local tool merge is well constrained, but the new workflow ownership registry can be overwritten from stale snapshots, retains abandoned entries without bounds, and can leave a durable checkpoint unusable when its auxiliary metadata write fails.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
3 verified findings remained after source verification (2 high, 1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/ag-ui/agent_framework_ag_ui/_workflow.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aadad05d-2646-405f-8c62-a7a223abfc92
There was a problem hiding this comment.
MAF Automated Review — Iteration 2
Result: Findings reported
Scope: 1 net-new commit(s): 6e4fbbc24bdf
Model: gpt-5.6-sol
Overview
The PR removes the process-wide owner map and binds ownership to live pending event occurrences, which fixes the previously reported stale-snapshot and unbounded-retention paths. The new tests establish fail-closed behavior for explicitly threaded cold resumes and preserve legacy unthreaded resumes. Residual authorization gaps remain where ownerless checkpoint requests and replayed live interrupts are treated as claimable, and checkpoint preflight now bypasses normal workflow error framing.
Reviewed the supplied incremental change set across correctness, security/reliability, architecture, and failure behavior.
4 verified findings remained after source verification (3 high, 1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/ag-ui/agent_framework_ag_ui/_workflow.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aadad05d-2646-405f-8c62-a7a223abfc92
Motivation & Context
This aligns several AG-UI runtime paths that had evolved independently, reducing surprising differences between normal, interrupted, and follow-up runs.
Description & Review Guide
Related Issue
N/A - tracking is handled separately.
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.