Skip to content

feat(advanced): release the advanced agent changes as 0.16.19 - #1092

Merged
radu-mocanu merged 8 commits into
release/uipath-langchain-0.16.16from
hotfix/uipath-langchain-0.16.19
Sep 16, 2026
Merged

radu-mocanu merged 8 commits into
release/uipath-langchain-0.16.16from
hotfix/uipath-langchain-0.16.19

Conversation

@radu-mocanu

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

Copy link
Copy Markdown
Collaborator

Summary

  • moves advanced agents to deepagents 0.7.11, with the code-interpreter extra for the QuickJS tool
  • honors the configured max iterations and 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 and exposes the agent resource name in MCP tool metadata

Why

the release branch pinned by the s202 runtime needs the advanced agent work from main without the unrelated changes that landed in 0.17 and 0.18. cherry-picked from main in order: #1061, #1073, #1078, #1054, #1079, #1071, #1081. dependency floors are exactly the ones #1054 raised, everything else (uipath, mcp, langchain client) stays where 0.16.18 had it.

Copilot AI lite review requested due to automatic review settings September 16, 2026 10:25

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

Four moderate issues remain in response validation, iteration-limit validation, backend-factory attachment hydration, and attachment-block replacement.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This hotfix backports advanced-agent iteration limits, attachment hydration, Gemini function-call handling, and version 0.16.19.

Changes:

  • Adds per-turn iteration limits and shared termination errors.
  • Downloads conversational attachments and exposes safe workspace paths.
  • Adds payload validation, tests, and release metadata updates.

Open review findings:

  • src/uipath_langchain/agent/advanced/agent.py:242 — Moderate, 1 vote: empty or non-AI responses can bypass the empty-answer guard.
  • src/uipath_langchain/agent/advanced/agent.py:191 — Moderate, 1 vote: non-positive iteration limits are not rejected at the builder boundary.
  • src/uipath_langchain/agent/advanced/utils.py:193 — Moderate, 2 votes: backend factories can silently skip attachment hydration.
  • src/uipath_langchain/agent/advanced/utils.py:134 — Moderate, 1 vote: user text beginning with the attachment prefix can be overwritten.
File summaries
File Description
uv.lock Updates the locked package version.
tests/agent/advanced/test_utils.py Tests attachment resolution and rendering.
tests/agent/advanced/test_payload_handler_middleware.py Tests payload and subagent behavior.
tests/agent/advanced/test_max_iterations.py Tests iteration limits.
tests/agent/advanced/test_create_advanced_agent_graph.py Updates middleware assertions.
tests/agent/advanced/test_conversational_advanced_agent_graph.py Tests conversational attachment handling.
src/uipath_langchain/runtime/messages.py Uses shared attachment rendering.
src/uipath_langchain/agent/react/llm_node.py Uses shared iteration errors.
src/uipath_langchain/agent/exceptions/exceptions.py Adds an iteration error factory.
src/uipath_langchain/agent/exceptions/__init__.py Exports the error factory.
src/uipath_langchain/agent/advanced/utils.py Resolves conversational attachments.
src/uipath_langchain/agent/advanced/agent.py Adds iteration and payload middleware.
src/uipath_langchain/_utils/_attachments.py Centralizes safe attachment rendering.
pyproject.toml Bumps the package version to 0.16.19.
Review details

Suppressed comments (3)

src/uipath_langchain/agent/advanced/agent.py:244

  • The early return for a response with no AIMessage bypasses the new empty-answer guard. A ModelResponse(result=[]) (or one containing only non-AI messages) therefore still reaches the deepagents terminal path with neither text nor a tool call, which is the failure this middleware is intended to reject. Treat an empty/non-AI result as LLM_INVALID_RESPONSE unless a structured response is present.
        messages = [m for m in response.result if isinstance(m, AIMessage)]
        if not messages:
            return

src/uipath_langchain/agent/advanced/agent.py:196

  • This path accepts max_iterations=0 or a negative value, unlike AgentGraphConfig.llm_messages_limit which is validated with ge=1. Those values make _check_budget reject the first model call with a misleading termination error instead of failing configuration validation; reject non-positive limits at the builder boundary.
def _max_iterations_middleware(
    max_iterations: int | None, initial_message_count_key: str | None = None
) -> list[AgentMiddleware[Any, Any]]:
    if max_iterations is None:
        return []
    return [_MaxIterationsMiddleware(max_iterations, initial_message_count_key)]

src/uipath_langchain/agent/advanced/utils.py:134

  • This rewrites every content block whose text merely starts with the attachment prefix. A user can legitimately send text beginning with <uip:attachments> alongside a real attachment; the mapper keeps that text block before the generated attachment block, so both blocks match here and the user's text is silently replaced. Only replace the generated attachment block (for example, the last matching block) rather than all prefix matches.
        and block["text"].startswith(ATTACHMENTS_BLOCK_PREFIX)
  • Files reviewed: 13/14 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +193 to +194
backend: BackendProtocol | None,
messages: Sequence[AnyMessage],
@radu-mocanu
radu-mocanu force-pushed the hotfix/uipath-langchain-0.16.19 branch from be47dd6 to 80196e1 Compare September 16, 2026 13:23
@radu-mocanu radu-mocanu changed the title fix(advanced): hotfix 0.16.19 for s202 advanced agents feat(advanced): release the advanced agent changes as 0.16.19 Sep 16, 2026
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu merged commit fe73809 into release/uipath-langchain-0.16.16 Sep 16, 2026
17 checks passed
@radu-mocanu
radu-mocanu deleted the hotfix/uipath-langchain-0.16.19 branch September 16, 2026 13:48
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.

4 participants