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:
@@ -695,6 +695,13 @@ func (d *Daemon) restartPolecatSession(rigName, polecatName, sessionName string)
|
||||
return fmt.Errorf("sending startup command: %w", err)
|
||||
}
|
||||
|
||||
// Wait for Claude to start, then accept bypass permissions warning if it appears.
|
||||
// This ensures automated restarts 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)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user