Python: Align AG-UI workflow cache scoping - #7277
Merged
moonbox3 merged 2 commits intoJul 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns AG-UI workflow-factory instance caching with the configured Snapshot Scope by propagating the resolved scope into workflow runs even when snapshot persistence is not configured. This ensures that multi-tenant/multi-user deployments don’t accidentally share live in-memory Workflow instances when threadId collides across scopes.
Changes:
- Always pass the resolved Snapshot Scope into the run payload when
snapshot_scope_resolveris provided, even without a snapshot store, soAgentFrameworkWorkflow(workflow_factory=...)caches are correctly partitioned. - Add a regression test validating scope-partitioned workflow-factory caching without snapshot persistence.
- Update docs/comments to clarify that Snapshot Scope is the authorization/cache boundary for both snapshots and live workflow instances.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py | Propagates resolved snapshot scope into input_data whenever a resolver is provided, enabling scoped workflow caching without snapshot persistence. |
| python/packages/ag-ui/agent_framework_ag_ui/_workflow.py | Clarifies that Snapshot Scope is the boundary for both snapshots and in-memory workflow-factory instances. |
| python/packages/ag-ui/tests/ag_ui/test_endpoint.py | Adds coverage ensuring workflow-factory instances are cached per resolved scope even with no snapshot store. |
| python/packages/ag-ui/README.md | Documents that snapshot_scope_resolver also scopes the in-memory workflow cache for workflow factories in multi-user deployments. |
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||
moonbox3
marked this pull request as ready for review
July 23, 2026 06:11
eavanvalkenburg
approved these changes
Jul 23, 2026
moonbox3
enabled auto-merge
July 23, 2026 09:46
TaoChenOSU
approved these changes
Jul 23, 2026
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
Keep workflow-factory instance selection aligned with configured Snapshot Scope.
Description & Review Guide
Related Issue
N/A
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after a language prefix) — a workflow keeps the label and title prefix in sync automatically.