Skip to content

fix: align shell guidance with execution - #5900

Open
zhuowp wants to merge 2 commits into
Hmbown:mainfrom
zhuowp:fix/shell-environment-guidance-upstream
Open

fix: align shell guidance with execution#5900
zhuowp wants to merge 2 commits into
Hmbown:mainfrom
zhuowp:fix/shell-environment-guidance-upstream

Conversation

@zhuowp

@zhuowp zhuowp commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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:

  • Full library target compiled; guidance selection: 23 passed, 0 failed, including catalog consistency and actual visible-tool fixture export.
  • lowercase_bash contract selection: 10 passed, 0 failed. Tests use RUST_MIN_STACK=16777216 per upstream development guidance, and installed Git usr/bin on the test PATH for an existing cat-based read-only fixture. Its initial missing-cat failure was resolved without code changes.
  • Rust formatting and diff checks passed. No live-model or native non-Windows acceptance is claimed for this upstream port; downstream model results are a separate experiment.

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.

Signed-off-by: z27014 <zhuo.wenpei@h3c.com>
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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 CONTRIBUTING.md for the expected contribution shape. A maintainer can grant recurring PR access by commenting /lgtm on a pull request.

Signed-off-by: z27014 <zhuo.wenpei@h3c.com>
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