Skip to content

feat(advanced): release the advanced agent changes as 0.16.7.post3 - #1098

Open
radu-mocanu wants to merge 12 commits into
release/uipath-langchain-0.16.7from
hotfix/uipath-langchain-0.16.7.post3
Open

radu-mocanu wants to merge 12 commits into
release/uipath-langchain-0.16.7from
hotfix/uipath-langchain-0.16.7.post3

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • moves advanced agents to deepagents 0.7.11, with the code-interpreter extra for the QuickJS tool
  • adds conversational runtime prompts to advanced agents
  • honors the configured max iterations, tells the model only one eval may run at a time, downloads chat attachments into the conversational workspace, and sends Gemini a function calling mode on subagent calls
  • lets agents produce output files as job attachments
  • resolves the tool wrapper state type at runtime again, so standard agent tool calls do not fail with "issubclass() arg 1 must be a class"
  • closes the code interpreter REPL from an atexit hook, so an advanced agent process with the code interpreter enabled can exit. langchain-quickjs 0.3.7 closes it from __del__ by blocking on a worker thread that is already gone at interpreter finalization, which left the job process alive forever and the job stuck in Running instead of Suspended. reproduced on the local robot, this affects main as well and needs the same fix there
  • compiles the code interpreter's WebAssembly modules when the graph is built, outside the per-eval deadline. quickjs_rs compiled its source transform module lazily inside the first eval, so on a CPU-starved instance the first advanced run of a fresh process failed at its first model call with interrupted and the retry passed.. the warm-up is exposed so the pooled server can run it at boot

https://claude.ai/code/session_013CLJG6q56YoHrgNTgm3pA3

Copilot AI lite review requested due to automatic review settings September 17, 2026 07:42
@radu-mocanu
radu-mocanu force-pushed the hotfix/uipath-langchain-0.16.7.post3 branch from b877652 to 64ef583 Compare September 17, 2026 08:01
Copilot stopped reviewing on behalf of radu-mocanu due to an error September 17, 2026 08:03

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.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

This PR adds first-class support for output-file attachments (discovering file fields in output schemas, injecting a file-publishing tool, and verifying references at termination), while also hardening/expanding the advanced agent runtime (payload handling, max-iteration budgeting, chat attachment hydration, and an optional QuickJS code interpreter with a security-driven allowlist).

Changes:

  • Introduces output-file discovery/prompting/verification, plus an internal create_output_file tool and schema utilities for job attachments.
  • Adds SUSPENDS_RUN tool metadata and tests to prevent suspending tools from being reachable via unsafe bridges (notably the code interpreter).
  • Refactors attachment+JSON utilities into shared modules and updates advanced agent wrapper behavior (runtime prompts, iteration caps, payload handling, and message attachment hydration).

Reviewed changes

