From 9a631b91956872e503566bed39134f6ba1fe6a0b Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 21 Dec 2025 10:06:13 -0800 Subject: [PATCH] fix(mail): normalize crew/polecats paths in addressToIdentity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Strip crew/ and polecats/ from addresses before identity conversion. This ensures beads/crew/dave and beads/dave both resolve to beads-dave, fixing the inbox mismatch bug (hq-0ol). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/mail/types.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/mail/types.go b/internal/mail/types.go index 0ae8a986..32136afc 100644 --- a/internal/mail/types.go +++ b/internal/mail/types.go @@ -284,6 +284,8 @@ func ParseMessageType(s string) MessageType { // - "gastown/Toast" → "gastown-Toast" // - "gastown/refinery" → "gastown-refinery" // - "gastown/" → "gastown" (rig broadcast) +// - "beads/crew/dave" → "beads-dave" (crew/ stripped) +// - "beads/polecats/nux" → "beads-nux" (polecats/ stripped) func addressToIdentity(address string) string { // Town-level agents: mayor and deacon keep trailing slash if address == "mayor" || address == "mayor/" { @@ -298,6 +300,12 @@ func addressToIdentity(address string) string { address = address[:len(address)-1] } + // Normalize worker paths: strip crew/ and polecats/ from path + // beads/crew/dave → beads/dave (both resolve to beads-dave) + // beads/polecats/nux → beads/nux (both resolve to beads-nux) + address = strings.Replace(address, "/crew/", "/", 1) + address = strings.Replace(address, "/polecats/", "/", 1) + // Replace / with - for beads identity // gastown/Toast → gastown-Toast result := ""