| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Reused execution objects can escape detection, and functional continuations accept responses with incompatible types.
Get a fresh assessment by requesting another Copilot review.
Pull request overviewAdds request-scoped agent factories and durable workflow continuation to Python Foundry hosts.
Changes:
| File | Description |
|---|---|
| responses/workflows/README.md | Documents request-scoped workflow hosting. |
| responses/workflows/main.py | Migrates the workflow sample to a factory. |
| responses/resilient_long_running_workflow/README.md | Documents recovery ownership. |
| responses/resilient_long_running_workflow/main.py | Rebuilds recovery workflows per request. |
| responses/declarative_customer_support/README.md | Documents declarative factory behavior. |
| responses/declarative_customer_support/main.py | Creates declarative workflows per request. |
| tests/test_state_store.py | Tests separate Invocations namespaces. |
| tests/test_responses.py | Adapts workflow continuation tests. |
| tests/test_responses_factory.py | Covers Responses factory lifecycle and recovery. |
| tests/test_invocations_factory.py | Covers Invocations factories and persistence. |
| foundry_hosting/README.md | Documents factory and ownership contracts. |
| _state_store.py | Adds Invocations stores and checkpoint-error tracking. |
| _responses.py | Implements request-scoped Responses workflows. |
| _invocations.py | Implements factory-backed Invocations workflows. |
| _agent_factory.py | Adds shared factory and scope-lock utilities. |
| test_functional_workflow.py | Documents functional checkpoint limitations. |
| 0040-python-foundry-request-agent-factories.md | Records the architectural decision. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was a problem hiding this comment.
Result: Findings reported
Scope: full PR (1 commit(s)): 0a3b84d49650
Model: gpt-5.6-sol-fast
The PR adds request-scoped agent factories with strong same-scope serialization, user-isolated persistence, cancellation cleanup, checkpoint consistency checks, and extensive regression coverage. Two gaps remain: ordinary Invocations factory sessions accumulate permanently in a process-wide dictionary, and workflow reuse detection does not cover the mutable executors that the factory contract requires to be fresh. The latter can allow state to bleed between otherwise independent request-local workflows.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (1 high, 1 medium) across 2 files. Details are attached to the affected lines below.
Affected areas: python/packages/foundry_hosting/agent_framework_foundry_hosting/_agent_factory.py, python/packages/foundry_hosting/agent_framework_foundry_hosting/_invocations.py
Sorry, something went wrong.
|
Thanks for the contribution. Before this is ready, could you please:
Once those are addressed, please re-request review. Thanks! |
Sorry, something went wrong.
Validate functional response batches before state changes, persist ordinary Invocations factory sessions, and document fresh execution objects as the factory author responsibility. Stabilize recovery fixtures and correct CI test typing.
Require recorded completion for both Invocations workflow types. Preserve stored state when incomplete continuation is rejected.
There was a problem hiding this comment.
For me, the fix itself is overengineered and too complex for what it is trying to solve, and it really feels like a bandaid over something we need to fix in the first place (the use of workflow.as_agent itself, rather then just leveraging the workflow directly). So if we are making a breaking change in this space, we should fix that.
Sorry, something went wrong.
Keep checkpoint error policy with the workflow runtime. Add HTTP coverage for request-scoped factory behavior.
| Back | FazBrowse Home | New Git URL |
Motivation & Context
Foundry-hosted workflows need request-scoped execution objects while continuing conversations from saved state. A workflow agent retains mutable executor and conversation state that should not be reused for independent requests.
This change adds factory-based construction to both Python Foundry hosts while preserving the existing instance API for ordinary agents.
Description & Review Guide
Related Issue
No linked issue.
Contribution Checklist