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) => {
|
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)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue