fix(mail): add crew worker detection in detectSender()

detectSender() only detected polecats, not crew workers. Crew workers
like Emma at /Users/stevey/gt/beads/crew/emma were incorrectly
defaulting to mayor/ instead of getting their proper address.

Added /crew/ directory pattern matching parallel to the existing
/polecats/ detection, extracting rig/crewName address format.

Fixes: gt-70b3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-18 21:55:49 -08:00
parent ce6fecbc57
commit 5f92183843

View File

@@ -468,6 +468,17 @@ func detectSender() string {
}
}
// If in a rig's crew directory, extract address
if strings.Contains(cwd, "/crew/") {
parts := strings.Split(cwd, "/crew/")
if len(parts) >= 2 {
rigPath := parts[0]
crewName := strings.Split(parts[1], "/")[0]
rigName := filepath.Base(rigPath)
return fmt.Sprintf("%s/%s", rigName, crewName)
}
}
// Default to mayor
return "mayor/"
}