Skip to content

chore(deps): migrate to deepagents 0.7.11 - #1054

Open
radu-mocanu wants to merge 1 commit into
mainfrom
chore/deepagents-0.7.11
Open

chore(deps): migrate to deepagents 0.7.11#1054
radu-mocanu wants to merge 1 commit into
mainfrom
chore/deepagents-0.7.11

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bump deepagents to 0.7.11, raising the langchain floor to 1.3.18 and langgraph to 1.2.11
  • offer the QuickJS code interpreter to advanced agents, behind the optional code-interpreter extra
  • keep write_todos on advanced agents, since deepagents 0.7.0 dropped TodoListMiddleware from its defaults
  • flag tools that suspend the run, so callers can tell which ones are unsafe to invoke outside the graph's tool node

Code interpreter

build_code_interpreter_middleware(tools) returns middleware giving the agent one eval tool: a persistent JavaScript REPL in a WASM guest, with eligible tools callable from inside it as tools.<camelCaseName>(...). Pass it via middleware= on either advanced graph builder.

It is opt-in twice over. The dependency is an extra (uipath-langchain[code-interpreter]), because wasmtime and the QuickJS guest are ~27 MB on disk and no consumer should carry that unless it asks. The middleware import is deferred into the factory, so importing the package without the extra keeps working and only the factory raises, with install guidance.

The allowlist governing what the sandbox can reach is derived, never hand-written. Three exclusions: tools that suspend the run (a replayed node re-runs every bridged call made before the interrupt, and PTC bypasses approval hooks), names that cannot be JavaScript identifiers (upstream raises mid-turn for those), and camelCase collisions (upstream dedupes by tool name, so binding either would call the wrong tool).

Breaking

BackendFactory is gone from uipath_langchain.agent.advanced, and the backend parameters no longer accept a factory. deepagents 0.7.0 deleted the type, so there is nothing left to alias it to and a factory would be rejected downstream regardless. Pass a BackendProtocol instance instead.

Two behaviour changes come from deepagents itself and are worth knowing before upgrading: write_file now replaces an existing file rather than erroring, and a recursive delete tool appears whenever the backend supports it.

Why

deepagents 0.5.9 is two minor versions behind, and 0.7.x is the floor langchain-quickjs requires, so the code interpreter was not reachable before this.

the base prompt goes with it: 0.7.0 empties BASE_AGENT_PROMPT, which is where its input-token reduction comes from, so this adopts the lean prompt rather than passing the deprecated constant back in.

Copilot AI lite review requested due to automatic review settings August 31, 2026 15:50

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

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates this SDK to work with deepagents==0.7.11 (and the newer LangChain/LangGraph floors it requires), while preserving advanced-agent behavior and making “run-suspending” tools discoverable via tool metadata.

Changes:

  • Bump dependency floors (deepagents/langchain/langchain-core/langgraph) and update lockfile.
  • Keep write_todos available by explicitly prepending TodoListMiddleware and allow caller-supplied middleware on advanced graph builders.
  • Introduce SUSPENDS_RUN metadata + a source-scanning test to ensure suspending tool factories stamp the flag; apply the stamp across relevant tools.
File summaries
File Description
uv.lock Locks updated dependency graph for deepagents 0.7.11 + new LangChain/LangGraph floors.
pyproject.toml Updates package version and runtime dependency minimums.
tests/agent/tools/test_suspends_run_metadata.py New test enforcing SUSPENDS_RUN metadata stamping for suspending tools.
tests/agent/advanced/test_create_advanced_agent_graph.py Makes middleware assertions robust to prepended/appended middleware.
tests/agent/advanced/test_conversational_advanced_agent_graph.py Same as above for conversational wrapper graph tests.
src/uipath_langchain/agent/tools/process_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/tools/ixp_escalation_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/tools/internal_tools/deeprag_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/tools/internal_tools/batch_transform_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/tools/extraction_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/tools/escalation_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/tools/context_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tools/variants.
src/uipath_langchain/agent/tools/client_side_tool.py Stamps SUSPENDS_RUN: True in metadata for suspending tool.
src/uipath_langchain/agent/advanced/utils.py Drops BackendFactory typing from backend parameter to match deepagents changes.
src/uipath_langchain/agent/advanced/agent.py Prepends TodoListMiddleware; accepts/threads caller middleware in advanced graph builders; narrows backend typing.
src/uipath_langchain/agent/advanced/init.py Removes BackendFactory from exports to match deepagents changes.
src/uipath_langchain/_utils/durable_interrupt/decorator.py Adds SUSPENDS_RUN constant + suspends_run() helper.
src/uipath_langchain/_utils/durable_interrupt/init.py Re-exports SUSPENDS_RUN and suspends_run.
samples/simple-deepagent/pyproject.toml Updates sample dependency constraint to deepagents 0.7.11.
samples/deepagent-storage-buckets/pyproject.toml Updates sample dependency constraint to deepagents 0.7.11.
samples/deepagent-storage-buckets/src/deepagent_storage_buckets/buckets_backend.py Updates backend protocol surface/types and read/grep/glob return shapes for deepagents 0.7.x.
Review details
  • Files reviewed: 20/21 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/uipath_langchain/_utils/durable_interrupt/decorator.py
Comment thread src/uipath_langchain/agent/advanced/agent.py
@radu-mocanu
radu-mocanu force-pushed the chore/deepagents-0.7.11 branch 2 times, most recently from 75f87f9 to 731f71c Compare August 31, 2026 16:07
@sonarqubecloud

Copy link
Copy Markdown

The suspending-factory test reads tool sources to check the metadata stamp.
Path.read_text() defaults to the locale codec, which is cp1252 on Windows, and
several of those sources are not ASCII, so the encoding is passed explicitly.

The code interpreter ships behind the optional `code-interpreter` extra rather
than as a hard dependency: wasmtime and the QuickJS guest are ~27 MB on disk,
which no consumer should carry unless it asks for them. The middleware import is
deferred into the factory so importing the package keeps working without it.

The PTC allowlist lives next to SUSPENDS_RUN because the rule governing it is a
property of our tools, not of any one consumer.
@radu-mocanu
radu-mocanu force-pushed the chore/deepagents-0.7.11 branch from 731f71c to 514e3ad Compare September 2, 2026 11:17
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.

2 participants