Skip to content

fix(claude-code): don't pass --dangerously-skip-permissions in auto mode#846

Open
bdevore17 wants to merge 1 commit intocoder:mainfrom
bdevore17:fix/claude-code-no-bypass-in-auto-mode
Open

fix(claude-code): don't pass --dangerously-skip-permissions in auto mode#846
bdevore17 wants to merge 1 commit intocoder:mainfrom
bdevore17:fix/claude-code-no-bypass-in-auto-mode

Conversation

@bdevore17
Copy link
Copy Markdown

Summary

  • The task reporting code path in start.sh unconditionally adds --dangerously-skip-permissions regardless of the configured permission_mode
  • Workspaces using permission_mode = "auto" get both --permission-mode auto and --dangerously-skip-permissions, which defeats the purpose of auto mode
  • Only add --dangerously-skip-permissions when no explicit permission mode is set (backward compat) or when bypassPermissions is chosen

Test plan

  • Added claude-continue-resume-task-session-auto-mode test verifying --dangerously-skip-permissions is NOT passed when permission_mode=auto
  • Updated claude-auto-permission-mode test to assert --dangerously-skip-permissions is absent
  • Existing claude-continue-resume-task-session test still verifies default (no permission_mode) includes --dangerously-skip-permissions

The task reporting code path unconditionally added
--dangerously-skip-permissions regardless of the configured
permission_mode. This meant workspaces using permission_mode="auto"
got both --permission-mode auto AND --dangerously-skip-permissions,
defeating the purpose of auto mode.

Now only adds --dangerously-skip-permissions when no explicit
permission mode is set (backward compat) or when bypassPermissions
is the chosen mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdevore17
Copy link
Copy Markdown
Author

@35C4n0r please review

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@bdevore17

Have you tested this with tasks yet? I only ask because the reason we unconditionally added --dangerously-skip-permissions when task mode is enabled, was to allow for the agent to work autonomously in the background, as previously claude-code would stop and require user input which slightly defeated the purpose of running this in task mode.

@bdevore17
Copy link
Copy Markdown
Author

@DevelopmentCats yes i have. This still works as intended. The only difference is it first respects the permission_mode in the template. Right now, if you set permission_mode to auto, it doesn't work at all because the bypass permissions flag overrides it.

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@DevelopmentCats yes i have. This still works as intended. The only difference is it first respects the permission_mode in the template. Right now, if you set permission_mode to auto, it doesn't work at all because the bypass permissions flag overrides it.

Perfect! Thank you so much for the testing and the contribution. I will go ahead and put this through some rounds of testing just to confirm since this module is active, and then we can get this merged! 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants