From 89aec8e19e78ba9704ef793a2b7ad5b1d2e4392f Mon Sep 17 00:00:00 2001 From: mayor Date: Sun, 11 Jan 2026 17:04:48 +0100 Subject: [PATCH] fix(mail): use NudgeSession for all agent notifications Simplified notification delivery to always use NudgeSession, since all sessions are Claude Code (or similar AI sessions), never plain terminals. This removes unnecessary complexity and the IsClaudeRunning check. --- internal/mail/router.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/mail/router.go b/internal/mail/router.go index dc56aad9..29a928da 100644 --- a/internal/mail/router.go +++ b/internal/mail/router.go @@ -863,7 +863,7 @@ func (r *Router) GetMailbox(address string) (*Mailbox, error) { } // notifyRecipient sends a notification to a recipient's tmux session. -// Uses send-keys to echo a visible banner to ensure notification is seen. +// Uses NudgeSession to add the notification to the agent's conversation history. // Supports mayor/, rig/polecat, and rig/refinery addresses. func (r *Router) notifyRecipient(msg *Message) error { sessionID := addressToSessionID(msg.To) @@ -877,8 +877,9 @@ func (r *Router) notifyRecipient(msg *Message) error { return nil // No active session, skip notification } - // Send visible notification banner to the terminal - return r.tmux.SendNotificationBanner(sessionID, msg.From, msg.Subject) + // Send notification to the agent's conversation history + notification := fmt.Sprintf("📬 You have new mail from %s. Subject: %s. Run 'gt mail inbox' to read.", msg.From, msg.Subject) + return r.tmux.NudgeSession(sessionID, notification) } // addressToSessionID converts a mail address to a tmux session ID.