feat(crash): improve crash logging and mass death detection
Add comprehensive crash logging improvements to help diagnose mass session death events: - Add TypeSessionDeath and TypeMassDeath event types for feed visibility - Log pre-death events before killing sessions (who killed, why) - Add mass death detection in daemon (3+ deaths in 30s triggers alert) - Add macOS crash report check in gt doctor - Support session death events in townlog and feed curator Closes hq-kt1o6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/steveyegge/gastown/internal/boot"
|
||||
"github.com/steveyegge/gastown/internal/events"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
)
|
||||
|
||||
@@ -44,6 +45,14 @@ func StopTownSession(t *tmux.Tmux, ts TownSession, force bool) (bool, error) {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
|
||||
// Log pre-death event for crash investigation (before killing)
|
||||
reason := "user shutdown"
|
||||
if force {
|
||||
reason = "forced shutdown"
|
||||
}
|
||||
_ = events.LogFeed(events.TypeSessionDeath, ts.SessionID,
|
||||
events.SessionDeathPayload(ts.SessionID, ts.Name, reason, "gt down"))
|
||||
|
||||
// Kill the session
|
||||
if err := t.KillSession(ts.SessionID); err != nil {
|
||||
return false, fmt.Errorf("killing %s session: %w", ts.Name, err)
|
||||
|
||||
Reference in New Issue
Block a user