fix(session): Auto-accept Claude bypass permissions warning dialog
When Claude starts with --dangerously-skip-permissions, it shows a warning dialog requiring Down+Enter to accept. This blocked automated polecat and agent startup. Added AcceptBypassPermissionsWarning() to tmux package that: - Checks if the warning dialog is present by capturing pane content - Only sends Down+Enter if "Bypass Permissions mode" text is found - Avoids interfering with sessions that don't show the warning Updated all Claude startup locations: - session/manager.go (polecat sessions) - cmd/up.go (mayor, witness, crew, polecat cold starts) - daemon/daemon.go (crashed polecat restarts) - daemon/lifecycle.go (role session starts)
This commit is contained in:
@@ -364,6 +364,13 @@ func (d *Daemon) restartSession(sessionName, identity string) error {
|
||||
return fmt.Errorf("sending startup command: %w", err)
|
||||
}
|
||||
|
||||
// Wait for Claude to start, then accept bypass permissions warning if it appears.
|
||||
// This ensures automated role starts aren't blocked by the warning dialog.
|
||||
if err := d.tmux.WaitForCommand(sessionName, constants.SupportedShells, constants.ClaudeStartTimeout); err != nil {
|
||||
// Non-fatal - Claude might still start
|
||||
}
|
||||
_ = d.tmux.AcceptBypassPermissionsWarning(sessionName)
|
||||
|
||||
// Note: gt prime is handled by Claude's SessionStart hook, not injected here.
|
||||
// Injecting it via SendKeysDelayed causes rogue text to appear in the terminal.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user