Skip to content

feat(cli): keep coded agents' workspace files across suspend and resume [PC-5359] - #1976

Draft
tudormatei1 wants to merge 2 commits into
mainfrom
feat/PC-5359-coded-workspace-persistence
Draft

tudormatei1 wants to merge 2 commits into
mainfrom
feat/PC-5359-coded-workspace-persistence

Conversation

@tudormatei1

@tudormatei1 tudormatei1 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Coded agents now keep the files they write to disk when their job suspends and resumes. A runtime factory opts in with UiPathRuntimeFactorySettings.managed_workspace. uipath run, uipath debug and each eval item then run in a workspace folder that is uploaded as job attachments on suspend and restored on resume. uipath-langchain opts in with UiPath/uipath-langchain-python#1194.

Warning

Needs uipath-runtime 0.13.7 (UiPath/uipath-runtime-python#175). CI fails on the ManagedWorkspace import until it's released. Before merge, raise the pin to uipath-runtime>=0.13.7, <0.14.0 and relock.

Changes

  • wrap_with_managed_workspace (_utils/_managed_workspace.py) wraps only when the factory opts in, the run is a job (UIPATH_JOB_KEY), and the factory has storage. Only jobs resume in a new process, and outside a job there may be no credentials for the attachments client. Local --resume runs therefore don't get their files back.
  • A conversational run also uploads after a successful exchange, because the platform resumes the same job for the next exchange. Other runs upload on suspend only, since nothing reads the files after a successful job.
  • cli_run.py, cli_debug.py and eval/runtime/runtime.py make one call each: outside governance, inside the chat and debug wrappers. Governance's dispose doesn't reach the runtime it wraps, so wrapping inside it would leave the temp folder behind.
  • The eval runtime reads the factory settings once in __aenter__ instead of once per item.
  • Version 2.15.1.

Testing

  • New tests drive the real run and debug commands and the eval runtime, with fakes only for the attachments and jobs APIs and the storage. They cover: files come back after resume, uploads link to the job, the folder key reaches every attachments call, nothing is wrapped outside a job or without the opt-in, conversational exchanges keep files, and each eval item gets its own workspace.
  • Live on alpha with the four PR branches installed together: a coded LangGraph job writes a file, suspends, and uipath run --resume in a new process reads it back from job attachments. Without UIPATH_JOB_KEY, nothing comes back.
  • Not run: this package's own venv, which can't import ManagedWorkspace until runtime 0.13.7 ships. The tests ran in a venv with the local runtime.

🤖 Generated with Claude Code

Coded agents lose the files they write when a job suspends, because
nothing wraps them in HydrationRuntime. A factory can now opt in with
UiPathRuntimeFactorySettings.managed_workspace, and run, debug and
each eval item then get a workspace folder that is uploaded as job
attachments on suspend and restored on resume.

Only job runs are wrapped: only jobs resume in a new process, and
outside a job there are no credentials to build the attachments
client. A conversational run also uploads after a successful
exchange, because the next exchange resumes the same job.

Hydration sits outside governance, whose dispose does not reach the
inner runtime, so the temporary folder is still removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The resume round trip, the conversation policy and folder removal are
already checked by the run/debug command tests or by uipath-runtime's
ManagedWorkspace tests. The settings-read count only pinned an
optimization.

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

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

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

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant