Repository navigation
feat(workspace): add ManagedWorkspace to build workspace persistence [PC-5359] - #175
tudormatei1 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 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(), |
There was a problem hiding this comment.
Right, wrap_conversational() builds the services when it's called. The description overstated it; I narrowed it to say only wrap() defers them.
I'm keeping the code as is. The only caller is uipath-agents, and only inside a conversational job, where credentials are always set. Agents already created UiPath() at that point before this change: https://github.com/UiPath/uipath-agents-python/blob/70c7dbbb54318418d0cb60c881638b2d3885f281/src/uipath_agents/_cli/runtime/factory.py#L398-L405
Deferring it would mean changing ConversationalWorkspaceRuntime to take a hydrator factory instead of a hydrator, which is outside this PR.
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 <[email protected]>
dd6e9e6 to
fd73eff
Compare
|




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. TheuipathCLI 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, as 0.13.8. 0.13.7 was released from main without
ManagedWorkspace. The uipath and uipath-agents PRs requireuipath-runtime>=0.13.8, and their CI fails until it's on PyPI.Changes
ManagedWorkspace(workspace/managed.py) buildsHydrationRuntimeandConversationalWorkspaceRuntimearound one shared hydrator. The attachments and jobs services come in as a factory, so this package stays free of platform code.wrap()creates them on the first run, so building that wrapper needs no credentials.wrap_conversational()creates them when it's called, as uipath-agents did before.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.HydrationRuntimetakes an optionalruntime_idfor outer wrappers to read; agents' telemetry reads it.Testing
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.interrupt(), anduipath run --resumein 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.🤖 Generated with Claude Code