fix(handoff): normalize identity in sendHandoffMail (#780)

The handoff mail bead was created with un-normalized assignee
(e.g., gastown/crew/holden) but mailbox queries use normalized identity
(gastown/holden), causing self-mail to be invisible to the inbox.

Export addressToIdentity as AddressToIdentity and call it in
sendHandoffMail() to normalize the agent identity before storing,
matching the normalization performed in Router.sendToSingle().

Fix handoff mail delivery (hq-snp8)
This commit is contained in:
aleiby
2026-01-20 14:09:54 -08:00
committed by GitHub
parent 2fe23b7be5
commit 08cee416a4
5 changed files with 15 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/steveyegge/gastown/internal/config"
"github.com/steveyegge/gastown/internal/constants"
"github.com/steveyegge/gastown/internal/events"
"github.com/steveyegge/gastown/internal/mail"
"github.com/steveyegge/gastown/internal/session"
"github.com/steveyegge/gastown/internal/style"
"github.com/steveyegge/gastown/internal/tmux"
@@ -577,6 +578,9 @@ func sendHandoffMail(subject, message string) (string, error) {
return "", fmt.Errorf("detecting agent identity: %w", err)
}
// Normalize identity to match mailbox query format
agentID = mail.AddressToIdentity(agentID)
// Detect town root for beads location
townRoot := detectTownRootFromCwd()
if townRoot == "" {