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) => {
const requiresInteraction = TOOLS_REQUIRING_INTERACTION.has(toolName);
if (!requiresInteraction) {
if (sdkOptions.permissionMode === 'bypassPermissions') {
return { behavior: 'allow', updatedInput: input };
}
// Dangerously-skip / bypass mode: auto-allow EVERY tool, including interactive
// ones (AskUserQuestion, ExitPlanMode). This guarantees zero prompts.
if (sdkOptions.permissionMode === 'bypassPermissions') {
return { behavior: 'allow', updatedInput: input };
}
if (!requiresInteraction) {
const isDisallowed = (sdkOptions.disallowedTools || []).some(entry =>
matchesToolPermission(entry, toolName, input)
);