fix: bypassPermissions auto-allows interactive tools (reliable dangerous-skip)

This commit is contained in:
Zac Gaetano 2026-05-30 10:25:01 -04:00 committed by WildDragon Deploy
parent 26b3fc1aaf
commit 8e30d9c3cf

View file

@ -535,11 +535,13 @@ async function queryClaudeSDK(command, options = {}, ws) {
sdkOptions.canUseTool = async (toolName, input, context) => { sdkOptions.canUseTool = async (toolName, input, context) => {
const requiresInteraction = TOOLS_REQUIRING_INTERACTION.has(toolName); const requiresInteraction = TOOLS_REQUIRING_INTERACTION.has(toolName);
if (!requiresInteraction) { // Dangerously-skip / bypass mode: auto-allow EVERY tool, including interactive
if (sdkOptions.permissionMode === 'bypassPermissions') { // ones (AskUserQuestion, ExitPlanMode). This guarantees zero prompts.
return { behavior: 'allow', updatedInput: input }; if (sdkOptions.permissionMode === 'bypassPermissions') {
} return { behavior: 'allow', updatedInput: input };
}
if (!requiresInteraction) {
const isDisallowed = (sdkOptions.disallowedTools || []).some(entry => const isDisallowed = (sdkOptions.disallowedTools || []).some(entry =>
matchesToolPermission(entry, toolName, input) matchesToolPermission(entry, toolName, input)
); );