Skip to content

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

Merged
radu-mocanu merged 1 commit into
mainfrom
chore/deepagents-0.7.11
Sep 12, 2026
Merged

chore(deps): migrate to deepagents 0.7.11#1054
radu-mocanu merged 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
  • drop the write_todos tool, following the benchmark deepagents 0.7.0 based its own removal on
  • 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).

mode is a parameter rather than a constant. "thread" snapshots the REPL into the checkpoint, so state survives a suspend and resume, at a fixed ~1.25 MB per checkpoint thread written even when the agent never calls eval. That only pays off where a later run reads it back, so a caller whose runs each get their own thread should pass "turn", which writes nothing. Upstream renders the tool description from the mode, so the model is told the correct semantics either way.

write_todos removed

deepagents 0.7.0 dropped TodoListMiddleware from its defaults after benchmarking across three models: no statistically significant accuracy gain on any of them, and higher token use on two (langchain-ai/deepagents#4929). This follows that rather than restoring it, and pins the absence with a test so a future change has to be deliberate.

Kept as its own commit, so it can be reverted without touching the version bump.

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.

Advanced agents no longer expose write_todos. A caller that wants it can pass middleware=[TodoListMiddleware()]; the middleware injects its own usage prompt, so no caller prompt needs to describe the tool.

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. delete is deliberately not withheld: an agent can already replace a file with write_file, and letting it clean up scratch files reduces orphan job attachments.

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 3 times, most recently from 731f71c to 514e3ad Compare September 2, 2026 11:17
@radu-mocanu
radu-mocanu force-pushed the chore/deepagents-0.7.11 branch 4 times, most recently from f2716bf to df0b0f3 Compare September 10, 2026 12:29
# context and returns a single text report, so an attachment it uploads is real but
# its reference never reaches the main agent -- the only agent that fills the typed
# output. Observed result: two orphan attachments and a faulted job.
MAIN_AGENT_ONLY_TOOLS: frozenset[str] = frozenset({OUTPUT_FILE_TOOL_NAME})

@radu-mocanu radu-mocanu Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this implementation will change. subagents will have access to the generate_attachment tool (since they can pass a file as input to other tools). will be done in a subsequent PR

@radu-mocanu
radu-mocanu force-pushed the chore/deepagents-0.7.11 branch 7 times, most recently from 1928eca to 9e1c62b Compare September 12, 2026 20:30
…eter

BREAKING CHANGE: `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 to alias it to. Pass a `BackendProtocol` instance.
Advanced agents also no longer expose `write_todos`.

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

Code interpreter, behind the optional `code-interpreter` extra:
`build_code_interpreter_middleware(tools)` gives the agent one `eval` tool, a
JavaScript REPL in a WASM guest, with eligible tools callable from inside it. The
dependency is an extra because wasmtime and the guest are ~27 MB on disk, and the
import is deferred into the factory so the package still imports without it.

The PTC allowlist is derived, never hand-written. It drops tools that suspend the
run, since a replayed node re-runs every bridged call made before the interrupt
and such bridges do not reach approval hooks; names that cannot be JavaScript
identifiers, which upstream rejects mid-turn; and camelCase collisions, which
upstream does not dedupe. `SUSPENDS_RUN` marks the first class at the point where
the suspension happens, so a new suspending factory cannot silently become
reachable from the sandbox.

`mode` is a parameter. `"thread"` snapshots the REPL into the checkpoint, a fixed
~1.25 MB per thread written even when the agent never calls `eval`, which only
pays off where a later run reads it back.

write_todos is dropped rather than restored: deepagents removed
`TodoListMiddleware` from its defaults after benchmarking three models and finding
no significant accuracy gain and higher token use on two
(langchain-ai/deepagents#4929).

Subagents no longer inherit the main agent's full tool list, so a tool that only
the main agent may hold stays there. deepagents hands a subagent the parent list
unless its spec declares its own, so each spec now pins `tools`.

Also: `write_file` now replaces an existing file rather than erroring, a recursive
`delete` appears whenever the backend supports it and is deliberately not withheld,
and 0.7.0 empties `BASE_AGENT_PROMPT`, so agents run on the lean prompt.
@radu-mocanu
radu-mocanu force-pushed the chore/deepagents-0.7.11 branch from 9e1c62b to bf0085f Compare September 12, 2026 20:39
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu merged commit 165e299 into main Sep 12, 2026
48 checks passed
@radu-mocanu
radu-mocanu deleted the chore/deepagents-0.7.11 branch September 12, 2026 21:05
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