Skip to content

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

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 LangGraph and deepagents agents now keep the files they write across suspend and resume. The factory opts in to the CLI-managed workspace from UiPath/uipath-python#1976, and UiPathWorkspaceBackend gives deepagents a file backend rooted in that workspace.

Changes

  • UiPathWorkspaceBackend (agent/advanced/workspace_backend.py) is a deepagents FilesystemBackend that looks up its root with get_workspace_path() on every file operation. Coded graphs are built once at import, before any run, so a root fixed when the graph is built would never be the run's folder. Outside a managed run (local runs, uipath dev, older CLIs) it uses one temp folder and logs a warning naming it. It never falls back to the project folder, so an agent can't edit the project's files.
  • get_settings() returns managed_workspace=True. Older CLIs ignore the flag.
  • Docs: a "Keeping files across suspend and resume" section in docs/human_in_the_loop.md, for the backend and for plain tools that call get_workspace_path().
  • Sample: samples/deepagent-workspace-files, a deepagents agent that writes /report.md, suspends on interrupt() for a review, and edits the same file after resume. Its review tool reads the draft from disk with plain Python, which is the case for real files over DeepAgents' default StateBackend.
  • Version 0.18.57 (0.18.56 is taken by the open PC-5320 work).

Note

This works with the released uipath-runtime. The docs describe CLI behavior from UiPath/uipath-python#1976, so release that first or together. uipath-agents overrides get_settings with the flag off, so low-code agents aren't wrapped twice.

Testing

  • New tests: the backend reads, writes, lists, globs and greps inside the managed folder; a file written in one run is back after resume; traversal outside the folder is blocked; the fallback folder is created once. The factory test checks the flag.
  • Full suite in this repo's own venv: 4247 passed.
  • Live on alpha with the four PR branches installed together: a coded LangGraph job writes through UiPathWorkspaceBackend, suspends on interrupt(), and uipath run --resume in a new process reads the file back from job attachments.
  • The sample, live on alpha with an existing job key: run 1 wrote /report.md and suspended in request_review. uipath run --resume in a new process ran edit_file on the restored file, and the final report included the feedback. Without a job key, the resume finds no draft, as its README says.
  • Not run: a real serverless job.

🤖 Generated with Claude Code

… resume

Files a coded LangGraph or deepagents agent writes are lost when its
job suspends and resumes on another machine. The factory now opts in
to the host-managed workspace, so the uipath CLI persists the run's
workspace folder as job attachments.

UiPathWorkspaceBackend is a deepagents FilesystemBackend that looks up
the current run's folder on every file operation. Coded graphs are
built once at import time, before any run, so a root fixed at build
time would point at the wrong folder. Outside a managed run it uses
one temporary folder and logs a warning, and never the project folder.

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

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

Shows UiPathWorkspaceBackend in a job: the agent writes a report,
suspends for a human review, and edits the same file after it
resumes. Its review tool opens the draft from disk with plain Python,
which is the reason to keep files on disk instead of in DeepAgents'
default StateBackend.

The tool tolerates a missing draft, because LangGraph re-runs an
interrupted tool from the top on resume, and a local run without a
job starts the resume in a new, empty folder.

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

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant