Skip to content

fix(agents): grade Delegate's Windows PowerShell tool as Bash - #224

Closed
Mihaiii wants to merge 1 commit into
mainfrom
fix/delegate-powershell-shell-tool
Closed

Mihaiii wants to merge 1 commit into
mainfrom
fix/delegate-powershell-shell-tool

Conversation

@Mihaiii

@Mihaiii Mihaiii commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • DelegateAgent now records Delegate's Windows shell tool, ExecutePowershellCommand, as the canonical Bash tool. It sits in _TOOL_NAME_MAP next to the existing LoadSkill → Skill mapping.
  • With this change, command_executed treats a Windows Delegate shell call like any other shell call. tool_name: Bash filters match it, and patterns run against the raw command string instead of the JSON-dumped parameters.

Why

delegate-stdio renames ExecuteBashCommand to Bash itself, but it leaves ExecutePowershellCommand as is. On the Windows slice of the coder_eval_uipath nightly (build 13817754), the agent ran the right commands and still lost points:

Task Score Check that failed Why
skill-genome-execute-component 0.938 ran uip rpa build The check filters on tool_name=Bash, so it can never match ExecutePowershellCommand.
skill-migrator-migrate-classic-windows 0.867 ran analyze --output-format sarif / upgrade --output-path In the JSON the command reads UiPath.Upgrade.exe\" analyze. The escaped quote breaks the ["']?\s+analyze pattern.
same "no analyze/upgrade without SARIF output" The exclusion matched the call's plain-English steps text ("Run UiPath.Upgrade.exe analyze with SARIF output…"), not the command.

Those were the only checks that failed on either task, so with this change both pass.

Why here, not in delegate-stdio

Adding ExecutePowershellCommand: 'Bash' to TOOL_NAME_ALIAS in delegate-stdio would also work. But the fix would then only reach runs that pick up a new host release. This side covers every pinned delegate-stdio version, and follows the pattern already used for LoadSkill.

Tests

  • New: test_powershell_command_is_recorded_as_the_canonical_bash_call. It failed before the change ('ExecutePowershellCommand' != 'Bash').
  • test_happy_path_text_and_tool used ExecutePowershellCommand as a generic tool name and asserted it came through unchanged. It now uses Bash, so it keeps testing the happy path rather than the name mapping.
  • tests/test_delegate_agent.py, tests/test_command_executed.py, tests/test_custom_lint.py, ruff format/check and pyright (delegate_agent.py) pass locally on Windows. The process-group teardown test is skipped as POSIX-only, and CE033 needs PYTHONUTF8=1 on a cp1252 console.

🤖 Generated with Claude Code

delegate-stdio aliases ExecuteBashCommand to Bash but not
ExecutePowershellCommand, so on Windows every shell call missed
`tool_name: Bash` criteria and was matched as JSON. The escaped quote in
`UiPath.Upgrade.exe\" analyze` broke the patterns, and the call's
plain-English `steps` tripped "no analyze without SARIF" exclusions.
coder_eval_uipath nightly 13817754 scored correct migrator and genome runs
0.8-0.94 this way. Map it to Bash next to LoadSkill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mihaiii

Mihaiii commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: the alias now lives where the rest of Delegate's tool-name aliases do, in delegate-stdio's TOOL_NAME_ALIAS (UiPath/Autopilot@87fbbfc1e8 on fix/sdk-interop-log-path). It reaches the nightly with the next delegate-stdio release, since DELEGATE_STDIO_VERSION defaults to latest.

@Mihaiii Mihaiii closed this Oct 15, 2026
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.

1 participant