From eb18dbf9e20e262e8f52b95659577bd79285606e Mon Sep 17 00:00:00 2001 From: nux Date: Fri, 16 Jan 2026 15:55:37 -0800 Subject: [PATCH] fix(sling): verify session survives startup before returning success The Start() function was returning success even if the pane died during initialization (e.g., if Claude failed to start). This caused the caller to get a confusing "getting pane" error when trying to use the session. Now Start() verifies the session is still running at the end, returning a clear error message if the session died during startup. Fixes: gt-0cif0s Co-Authored-By: Claude Opus 4.5 --- internal/polecat/session_manager.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/polecat/session_manager.go b/internal/polecat/session_manager.go index a77f646f..d5f93521 100644 --- a/internal/polecat/session_manager.go +++ b/internal/polecat/session_manager.go @@ -250,6 +250,16 @@ func (m *SessionManager) Start(polecat string, opts SessionStartOptions) error { time.Sleep(2 * time.Second) debugSession("NudgeSession PropulsionNudge", m.tmux.NudgeSession(sessionID, session.PropulsionNudge())) + // Verify session survived startup - if the command crashed, the session may have died. + // Without this check, Start() would return success even if the pane died during initialization. + running, err = m.tmux.HasSession(sessionID) + if err != nil { + return fmt.Errorf("verifying session: %w", err) + } + if !running { + return fmt.Errorf("session %s died during startup (agent command may have failed)", sessionID) + } + return nil }