Summary
resolve_command (and the autofix near-match push path) is gated PowerShell-only via is_powershell(shell). In a non-PowerShell pane (cmd / bash / WSL) the tool returns status:"unsupported" and does no grounded resolution — including the parts that are inherently shell-agnostic.
This is an enhancement, not a bug: today's behavior is a deliberate v1 scoping (see #286 / PR #418). The agent falls back to its own native probing (where, type, etc.), so nothing is broken. But we bundle two conceptually different things under one PowerShell-only gate:
- Alias / function resolution — inherently shell-specific (a PowerShell profile alias, a bash function, …). Correctly shell-gated.
- PATH executable existence + "did you mean" near-match — OS-level and shell-agnostic.
which::which and the set of .exe/scripts on %PATH% don't depend on the shell.
Because the near-match enumeration + ranking is implemented with PowerShell (Get-Command -CommandType Application,ExternalScript,…), the shell-agnostic PATH lookup is currently unavailable in cmd/bash/WSL too.
Proposed enhancement
Split the PATH-only portion out of the PowerShell gate so a not-found command in any shell can still get:
- a grounded "does this executable exist on PATH" answer, and
- a "did you mean
<x>" near-match against PATH executables,
while alias/function resolution stays shell-specific (PowerShell today).
Sketch:
- Add a shell-agnostic PATH enumerator (walk
%PATH% / $PATH dirs for executables) feeding the existing rank_near_matches, independent of Get-Command.
- In
resolve_command, for a non-PowerShell shell, instead of returning unsupported immediately, still attempt the PATH-only near-match; only the alias/function/type resolution is reported as unavailable.
- Keep PowerShell on the richer
Get-Command path (types + profile aliases) as today.
Context / code pointers
Notes
- cmd.exe has essentially no persisted alias/function system, so for cmd the PATH near-match is the only meaningful grounded signal — which is exactly the shell-agnostic part this enhancement would unlock.
- bash/WSL could later also get native alias/function resolution (
type -a, compgen) as a separate follow-up, with the WSL /mnt/* PATH-leakage caveat in mind.
Summary
resolve_command(and the autofix near-match push path) is gated PowerShell-only viais_powershell(shell). In a non-PowerShell pane (cmd / bash / WSL) the tool returnsstatus:"unsupported"and does no grounded resolution — including the parts that are inherently shell-agnostic.This is an enhancement, not a bug: today's behavior is a deliberate v1 scoping (see #286 / PR #418). The agent falls back to its own native probing (
where,type, etc.), so nothing is broken. But we bundle two conceptually different things under one PowerShell-only gate:which::whichand the set of.exe/scripts on%PATH%don't depend on the shell.Because the near-match enumeration + ranking is implemented with PowerShell (
Get-Command -CommandType Application,ExternalScript,…), the shell-agnostic PATH lookup is currently unavailable in cmd/bash/WSL too.Proposed enhancement
Split the PATH-only portion out of the PowerShell gate so a not-found command in any shell can still get:
<x>" near-match against PATH executables,while alias/function resolution stays shell-specific (PowerShell today).
Sketch:
%PATH%/$PATHdirs for executables) feeding the existingrank_near_matches, independent ofGet-Command.resolve_command, for a non-PowerShell shell, instead of returningunsupportedimmediately, still attempt the PATH-only near-match; only the alias/function/type resolution is reported as unavailable.Get-Commandpath (types + profile aliases) as today.Context / code pointers
command_recall::is_powershell,mcp/resolve_command.rs(earlyunsupportedreturn).protocol/acp/prompt_context.rsapplies()(is_powershell).command_recall::{enumerate_powershell_commands, rank_near_matches, powershell_near_matches}.Notes
type -a,compgen) as a separate follow-up, with the WSL/mnt/*PATH-leakage caveat in mind.