fix(resume): capture error in handoff message fallback (#583)

When JSON parsing of inbox output fails, the code falls back to plain
text mode. However, the error from the fallback `gt mail inbox` command
was being silently ignored with `_`, masking failures and making
debugging difficult.

This change properly captures and returns the error if the fallback
command fails.

Co-authored-by: Gastown Bot <bot@gastown.ai>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
sigfawn
2026-01-16 18:27:38 -05:00
committed by GitHub
parent c7e1451ce6
commit 91433e8b1d
3 changed files with 82 additions and 12 deletions
+4 -1
View File
@@ -257,7 +257,10 @@ func checkHandoffMessages() error {
if err := json.Unmarshal(output, &messages); err != nil {
// JSON parse failed, use plain text output
inboxCmd = exec.Command("gt", "mail", "inbox")
output, _ = inboxCmd.Output()
output, err = inboxCmd.Output()
if err != nil {
return fmt.Errorf("fallback inbox check failed: %w", err)
}
outputStr := string(output)
if containsHandoff(outputStr) {
fmt.Printf("%s Found handoff message(s):\n\n", style.Bold.Render("🤝"))