From a453c4c4bea63883c02feb5fc0f8ead138213c72 Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 30 Dec 2025 21:17:01 -0800 Subject: [PATCH] fix(session): Wait 10s for GUPP reliability - WaitForClaudeReady has false positives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/session/manager.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/session/manager.go b/internal/session/manager.go index abc27a1a..ed9ab40a 100644 --- a/internal/session/manager.go +++ b/internal/session/manager.go @@ -190,7 +190,13 @@ func (m *Manager) Start(polecat string, opts StartOptions) error { if err := m.tmux.WaitForCommand(sessionID, constants.SupportedShells, constants.ClaudeStartTimeout); err != nil { // Non-fatal warning - Claude might still start } - time.Sleep(constants.ShutdownNotifyDelay) + + // Wait for Claude to be fully ready at the prompt (not just started) + // PRAGMATIC APPROACH: Use fixed delay rather than detection. + // WaitForClaudeReady has false positives (detects > in various contexts). + // Claude startup takes ~5-8 seconds on typical machines. + // 10 second delay is conservative but reliable. + time.Sleep(10 * time.Second) // Inject session beacon for predecessor discovery via /resume // This becomes the session title in Claude Code's session picker @@ -205,8 +211,8 @@ func (m *Manager) Start(polecat string, opts StartOptions) error { // Send the propulsion nudge to trigger autonomous work execution. // The beacon alone is just metadata - this nudge is the actual instruction // that triggers Claude to check the hook and begin work. - // Small delay to ensure beacon is processed first. - time.Sleep(500 * time.Millisecond) + // Wait for beacon to be fully processed (needs to be separate prompt) + time.Sleep(2 * time.Second) if err := m.tmux.NudgeSession(sessionID, PropulsionNudge()); err != nil { // Non-fatal: witness can still nudge later }