Repository navigation
[Bug] pwsh rejects a repeated sandbox mode with a blank justification, while bash and fs accept it #11826
Hal-Wang17
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
On a session whose standing sandbox mode is already
danger-full-access, apwshcall that repeats that same mode withjustification: ""is rejected:Repeating the effective mode is a no-op escalation —
approveEscalationreturns immediately formode === effectiveMode— and both sibling tools (bash,fs) special-case it before validating.pwshvalidates first, so it rejects a call that would have been a no-op. On Windowspwshis the only shell tool, so the failure is unconditional there.Environment
@deepseek-ai/dsh-tool-pwsh@0.2.1-rc.2,dsh-tool-bash@0.2.1-rc.2,dsh-tool-fs@0.2.1-rc.2,dsh-sandbox@0.2.1-rc.2danger-full-access, approval policynevermasteron 2026-11-02: still present forpwshReproduction
{ "command": "Get-Location", "description": "print the current directory", "sandbox_permissions": "danger-full-access", "justification": "" }→
Error: invalid justification: expected a non-empty sentence. The same argument shape is accepted bybash.Why the call is a no-op
packages/sandbox/sandbox/src/escalation.ts:172-174Repeating the effective mode needs no approval and no reason.
packages/fs/tool-fs/src/sandbox.ts:77-79states the same rule in prose:Where the three tools disagree (master)
bash —
packages/shell/tool-bash/src/index.ts:83-87fs —
packages/fs/tool-fs/src/sandbox.ts:89-94implements the same two rules (no-op early return + blank-justification normalization).pwsh —
packages/shell/tool-pwsh/src/index.ts:106-118No
effectiveModeparameter and no blank-justification normalization. The call site makes the no-op rule impossible to implement as written —packages/shell/tool-pwsh/src/index.ts:502-505:Compare
packages/shell/tool-bash/src/index.ts:480-481, which resolves first and validates second.The
jscpd:ignoremarkers say this is a deliberate mirror of bash's validation. That is presumably why the drift went unnoticed: bash gained two rules that the mirror never received.Measured impact
One local workspace, 5 sessions over roughly two weeks: 29 failed tool calls with this exact message — 27
pwsh, 1edit, 1write. Theedit/writeones are the same defect in the shipped 0.2.1-rc.2 bundle oftool-fs(master is already fixed there, so a release cut containing that fix leaves onlypwsh).Worst case observed: the model issued the identical
pwshcall 6 times in a row. The message names neither the conflicting argument nor the remedy, so it kept editingdescription/commandand leftjustificationempty; only a repeat-call reminder that echoed the full arguments got it to add a sentence. Every failure costs a full model round-trip.Suggested fix
Mirror
bash— resolve the policy first, then validate with the mode:Optionally, make the error actionable —
invalid justification: ...could name the paired argument and the remedy ("dropsandbox_permissions, or add a one-sentence justification"), which would cut the retries even before the ordering fix lands.All reactions