Replies: 2 comments
|
Verified against rc.8 source — your root-cause mapping is exact, and there are two structural points the fix needs to respect to fully deliver the expected behavior. 1. The equal-mode short-circuit must precede In all three consumers the arg-pairing validation runs before the standing policy is resolved:
So with 2. Suggest a shared normalization in escalation.ts's own doc says its job is "one home keeps the two families' approval ordering and verbatim error texts from drifting apart" — bash/pwsh already mirror each other under jscpd ignores. A fourth copied rule (equal-mode = declaration) becomes the third copy of a subtle check. A tiny shared helper keeps the semantics and the tests in one suite: /** Equal-mode is a declaration, not an escalation: grants nothing, must not validate justification or prompt. */
export function normalizeEscalationMode(requested: string | undefined, effective: SandboxMode): SandboxMode | undefined {
if (requested === undefined || requested === effective) return undefined // no escalation needed
return requested as SandboxMode
}Consumers then: resolve standing policy → 3. Why equal-mode is safe — and why
Fix direction confirmed; the ordering point (short-circuit before validation, after policy resolution) is the piece I'd make sure the local fix and regression matrix cover. |
|
Facing same problem, will there be an official "fix" in next releases? |
Uh oh!
There was an error while loading. Please reload this page.
Summary
A DSH subagent can repeatedly send
sandbox_permissionswith the same sandbox mode it already has (for example, requestingdanger-full-accesswhile the effective mode is alreadydanger-full-access). The call then fails instead of being treated as an idempotent declaration, which can leave Bash, Write, or Edit work in a retry loop and effectively stall the task.This is a DSH sandbox escalation Consumer issue, not a Claude Code permission or UI-plugin issue.
Reproduction
danger-full-access(the same behavior applies to other standing modes).{ "sandbox_permissions": "danger-full-access", "justification": "" }When the justification is missing or blank, validation can fail even earlier.
Expected behavior
A request whose
sandbox_permissionsequals the call's effective standing mode should be a no-op:justification;Root cause
The affected Consumers validate escalation arguments and enter the approval path before normalizing a repeated standing mode. The shared
approveEscalation()correctly rejects equal and narrower modes, but Consumers need to short-circuit equal-mode declarations before calling it.Scope
The affected Consumers are:
packages/shell/tool-bashpackages/shell/tool-pwshpackages/fs/tool-fs(writeandeditthrough the shared sandbox controller)The underlying
approveEscalation()safety check and subagentapproval: neverdesign should remain unchanged; this does not require forwarding approval requests to the parent agent.Fix and verification
A Consumer-level fix was implemented locally with regression coverage for missing, blank, and present justifications on repeated modes, plus downgrade and real-escalation safety cases.
Verified locally:
pnpm run typecheckpassed;pnpm run doc-syncpassed;git diff --checkpassed.The fix is intentionally limited to Consumer normalization and does not add permission persistence or parent-agent approval relay.
All reactions