Copilot reviewed 58 out of 62 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/runtime/test_chat_message_mapper_workspace.py Removes standalone workspace/attachment mapping tests (coverage moved/changed elsewhere).
tests/runtime/test_chat_message_mapper.py Adds coverage for assistant external-value attachment mapping.
tests/agent/tools/test_suspends_run_metadata.py Adds AST-based contract test enforcing SUSPENDS_RUN stamping.
tests/agent/tools/internal_tools/test_output_file_tool.py Adds tests for the internal output-file tool, schema, and path safety.
tests/agent/react/test_output_files_node.py Adds tests for the termination gate verifying output file references.
tests/agent/react/test_json_utils.py Updates imports after moving JSON helpers into attachments utilities.
tests/agent/attachments/test_output_files.py Adds tests for output schema file-field discovery, prompting, and verification logic.
tests/agent/advanced/test_utils.py Adds tests for message attachment hydration into workspace paths and attachment-block rendering.
tests/agent/advanced/test_payload_handler_middleware.py Adds coverage for advanced-agent payload middleware (Gemini tool_config, stop reasons, empty answer rejection).
tests/agent/advanced/test_max_iterations.py Adds coverage for per-turn iteration budgeting in advanced agents.
tests/agent/advanced/test_main_agent_only_tools.py Adds contract test ensuring main-agent-only tools never reach subagents.
tests/agent/advanced/test_create_advanced_agent_graph.py Expands wrapper-graph tests (runtime prompt middleware lookup, output-file verification node insertion).
tests/agent/advanced/test_create_advanced_agent.py Updates expectations around built-in tools (files tools present; todo tool absent).
tests/agent/advanced/test_conversational_advanced_agent_graph.py Adds conversational wrapper tests (runtime prompts, alias handling, attachment hydration, custom output extraction).
tests/agent/advanced/test_code_interpreter_replay.py Adds end-to-end replay test validating why task() must be withheld when suspension is possible.
tests/agent/advanced/test_code_interpreter_persistence.py Adds subprocess test for REPL persistence across process restarts via checkpointing.
tests/agent/advanced/test_code_interpreter.py Adds comprehensive tests for code interpreter allowlist policy and sandbox behavior.
src/uipath_langchain/runtime/runtime.py Updates client-side tool info import to a shared contracts module.
src/uipath_langchain/runtime/messages.py Switches to shared attachments-block renderer and changes external-value mapping behavior.
src/uipath_langchain/agent/wrappers/job_attachment_wrapper.py Moves attachment/JSON helper imports and reduces runtime imports via TYPE_CHECKING.
src/uipath_langchain/agent/tools/process_tool.py Stamps SUSPENDS_RUN and updates job attachment helper import.
src/uipath_langchain/agent/tools/ixp_escalation_tool.py Stamps SUSPENDS_RUN metadata on interrupting tool.
src/uipath_langchain/agent/tools/internal_tools/schema_utils.py Extracts JOB_ATTACHMENT_DEFINITION and a reusable single_attachment_schema.
src/uipath_langchain/agent/tools/internal_tools/output_file_tool.py Adds internal create_output_file tool supporting inline content and workspace file paths.
src/uipath_langchain/agent/tools/internal_tools/deeprag_tool.py Stamps SUSPENDS_RUN metadata.
src/uipath_langchain/agent/tools/internal_tools/batch_transform_tool.py Stamps SUSPENDS_RUN metadata.
src/uipath_langchain/agent/tools/internal_tools/analyze_files_tool.py Updates job-attachment error helper import to shared module.
src/uipath_langchain/agent/tools/extraction_tool.py Stamps SUSPENDS_RUN metadata and updates job attachment imports.
src/uipath_langchain/agent/tools/escalation_tool.py Stamps SUSPENDS_RUN metadata.
src/uipath_langchain/agent/tools/context_tool.py Stamps SUSPENDS_RUN metadata in relevant tool variants.
src/uipath_langchain/agent/tools/client_side_tool.py Moves ClientSideToolInfo to shared contracts; stamps SUSPENDS_RUN.
src/uipath_langchain/agent/react/types.py Adds output-file retries state, verification node enum, and config flag.
src/uipath_langchain/agent/react/router.py Adds optional routing through VERIFY_OUTPUT_FILES for end_execution.
src/uipath_langchain/agent/react/output_files_node.py Adds termination gate node that validates output file references and retries.
src/uipath_langchain/agent/react/llm_node.py Factors max-iterations error creation into a shared helper.
src/uipath_langchain/agent/react/json_utils.py Converts module into a backward-compatible re-export shim.
src/uipath_langchain/agent/react/job_attachments.py Converts module into a backward-compatible re-export shim.
src/uipath_langchain/agent/react/conversational_output_node.py Extracts a reusable conversational-output extractor callable.
src/uipath_langchain/agent/react/agent.py Adds output-file verification node wiring and routing option.
src/uipath_langchain/agent/exceptions/exceptions.py Adds max_iterations_error() helper.
src/uipath_langchain/agent/exceptions/init.py Re-exports max_iterations_error.
src/uipath_langchain/agent/contracts/client_side_tools.py Adds shared ClientSideToolInfo TypedDict contract.
src/uipath_langchain/agent/attachments/pydantic_json.py Adds shared JSONPath + coercion helpers (moved from react/json_utils).
src/uipath_langchain/agent/attachments/output_files.py Adds output-file discovery/prompting/verification logic and constants.
src/uipath_langchain/agent/attachments/job_attachments.py Adds shared job-attachment utilities (moved from react/job_attachments).
src/uipath_langchain/agent/attachments/constants.py Adds shared constant for the output-file tool name.
src/uipath_langchain/agent/advanced/utils.py Enhances advanced utils: configurable state merging, message attachment hydration into workspace, shared attachments block rendering.
src/uipath_langchain/agent/advanced/types.py Fixes defaults for message lists and adds alias validation config for conversational input base.
src/uipath_langchain/agent/advanced/code_interpreter.py Adds optional QuickJS interpreter middleware factory with derived allowlist and replay-safety checks.
src/uipath_langchain/agent/advanced/agent.py Adds payload handler middleware, max-iterations middleware, runtime system prompt resolution, output-file verification, conversation output extraction, and main-agent-only tool filtering.
src/uipath_langchain/agent/advanced/init.py Exposes code-interpreter APIs and removes BackendFactory export.
src/uipath_langchain/_utils/durable_interrupt/decorator.py Introduces SUSPENDS_RUN and suspends_run() helper.
src/uipath_langchain/_utils/durable_interrupt/init.py Re-exports SUSPENDS_RUN and suspends_run.
src/uipath_langchain/_utils/_attachments.py Adds shared, escaped rendering for <uip:attachments>...</uip:attachments> blocks.
samples/simple-deepagent/pyproject.toml Pins deepagents version range used by sample.
samples/deepagent-storage-buckets/src/deepagent_storage_buckets/buckets_backend.py Updates bucket backend to deepagents 0.7.x result types and helpers (ls/read/grep/glob signatures & payload shapes).
samples/deepagent-storage-buckets/pyproject.toml Pins deepagents version range used by sample.
pyproject.toml Bumps package version, updates core dependency versions, and adds code-interpreter extra.
Suppressed comments (2)

