Skip to content

feat: conversational advanced agent graph builder#974

Merged
radu-mocanu merged 1 commit into
mainfrom
feat/conversational-advanced-workspace
Jul 6, 2026
Merged

feat: conversational advanced agent graph builder#974
radu-mocanu merged 1 commit into
mainfrom
feat/conversational-advanced-workspace

Conversation

@radu-mocanu

Copy link
Copy Markdown
Collaborator

Summary

  • add create_conversational_advanced_agent_graph: wraps the deepagent to speak the conversational contract, taking the exchange history via messages and returning only the newly produced messages as uipath__agent_response_messages
  • the chat message mapper now skips file content-parts on assistant history messages: those are workspace files persisted by the runtime (hydrated into the file backend before the graph runs), not attachments for the LLM

Why

enables conversational advanced (deepagents) agents, whose workspace persists across exchanges through file content-parts on the last assistant message (see uipath-runtime ConversationalWorkspaceRuntime).

Copilot AI review requested due to automatic review settings July 6, 2026 14:50
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

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.

Pull request overview

Adds support for “conversational advanced” (deepagents) execution by introducing a wrapper graph builder that accepts full messages history and returns only newly produced messages as uipath__agent_response_messages. It also updates the chat message mapper to hide assistant-history workspace file content-parts (persisted by the runtime) from being surfaced to the LLM, with tests covering both behaviors.

Changes:

  • Add create_conversational_advanced_agent_graph to wrap deepagents with the conversational input/output contract.
  • Update UiPathChatMessagesMapper to skip assistant-role UiPathExternalValue content parts when mapping history into LLM-visible messages.
  • Add targeted tests for workspace file-part skipping and conversational wrapper output semantics; bump package version to 0.13.25.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uv.lock Lockfile updated for version bump.
pyproject.toml Bumps package version to 0.13.25.
src/uipath_langchain/runtime/messages.py Skips assistant external content-parts (workspace files) when mapping history into LangChain messages.
src/uipath_langchain/agent/advanced/types.py Introduces conversational advanced wrapper state type.
src/uipath_langchain/agent/advanced/agent.py Adds create_conversational_advanced_agent_graph wrapper builder.
src/uipath_langchain/agent/advanced/init.py Exports new conversational advanced builder and state.
tests/runtime/test_chat_message_mapper_workspace.py Tests that assistant workspace file parts are hidden from the LLM while user attachments still map through.
tests/agent/advanced/test_conversational_advanced_agent_graph.py Tests wrapper graph nodes and “only new messages” output behavior.
Comments suppressed due to low confidence (1)

src/uipath_langchain/agent/advanced/types.py:22

  • ConversationalAdvancedAgentGraphState redefines its own schema instead of building on AdvancedAgentGraphState. Since the wrapper embeds the same deepagent graph used by create_advanced_agent_graph, any updates the inner graph emits to AdvancedAgentGraphState keys (e.g. structured_response when response_format/structured output is enabled upstream) could trigger a LangGraph InvalidUpdateError because the outer state does not declare that field. Inheriting from AdvancedAgentGraphState keeps the state contract aligned and avoids schema mismatches.
class ConversationalAdvancedAgentGraphState(BaseModel):
    """Graph state for the conversational advanced agent wrapper."""

    messages: Annotated[list[AnyMessage], add_messages] = []
    initial_message_count: int | None = None

Comment thread tests/agent/advanced/test_conversational_advanced_agent_graph.py
@radu-mocanu radu-mocanu merged commit 57e4349 into main Jul 6, 2026
46 checks passed
@radu-mocanu radu-mocanu deleted the feat/conversational-advanced-workspace branch July 6, 2026 15:41
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