Skip to content

fix: prevent false negative in session health check for recovered sessions#354

Merged
Kewton merged 1 commit intomainfrom
fix/session-health-false-negative
Feb 23, 2026
Merged

fix: prevent false negative in session health check for recovered sessions#354
Kewton merged 1 commit intomainfrom
fix/session-health-false-negative

Conversation

@Kewton
Copy link
Owner

@Kewton Kewton commented Feb 23, 2026

Summary

  • isSessionHealthy() が tmux ペインバッファ全体(50行)をスキャンしてエラーパターンを検出していたため、過去のエラーから回復済みのセッションが unhealthy と誤判定され、UIに表示されなくなる問題を修正
  • アクティブプロンプト検出をエラーチェックより優先し、エラーパターンの検索範囲を末尾10行に限定
  • isClaudeRunning() の効果のないリトライロジックを削除

Test plan

  • 全ユニットテスト通過(3800 passed)
  • TypeScript型チェック通過
  • ESLint通過
  • 実環境で feature/294-worktree セッションが isSessionRunning: True として正しく検出されることを確認

🤖 Generated with Claude Code

…red sessions

isSessionHealthy() was scanning the entire tmux pane buffer (50 lines) for
error patterns, causing sessions that recovered from transient errors to be
incorrectly marked as unhealthy. This made recovered sessions invisible in the UI.

- Prioritize active prompt detection (CLAUDE_PROMPT_PATTERN) before error checks
- Limit error pattern search to last 10 lines instead of full buffer
- Remove ineffective 1-second retry in isClaudeRunning()
- Narrow regex pattern to ^Error:.*Claude Code (cli-patterns.ts)
- Increase polling duration to 30 minutes (response-poller.ts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Kewton Kewton merged commit 3f7e427 into main Feb 23, 2026
5 checks passed
@Kewton Kewton mentioned this pull request Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant