fix: add NOSTREAM tag for analyze-file-tool internal llm-call#950
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents internal LLM calls made by the analyze-files internal tool from being forwarded into the user-facing conversational message stream, by tagging those LLM calls and filtering them in the runtime stream bridge.
Changes:
- Introduces a dedicated tag (
INTERNAL_TOOL_LLM_CALL_TAG) to mark LLM calls executed as part of internal tool execution. - Stamps that tag onto the analyze-files tool’s non-streaming LLM invocation config.
- Filters tagged message events out of
UiPathLangGraphRuntime.stream()so they don’t reach the conversation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/uipath_langchain/runtime/runtime.py |
Filters out message events for tagged internal-tool LLM calls during graph streaming. |
src/uipath_langchain/agent/tools/internal_tools/analyze_files_tool.py |
Adds an internal-call tag and applies it to the tool’s LLM invocation config. |
|
andrewwan-uipath
approved these changes
Jun 29, 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.



Bug: The Analyze Files tool's internal LLM call was leaking its response into the conversation stream as a visible content part, causing duplicate content in the chat UI.
Root cause: Commit
67a85715(2026-03-31) addedmap_ai_message_to_events()to handle fullAIMessageobjects for PII masking. This inadvertently caused the internal LLM'sAIMessage— captured via inherited graph callbacks invar_child_runnable_config— to be processed and emitted as a content part.Fix: Tag the internal LLM call's config with LangGraph's built-in
TAG_NOSTREAM, which tellsStreamMessagesHandlerto skip capturing that call's messages entirely.Single Response from Agent (Internal LLM output not streamed)
Screen.Recording.2026-06-29.at.3.54.22.PM.mov
Autonomous agents still working with the tool: