From 41ee62dc5714344322e5c434f84642c9b0e0aa99 Mon Sep 17 00:00:00 2001 From: gastown/polecats/bix Date: Wed, 31 Dec 2025 12:04:16 -0800 Subject: [PATCH] gt hook: Display mail details when mail bead hooked (gt-frhcq.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a mail bead (type=message) is on hook, gt hook now shows: - From: - Subject: - Run: gt mail read <id> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --- internal/cmd/molecule_status.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/internal/cmd/molecule_status.go b/internal/cmd/molecule_status.go index 4c271b26..d3cfcb37 100644 --- a/internal/cmd/molecule_status.go +++ b/internal/cmd/molecule_status.go @@ -578,6 +578,18 @@ func outputMoleculeStatus(status MoleculeStatusInfo) error { fmt.Println(style.Bold.Render("🚀 AUTONOMOUS MODE - Work on hook triggers immediate execution")) fmt.Println() + // Check if this is a mail bead - display mail-specific format + if status.PinnedBead.Type == "message" { + sender := extractMailSender(status.PinnedBead.Labels) + fmt.Printf("%s %s (mail)\n", style.Bold.Render("🪝 Hook:"), status.PinnedBead.ID) + if sender != "" { + fmt.Printf(" From: %s\n", sender) + } + fmt.Printf(" Subject: %s\n", status.PinnedBead.Title) + fmt.Printf(" Run: gt mail read %s\n", status.PinnedBead.ID) + return nil + } + fmt.Printf("%s %s: %s\n", style.Bold.Render("🪝 Hooked:"), status.PinnedBead.ID, status.PinnedBead.Title) // Show attached molecule @@ -851,6 +863,17 @@ func isTownLevelRole(agentID string) bool { return agentID == "mayor" || agentID == "deacon" } +// extractMailSender extracts the sender from mail bead labels. +// Mail beads have a "from:X" label containing the sender address. +func extractMailSender(labels []string) string { + for _, label := range labels { + if strings.HasPrefix(label, "from:") { + return strings.TrimPrefix(label, "from:") + } + } + return "" +} + // scanAllRigsForHookedBeads scans all registered rigs for hooked beads // assigned to the target agent. Used for town-level roles that may have // work hooked in any rig.