Repository navigation
fix(policy): name the shell tool by its published name - #306
Merged
ViscaOwO merged 2 commits intoOct 21, 2026
Merged
Conversation
The tooling policy called the shell 'bash' in the routing heading and in the prefer-for-command-execution line, but the registry publishes 'ops_bash'. The model read a tool name it could not call: T-Auto#298 recorded 15 'unknown tool bash' calls in one session before it switched on retry. Build both strings from BASH_TOOL so they cannot drift from the published name again, and state outright that no bash tool exists, so a model that leans on the Claude Code vocabulary has an explicit rule to read. A new assertion fails if any model-visible line other than that prohibition names bash; reverting the source turns it red.
sueqet
force-pushed
the
fix/policy-name-the-published-shell-tool
branch
from
October 20, 2026 06:59
e2d7552 to
7683ba4
Compare
ViscaOwO
self-requested a review
October 21, 2026 13:20
…T-Auto#306) The routing heading and the "prefer for command execution" line named a tool the registry does not publish. The prohibition line added in T-Auto#306 is dropped: the renderer only receives `published` filtered to the plugin's own names, and under the default `shellPolicy: advise` the host `bash` stays visible on Linux and macOS, so the claim would be false there. A denied host shell reports a policy denial, not `unknown tool`. The test added in T-Auto#306 is rewritten: it rejects a bare `bash` (case insensitive) without depending on that sentence. Co-authored-by: sueqet <[email protected]>
Collaborator
|
LGTM |
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.
Closes #298
What was wrong
The tooling policy told the model to call a tool that does not exist.
renderToolingPolicy()builds the model-visible system prompt, and three model-facing strings named the shellbashwhile the registry only publishesBASH_TOOL=ops_bash:src/policy.ts:43— the heading# Shell routing: bash → host PowerShellsrc/policy.ts:91—Prefer bash for command execution. ... fix bash errors in bash ...row('bash', ...), which does resolve throughpublicToolName()Issue #298 has the measurement: on DSH Desktop 0.2.1-rc.2,
[email protected], Windows x64,workspace-write, a third-party gateway model issued{"name":"bash", ...}15 times in one session, each returning:That session's
request/headerlisted 44 tools includingops_bashand notbash; the desktop profile shipsdsh-tool-bashwithdisabled: true, so the tool genuinely does not exist. The prompt was teaching a name the registry never publishes, and the model only recovered by retrying with the real name.The change
src/policy.ts(2 lines changed, 1 added):BASH_TOOLinstead of the literalbash, so they cannot drift from the published name again. The heading became a template literal for that reason.There is no tool named bash in this deployment. The shell tool is ops_bash; a call to bash returns unknown tool and wastes the step.A model that leans on the Claude Code vocabulary — which is where the observedbashcalls came from — now has an explicit rule to read instead of inferring the name from prose.test/policy.test.mjs:BASH_TOOLrather than the literal string.the shell is never advertised under a name the registry does not publishscans every model-visible line and fails if any line other than the prohibition namesbash. It also asserts that a file-only deployment contains nobashat all.docs/CHANGELOG.md:## [Unreleased]entry in both languages.Deliberately not done: the
ops_bash requires description ...contract line keeps its literalops_bash, because it describes the tool contract rather than routing, and changing it would add schema/prompt bytes for no accuracy gain. No otherbashoccurrence insrc/is model-visible.Prompt-byte impact: the heading is the same length (
bash→ops_bashis 4 bytes longer), the prefer-line gains 12 bytes, and the new prohibition line adds 123 bytes, once per model step where the shell is published.Validation
Red/green, with
src/policy.tsreverted and rebuilt (git stash push src/policy.ts && npm run build):Restored, rebuilt:
Wider suites:
The single skip is the pre-existing "no bash payload installed in this checkout" skip; it is unrelated to this change and is a failure under
DSH_OPS_REQUIRE_RUNTIME=1, which I could not satisfy locally without installing the pinned payload.DSH_OPS_REQUIRE_RUNTIME=1 npm run verify— not run in full: this checkout has no Linux/macOS worker or bash payload, so the runtime-requiring suites would fail for environment reasons rather than this change. Please let CI be the reference for that gate.docs/CHANGELOG.md## [Unreleased]updated (bilingual)bashwordingpackage.jsonversion andoptionalDependenciesuntouchedEnvironment
T-Auto/dsh-opsmain atdd67dca(Merge pull request docs: DSH 工具注入分析合集 #299)npm ci --ignore-scriptsthennpm run build