Skip to content

feat(workspace): add ManagedWorkspace to build workspace persistence [PC-5359] - #175

Open
tudormatei1 wants to merge 1 commit into
mainfrom
feat/PC-5359-coded-workspace-persistence
Open

tudormatei1 wants to merge 1 commit into
mainfrom
feat/PC-5359-coded-workspace-persistence

Conversation

@tudormatei1

@tudormatei1 tudormatei1 commented Nov 4, 2026 •

Copy link
Copy Markdown

Coded agents lose the files they write to disk when their job suspends and resumes. This adds ManagedWorkspace, which builds the workspace hydrator and both wrappers in one place. The uipath CLI uses it to give coded agents the persistence low-code advanced agents already have (UiPath/uipath-python#1976), and uipath-agents drops its own copy of the same wiring (https://github.com/UiPath/uipath-agents-python/pull/867).

Note

Release this first. The uipath and uipath-agents PRs import ManagedWorkspace, and their CI fails until 0.13.7 is on PyPI.

Changes

  • ManagedWorkspace (workspace/managed.py) builds HydrationRuntime and ConversationalWorkspaceRuntime around one shared hydrator. The attachments and jobs services come in as a factory and are created on first use, so building the wrappers needs no credentials and this package stays free of platform code.
  • Breakpoints in HydrationRuntime: a debugger pause no longer uploads the workspace, and the call that continues skips the restore, so edits made before the pause aren't replaced by the last suspended version. This only applies when the call asked for breakpoints. Any other suspend uploads as before.
  • HydrationRuntime takes an optional runtime_id for outer wrappers to read; agents' telemetry reads it.
  • Version 0.13.7.

Testing

  • New tests for ManagedWorkspace: resume restores files, services are created lazily, both wrappers share one hydrator, a folder it creates is removed and a caller's folder is kept.
  • New breakpoint tests: continue keeps edits and deletions, a suspend after a breakpoint is restored on resume, only the first call after a pause skips the restore, and a breakpoint-shaped result from a run that asked for no breakpoints still uploads.
  • Live on alpha with the four PR branches installed together: a coded LangGraph job writes a file, suspends on interrupt(), and uipath run --resume in a new process reads it back from job attachments. With the langchain opt-in turned off, the same check fails. The script is in my local playground, not in a repo.
  • Not run: a real serverless or robot job. The live check used an existing job key as a stand-in.

🤖 Generated with Claude Code

Coded agents lose the files they write when a job suspends and
resumes. The wiring that builds the hydrator and the hydration and
conversational wrappers lived only in uipath-agents. ManagedWorkspace
builds them around one hydrator, so the uipath CLI and uipath-agents
can share it.

HydrationRuntime takes an optional runtime_id for outer wrappers, so
uipath-agents can drop the subclass that only added that attribute.

A debugger pause no longer uploads the workspace, and the call that
continues skips the restore, so edits made before the pause stay.
This applies only when the call asked for breakpoints; any other
suspend uploads as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@tudormatei1
tudormatei1 marked this pull request as ready for review November 5, 2026 08:37
@tudormatei1
tudormatei1 requested review from a team and cristipufu as code owners November 5, 2026 08:37
Copilot AI balanced review requested due to automatic review settings November 5, 2026 08:37

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.

🟡 Changes recommended

The conversational wrapper invokes the services factory during construction, so credential validation can fail before execution, violating the stated credential-free wrapper construction guarantee.

1 open issue
What changed in this PR

Adds ManagedWorkspace to centralize workspace persistence wiring for coded agents and downstream integrations, helping preserve files across job suspension and resume.

Changes:

  • Adds shared workspace, hydrator, and wrapper construction with public exports.
  • Preserves local workspace changes across debugger pauses and exposes runtime_id.
  • Adds persistence and breakpoint tests and bumps the package to 0.13.7.
File Description
uv.lock Updates the locked package version to 0.13.7.
tests/​workspace/​test_workspace_hydration.py Tests breakpoint continuation and suspension persistence.
tests/​workspace/​test_managed_workspace.py Tests wrapper wiring, service initialization, persistence, and cleanup.
src/​uipath/​runtime/​workspace/​managed.py Adds shared workspace and wrapper construction.
src/​uipath/​runtime/​workspace/​hydration.py Handles debugger pauses and exposes runtime identity.
src/​uipath/​runtime/​workspace/​__init__.py Exports the new workspace APIs.
src/​uipath/​runtime/​__init__.py Exposes the new APIs at package level.
pyproject.toml Bumps the release version to 0.13.7.

Review effort: Balanced

"""
return ConversationalWorkspaceRuntime(
runtime,
hydrator=self.hydrator(),

This branch has not been deployed

No deployments
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.

2 participants