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.
This commit is contained in:
mayor
2026-01-11 17:04:48 +01:00
committed by Daniel Sauer
parent 5d554a616a
commit 89aec8e19e

View File

@@ -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.