Fix bd-6c68: preserve actual daemon failure reasons in bd info

Don't override connect_failed/health_failed with auto_start_disabled.
This preserves important diagnostic information about whether the
daemon crashed vs. was never running.

Amp-Thread-ID: https://ampcode.com/threads/T-a8da544a-3e59-4293-903c-ce6be85fc28b
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-01 19:14:24 -07:00
parent 4879b1a8c4
commit d80e7a5fd2

View File

@@ -390,13 +390,9 @@ var rootCmd = &cobra.Command{
}
}
} else {
// Auto-start disabled - only override if we don't already have a health failure
if daemonStatus.FallbackReason != FallbackHealthFailed {
// For connect failures, mention that auto-start was disabled
if daemonStatus.FallbackReason == FallbackConnectFailed {
daemonStatus.FallbackReason = FallbackAutoStartDisabled
}
}
// Auto-start disabled - preserve the actual failure reason
// Don't override connect_failed or health_failed with auto_start_disabled
// This preserves important diagnostic info (daemon crashed vs not running)
if os.Getenv("BD_DEBUG") != "" {
fmt.Fprintf(os.Stderr, "Debug: auto-start disabled by BEADS_AUTO_START_DAEMON\n")
}