Fix uipath-project-discovery-agent: avoid cmd.exe/PowerShell dependency when invoking uip CLI - #2425
Open
nsandrosBDO wants to merge 1 commit into
Conversation
The uip CLI's global `uip` command resolves to a `uip.cmd`/`uip.ps1` shell wrapper on Windows that npm generates around the real Node.js entry point (@uipath/cli, bin -> dist/index.js). Invoking `uip ...` from the Bash tool therefore requires spawning cmd.exe or PowerShell to interpret that wrapper, which fails in environments where direct shell-interpreter execution is restricted or blocked, even though the underlying CLI is itself Node.js. Add guidance to resolve and invoke the CLI's Node entry point directly via `node <entry.js> ...` instead of the `uip`/`uip.cmd`/`uip.ps1` wrapper, and make the two shell-dependent discovery steps (locating an open Studio Desktop instance, inspecting UILibrary packages) best- effort so discovery degrades gracefully instead of failing when no shell/Node invocation path is available.
nsandrosBDO
requested review from
AlvinStanescu,
DragosUnguru,
Mihaiii,
RaduAna-Maria and
gabrielavaduva
as code owners
August 2, 2026 22:34
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.
Problem
uipath-project-discovery-agent(skills/uipath-rpa/agents/uipath-project-discovery-agent.md) declarestools: Bash, Read, Glob, Grepand, in its workflow, shells out directly to theuipCLI:uip rpa list-instances --format jsonuip rpa inspect-package --package-name <PackageName>On Windows, the globally-installed
uipcommand resolves to auip.cmd/uip.ps1shell wrapper that npm generates around the CLI's real Node.js entry point (@uipath/clion npm declares"bin": { "uip": "dist/index.js" }). Invokinguip ...through the Bash tool therefore requires spawningcmd.exeorpowershell.exeto interpret that wrapper script.In hosts/environments where direct shell-interpreter execution (cmd.exe/PowerShell) is restricted or blocked by policy, these steps fail outright — even though the underlying
uipCLI is itself a plain Node.js program with no OS-shell dependency at all.Fix
uipCLI" section documenting that anyuipfunctionality this agent needs should be run by resolving the CLI's Node.js entry point (@uipath/cli'sdist/index.js, via an env var override, localnode_modules, or the global npm root) and invoking it directly withnode <entry.js> <args>— never through theuip/uip.cmd/uip.ps1shell wrapper.rpa list-instances) explicitly best-effort: if the CLI entry can't be resolved/invoked (no Node reachable, no Bash tool, blocked shell, etc.), the agent skips it and falls back to the explicit path / current working directory instead of failing.rpa inspect-package) — it's an optional enhancement, not a hard requirement, and now degrades to just recording the package name/version fromproject.json.uipcommands are for humans/other tooling, not something the discovery agent itself depends on for shell access.Why this matters
Some hosts/orgs restrict direct
cmd.exe/powershell.exeexecution by AI agents for security reasons. Sinceuipis fundamentally a Node.js CLI, the agent doesn't need a shell interpreter at all to use it — it only needed one because of how npm's global bin shims work on Windows. This change removes that unnecessary hard dependency while keeping full functionality when a shell/Node path is available, and degrading gracefully (rather than failing) when it isn't.This mirrors an existing working pattern from a downstream UiPath coded-app project, which already resolves
@uipath/uipath-ts-cli'sdist/cli.jsand invokes it vianode/process.execPathdirectly (shell: false) instead of through theuip/.cmd/.ps1wrapper.Scope
Documentation-only change (the "agent" is an LLM subagent prompt, not executable code) — no build/tests apply.