feat: conversational advanced agent graph builder#974
Merged
Conversation
|
There was a problem hiding this comment.
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_graphto wrap deepagents with the conversational input/output contract. - Update
UiPathChatMessagesMapperto skip assistant-roleUiPathExternalValuecontent 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
cristipufu
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
create_conversational_advanced_agent_graph: wraps the deepagent to speak the conversational contract, taking the exchange history viamessagesand returning only the newly produced messages asuipath__agent_response_messagesWhy
enables conversational advanced (deepagents) agents, whose workspace persists across exchanges through file content-parts on the last assistant message (see uipath-runtime
ConversationalWorkspaceRuntime).