src/uipath_langchain/agent/tools/internal_tools/output_file_tool.py:1

  • The traversal check \"..\" in virtual_path is both too broad (rejects legitimate names like /report..md) and too narrow (it doesn’t reason about path segments). Consider validating using a POSIX path parser and rejecting if any path part is exactly '..' (and similarly handling backslashes if they’re possible inputs), before doing the resolve() + containment check.
    src/uipath_langchain/agent/tools/internal_tools/output_file_tool.py:1
  • The MIME type application/jsonl is not a commonly registered/standard type for JSON Lines; many ecosystems use application/x-ndjson (or sometimes application/json). If interoperability matters (downstream consumers relying on a standard MIME), consider switching .jsonl to application/x-ndjson.

💡 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/agent/advanced/utils.py
Comment thread src/uipath_langchain/agent/advanced/utils.py
Comment thread src/uipath_langchain/agent/attachments/output_files.py
… can terminate

langchain-quickjs 0.3.7 closes its QuickJS contexts from __del__ by blocking on
its daemon worker thread. At interpreter finalization that thread no longer
runs, so any process that built the middleware hangs on exit and the robot
never learns the job suspended or finished.
@radu-mocanu
radu-mocanu force-pushed the hotfix/uipath-langchain-0.16.7.post3 branch from 97fe15b to 12909d7 Compare September 18, 2026 08:53
quickjs_rs compiles its source transform WebAssembly module lazily, inside
the first eval of the process, under the same per-call deadline as user
code. On a CPU-starved instance the compile alone outlasts the deadline, so
the first advanced run on a fresh process fails at its first model call
with "interrupted" and a retry on the same process succeeds. Compile it
when the graph is built instead, and expose the warm-up so a host that
preloads modules at process start can run it earlier.

Claude-Session: https://claude.ai/code/session_013CLJG6q56YoHrgNTgm3pA3
(cherry picked from commit 8fd0a1c)
@radu-mocanu
radu-mocanu force-pushed the hotfix/uipath-langchain-0.16.7.post3 branch from b984a5d to ef9f9c1 Compare September 20, 2026 14:45
@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants