feat: expose managed workspace during runtime execution#156
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds execution-scoped access to a managed workspace path during HydrationRuntime execution (including streaming), allows factories to advertise managed-workspace capability via settings, and avoids blocking the event loop when deleting workspace directories.
Changes:
- Introduce a
ContextVar-based API (get_workspace_path()) for accessing the managed workspace path only during a managed execution. - Wrap
HydrationRuntime.execute()/.stream()in a workspace execution context so delegates can reliably access the workspace path. - Make workspace cleanup non-blocking by moving
shutil.rmtreeto a background thread; add tests and bump version.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Bumps locked package version to 0.12.6. |
| pyproject.toml | Bumps project version to 0.12.6. |
| tests/workspace/test_workspace_hydration.py | Adds coverage for workspace-path availability only during managed execution. |
| src/uipath/runtime/workspace/workspace.py | Makes workspace disposal non-blocking via asyncio.to_thread. |
| src/uipath/runtime/workspace/hydration.py | Sets/unsets execution-scoped workspace path around hydration + delegate execution/streaming. |
| src/uipath/runtime/workspace/context.py | Adds execution-scoped workspace context (get_workspace_path, _workspace_execution). |
| src/uipath/runtime/workspace/init.py | Re-exports get_workspace_path from workspace package. |
| src/uipath/runtime/factory.py | Adds managed_workspace: bool to factory settings for capability advertisement. |
| src/uipath/runtime/init.py | Re-exports get_workspace_path at top-level runtime package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
radu-mocanu
force-pushed
the
feat/managed-workspace-context
branch
2 times, most recently
from
July 23, 2026 12:46
98c3449 to
8037cad
Compare
radu-mocanu
force-pushed
the
feat/managed-workspace-context
branch
from
July 23, 2026 12:58
8037cad to
59508bb
Compare
|
cristipufu
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.



Summary
Why
Coded-agent nodes need a stable filesystem location that survives a suspended and resumed execution.