Skip to content

feat: expose managed workspace during runtime execution#156

Merged
radu-mocanu merged 1 commit into
mainfrom
feat/managed-workspace-context
Jul 23, 2026
Merged

feat: expose managed workspace during runtime execution#156
radu-mocanu merged 1 commit into
mainfrom
feat/managed-workspace-context

Conversation

@radu-mocanu

Copy link
Copy Markdown
Collaborator

Summary

  • expose the execution-scoped workspace path to runtime delegates
  • let host-composed runtimes advertise managed workspace support
  • avoid blocking the event loop while cleaning workspaces

Why

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

@radu-mocanu
radu-mocanu requested a review from a team as a code owner July 23, 2026 12:35
Copilot AI review requested due to automatic review settings July 23, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rmtree to 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
radu-mocanu force-pushed the feat/managed-workspace-context branch 2 times, most recently from 98c3449 to 8037cad Compare July 23, 2026 12:46
@radu-mocanu
radu-mocanu force-pushed the feat/managed-workspace-context branch from 8037cad to 59508bb Compare July 23, 2026 12:58
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu requested a review from cristipufu July 23, 2026 13:00
@radu-mocanu
radu-mocanu merged commit db2d5a7 into main Jul 23, 2026
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants