All checks were successful
CI / check (push) Successful in 3m37s
Replace inline postPatch substituteInPlace calls with proper unified diff patch files, following the pattern established by beads. This improves maintainability: - Each patch is in its own file with clear naming - Patches use proper unified diff format - Easier to review, update, and track individual fixes - Default.nix is cleaner (237 lines of substituteInPlace -> 15 lines) Patches included: - gastown-fix-validate-recipient.patch - gastown-fix-agent-bead-address-title.patch - gastown-fix-agent-bead-rig-prefix.patch - gastown-fix-role-home-paths.patch - gastown-fix-town-root-detection.patch - gastown-fix-copydir-symlinks.patch - gastown-statusline-optimization.patch Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
diff --git a/internal/mail/router.go b/internal/mail/router.go
|
|
index 0000000..1111111 100644
|
|
--- a/internal/mail/router.go
|
|
+++ b/internal/mail/router.go
|
|
@@ -330,8 +330,28 @@ func agentBeadToAddress(bead *agentBead) string {
|
|
}
|
|
|
|
// Handle gt- prefixed IDs (legacy format)
|
|
- if !strings.HasPrefix(id, "gt-") {
|
|
- return "" // Not a valid agent bead ID
|
|
+ // Handle rig-specific prefixes: <prefix>-<rig>-<role>-<name>
|
|
+ // Examples: j-java-crew-americano -> java/crew/americano
|
|
+ idParts := strings.Split(id, "-")
|
|
+ if len(idParts) >= 3 {
|
|
+ for i, part := range idParts {
|
|
+ if part == "crew" || part == "polecat" || part == "polecats" {
|
|
+ if i >= 1 && i < len(idParts)-1 {
|
|
+ rig := idParts[i-1]
|
|
+ name := strings.Join(idParts[i+1:], "-")
|
|
+ return rig + "/" + part + "/" + name
|
|
+ }
|
|
+ }
|
|
+ if part == "witness" || part == "refinery" {
|
|
+ if i >= 1 {
|
|
+ return idParts[i-1] + "/" + part
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
+ // Handle gt- prefixed IDs (legacy format)
|
|
+ if !strings.HasPrefix(id, "gt-") {
|
|
+ return "" // Not a valid agent bead ID
|
|
}
|
|
|
|
// Strip prefix
|