fix: always send handoff mail (#973)

* fix: always send handoff mail

* fix: remove trailing slash from mayor in detectSenderFromCwd

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Artem Bambalov
2026-01-26 04:04:07 +02:00
committed by GitHub
parent fe09e59c8c
commit 072c4649de
2 changed files with 13 additions and 10 deletions

View File

@@ -173,16 +173,14 @@ func runHandoff(cmd *cobra.Command, args []string) error {
return nil
}
// If subject/message provided, send handoff mail to self first
// The mail is auto-hooked so the next session picks it up
if handoffSubject != "" || handoffMessage != "" {
beadID, err := sendHandoffMail(handoffSubject, handoffMessage)
if err != nil {
style.PrintWarning("could not send handoff mail: %v", err)
// Continue anyway - the respawn is more important
} else {
fmt.Printf("%s Sent handoff mail %s (auto-hooked)\n", style.Bold.Render("📬"), beadID)
}
// Send handoff mail to self (defaults applied inside sendHandoffMail).
// The mail is auto-hooked so the next session picks it up.
beadID, err := sendHandoffMail(handoffSubject, handoffMessage)
if err != nil {
style.PrintWarning("could not send handoff mail: %v", err)
// Continue anyway - the respawn is more important
} else {
fmt.Printf("%s Sent handoff mail %s (auto-hooked)\n", style.Bold.Render("📬"), beadID)
}
// NOTE: reportAgentState("stopped") removed (gt-zecmc)

View File

@@ -182,6 +182,11 @@ func detectSenderFromCwd() string {
}
}
// If in the town's mayor directory
if strings.Contains(cwd, "/mayor") {
return "mayor"
}
// Default to overseer (human)
return "overseer"
}