fix: align shell guidance with execution - #5900
Conversation
Signed-off-by: z27014 <zhuo.wenpei@h3c.com>
|
Thanks @zhuowp for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
Signed-off-by: z27014 <zhuo.wenpei@h3c.com>
Hmbown
left a comment
There was a problem hiding this comment.
Kind: approve-with-nits. Verified on main: tools/shell.rs:4361-4374/:4541-4560 hardcode bash/zsh guidance while execution selects the interpreter via shell_dispatcher::global_dispatcher() (shell_dispatcher.rs:548) — deriving both tool descriptions from the dispatcher (new shell/guidance.rs) is the right layer and changes no execution path. Catalog-consistency + ShellKind-matrix tests are solid; DCO and the full CI matrix are green on head. Two nits: (1) nothing pins that foreground_description() keeps the Ask/sandbox_permissions retry sentence from the old hardcoded text — please assert it in shell/tests.rs; (2) the stale failed link check from your first commit is blocking merge state — re-run or we'll clear it on our side. Thanks for the careful upstream port.
Signed-off-by: z27014 <zhuo.wenpei@h3c.com>
|
Addressed the foreground-guidance nit in 985f38b. The existing catalog regression now asserts the complete original Ask / sandbox_permissions retry and approval sentence on the actual visible LowercaseBashTool description. Production guidance is unchanged. Validation: rustfmt and git diff --check passed; the full library test target rebuilt and |
The model-visible lowercase bash tool and the legacy Bash handler do not identify the actual interpreter selected by ShellDispatcher. This lets models infer Bash syntax on PowerShell hosts.
Derive cached tool and command guidance from the existing dispatcher for PowerShell, cmd, Bash, POSIX sh, zsh, fish, and custom executable paths. Preserve the visible foreground tool's timeout/output/approval contract, and the hidden legacy tool's blocking wait / wait=false contract. The tool prefix stays stable for the process. Execution, permissions, schema fields, and tool names are unchanged.
Validation on 47c719b:
This complements PowerShell invocation hardening in #4593. The r13 backport is tracked separately in Pinvou#42.
No-Issue: This guidance gap was reproduced during downstream model testing; no matching open upstream issue was identified.