-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
[Bug]: ACP spawn fails with "requester denies apply_patch" when caller session uses claude-cli backend (loopback MCP dedup leaks into inherited deny) #89241
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
When the caller session runs on a claude-cli backend (any model with
agentRuntime: claude-cli), spawning an ACP child viasessions_spawn({ runtime: "acp" })is rejected:No tool deny policy is configured — the deny originates from the loopback MCP bridge dedup list (
NATIVE_TOOL_EXCLUDE) being treated as an inherited policy deny.Root cause (source trace)
mcp-http.runtime.tsdefinesNATIVE_TOOL_EXCLUDE = {read, write, edit, apply_patch, exec, process}— tools the CLI harness provides natively, excluded from the MCP loopback bridge to avoid duplicates.tool-resolution.ts(resolveGatewayScopedTools) receives these viaparams.excludeToolNamesand merges them intoexplicitDenylist:The same function then copies the full denylist into
inheritedToolDenylist:acp-spawn.tscallsfindAcpUnsupportedInheritedToolDeny(ctx.inheritedToolDenylist), which checks againstACP_UNSUPPORTED_INHERITED_TOOL_DENY— a list that includesapply_patch,edit,exec,process,read,write(all present inNATIVE_TOOL_EXCLUDE).Result: ACP spawn is hard-blocked because the dedup exclusion list is indistinguishable from a security policy deny.
Why this is a bug
NATIVE_TOOL_EXCLUDEis a deduplication optimization — the CLI harness already provides these tools natively, so the loopback bridge doesn't re-expose them. This is not a security restriction and should not be inherited by child sessions.PR #80979 (2026-05-13, "Inherit tool restrictions for delegated sessions") introduced
inheritedToolDenylistpropagation. The intent was correct (inherit real policy denies), but the implementation doesn't distinguish dedup exclusions from policy denies.Steps to reproduce
agentRuntime: claude-cli(e.g.,anthropic/claude-opus-4-8via CLI backend)sessions_spawn({ runtime: "acp", agentId: "claude", task: "echo test" })requester denies apply_patchSwitching to any API-backed model (e.g.,
litellm/claude-opus-4-6) on the same session and retrying — succeeds immediately. No config changes needed.Expected behavior
ACP spawn should succeed regardless of whether the caller session uses a CLI backend or an API backend, as long as no explicit tool deny policy is configured.
Actual behavior
ACP spawn is blocked when the caller uses any claude-cli backend model.
Suggested fix
In
tool-resolution.ts,excludeToolNames(loopback dedup) should not be included ininheritedToolDenylist. They should only filter the current session's tool set:Environment