Skip to content

feat: add the create file built-in tool - #1119

Merged
radu-mocanu merged 1 commit into
mainfrom
feat/generate-file-tool
Oct 1, 2026
Merged

radu-mocanu merged 1 commit into
mainfrom
feat/generate-file-tool

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • agents can create a file and attach it to the job through the opt-in create file built-in tool (toolType: "create-file"), then pass the returned reference to another tool or put it in a file output field
  • the tool uses the name, description, input schema and static argument values saved with the resource. content carries the file body, and advanced agents can also publish a workspace file by filePath
  • subagents of advanced agents get the tool too, so they can produce files as part of their own work
  • the tool is no longer injected automatically when the output schema declares a file field, and the output-files system prompt is removed
  • a file output field accepts any existing attachment, including one a process tool produced in its own job. the reference is rebuilt from the real attachment and linked to the agent job

Why

output files only worked through a hidden tool that was added whenever the output schema had a file field. making it an explicit built-in tool puts the agent author in control and lets files flow into tool inputs as well as outputs.

@radu-mocanu
radu-mocanu force-pushed the feat/generate-file-tool branch from 118e182 to fe3c528 Compare September 29, 2026 08:49
@radu-mocanu
radu-mocanu marked this pull request as ready for review September 29, 2026 08:49
Copilot AI balanced review requested due to automatic review settings September 29, 2026 08:49

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.

Copilot review overview

🟡 Changes recommended

Advanced agents never bind the generated tool to their filesystem backend, so workspace file_path uploads remain unavailable.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds an opt-in generate-file built-in tool for creating job attachments across standard and advanced agents.

Changes:

  • Registers configurable file generation with inline or workspace sources.
  • Shares the tool with eligible advanced subagents.
  • Removes automatic output-file prompting and tool injection behavior.
File Description
pyproject.toml Bumps package and UiPath dependency versions.
uv.lock Updates locked dependencies.
generate_file_tool.py Implements the configurable file-generation tool.
internal_tool_factory.py Registers the new internal tool type.
advanced/​agent.py Shares parent tools with subagents.
attachments/​output_files.py Removes output-file prompting and generalizes validation messages.
attachments/​constants.py Removes the legacy fixed tool name.
test_generate_file_tool.py Tests schemas, uploads, paths, and factory behavior.
test_output_files_node.py Updates output verification tests.
test_output_files.py Removes obsolete prompt tests.
test_subagent_tools.py Verifies generate-file propagation to subagents.
test_payload_handler_middleware.py Updates renamed subagent resolution coverage.

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

Comment thread src/uipath_langchain/agent/advanced/agent.py
@radu-mocanu
radu-mocanu force-pushed the feat/generate-file-tool branch 7 times, most recently from be81774 to 06ab01d Compare September 30, 2026 20:11
@radu-mocanu radu-mocanu changed the title feat: add the generate-file built-in tool feat: add the create file built-in tool Sep 30, 2026
@radu-mocanu
radu-mocanu marked this pull request as draft September 30, 2026 20:11
@radu-mocanu
radu-mocanu force-pushed the feat/generate-file-tool branch 3 times, most recently from e5e7304 to d053d63 Compare October 1, 2026 13:28
Comment thread src/uipath_langchain/agent/tools/internal_tools/create_file_tool.py Outdated
@radu-mocanu
radu-mocanu force-pushed the feat/generate-file-tool branch from d053d63 to 9d8a803 Compare October 1, 2026 14:07
@radu-mocanu
radu-mocanu marked this pull request as ready for review October 1, 2026 14:07
unlinked = await unlinked_output_attachment_ids(fields, output)
if unlinked:
return _unlinked_ids_message(unlinked)
return _unlinked_ids_message(unlinked, file_tool_name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the job attachment was returned by an RPA, should we still return _unlinked_ids_message?

@radu-mocanu
radu-mocanu force-pushed the feat/generate-file-tool branch 2 times, most recently from e3c9ccd to 0273a6d Compare October 1, 2026 18:25
@radu-mocanu
radu-mocanu force-pushed the feat/generate-file-tool branch from 0273a6d to cbe8a3b Compare October 1, 2026 19:14
@radu-mocanu
radu-mocanu enabled auto-merge (squash) October 1, 2026 19:16
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu merged commit 4592e8c into main Oct 1, 2026
45 of 48 checks passed
@radu-mocanu
radu-mocanu deleted the feat/generate-file-tool branch October 1, 2026 19:25
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