fix: bypassPermissions auto-allows interactive tools (reliable dangerous-skip)
This commit is contained in:
parent
26b3fc1aaf
commit
8e30d9c3cf
1 changed files with 6 additions and 4 deletions
|
|
@ -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)
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue