fix(agent): allowlist orcha MCP tools via settings too, not just --allowedTools#66
Merged
Merged
Conversation
…lowedTools bypassPermissions does NOT auto-approve custom MCP tools: Claude requires MCP tools to be explicitly allowlisted even under bypass (it covers built-ins like Bash/Edit, but not mcp__* tools). So a manager's entire orcha tool surface (mcp__orcha*) is gated SOLELY by --allowedTools. A single launch/resume edge, or a CLI version whose --allowedTools MCP-wildcard match drifts, drops the manager into per-tool permission prompts — and an interactive manager that prompts just hangs until a human intervenes (observed in prod: a manager wedged on the mark_objective_done approval dialog). Carry the allowlist through settings.permissions.allow (mirroring AllowedTools) in the inline --settings that every claude launch already passes, giving a second, independent approval path alongside the flag. Verified on the box that settings.permissions.allow approves an MCP tool under bypassPermissions with no --allowedTools flag, on both cold launch and --continue resume. Claude-Session: https://claude.ai/code/session_018CRsfX79dM42QC2BrW1vtZ
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.
What
A claude manager wedged in prod on the interactive permission dialog for
orcha - mark_objective_done(Do you want to proceed? 1. Yes / 2. Yes, don't ask again / 3. No), hanging until a human intervened.Root cause (verified on the box)
bypassPermissionsmode does not auto-approve custom MCP tools. It covers built-in tools (Bash/Edit — verified they run under bypass), but Claude deliberately requires MCP tools to be explicitly allowlisted even under bypass. So a manager's entire orcha tool surface (mcp__orcha*) is gated solely by--allowedTools=mcp__orcha. This is the asymmetry with codex, whose--dangerously-bypass-approvals-and-sandboxis a true global bypass that covers its MCP tools too.Reproduced with a throwaway stdio MCP server on the box:
bypassPermissionsbypassPermissionsmcp__test(flag)bypassPermissions.claudesettingspermissions.allowdefaultdefaultmcp__test(server wildcard)The current code passes
--allowedTools=mcp__orchaon every path (cold +--continueresume) and that approves the tool — so the wedge was a session where the flag wasn't in force (most likely a manager alive across a redeploy under an older binary). Relying on a single per-invocation flag for the only thing standing between a manager and an indefinite hang is too fragile.Fix
Carry the allowlist through
settings.permissions.allow(mirroringspec.AllowedTools) in the inline--settingsthat every claude launch already passes — a second, independent approval path alongside the flag. Verified on the box thatsettings.permissions.allowapproves an MCP tool underbypassPermissionswith no--allowedToolsflag, on both cold launch and--continueresume.Also applied immediately as a box mitigation for the live fleet: added
permissions.allow: ["mcp__orcha"]to~/.claude/settings.jsonon the agent host (bulletproof regardless of orcha binary version).Tests
TestClaudeControlArgs_AllowedToolsAlsoRideSettingsPermissions— settings carriespermissions.allowmirroringAllowedTools.TestClaudeControlArgs_NoAllowedToolsOmitsPermissions— no permissions block when there's nothing to approve; settings stays valid JSON.TestClaudeControlArgs_*(allowedTools=-token, co-author byline) still pass.https://claude.ai/code/session_018CRsfX79dM42QC2BrW1vtZ