Skip to content

fix(#306): Auto-Yes Poller重複応答防止とtmuxセッション安定性改善#310

Merged
Kewton merged 5 commits intodevelopfrom
feature/306-worktree
Feb 18, 2026
Merged

fix(#306): Auto-Yes Poller重複応答防止とtmuxセッション安定性改善#310
Kewton merged 5 commits intodevelopfrom
feature/306-worktree

Conversation

@Kewton
Copy link
Owner

@Kewton Kewton commented Feb 18, 2026

Summary

  • SHELL_PROMPT_ENDINGS偽陽性防止: Context left until auto-compact: N%がシェルプロンプトと誤判定される問題を多段防御(行長チェック→パターン判定)で解決
  • Auto-Yes Poller重複応答防止: lastAnsweredPromptKeyによる同一プロンプトの重複送信抑制(最大129回の重複を1回に削減)
  • クールダウン期間(5秒): 応答送信成功後のポーリング間隔を最適化
  • HealthCheckResult構造化: isSessionHealthy()の戻り値にreason付きログを追加

Changes

New files

  • src/lib/prompt-key.tsgeneratePromptKey() 共通ユーティリティ(DRY原則)
  • tests/unit/lib/prompt-key.test.ts — 5テスト

Modified files

  • src/lib/claude-session.ts — HealthCheckResult interface、多段防御、reason付きログ
  • src/lib/auto-yes-manager.ts — lastAnsweredPromptKey、isDuplicatePrompt()、COOLDOWN_INTERVAL_MS
  • src/hooks/useAutoYes.ts — generatePromptKey() 使用に統一
  • tests/unit/lib/claude-session.test.ts — 15テスト追加
  • tests/unit/lib/auto-yes-manager.test.ts — 7テスト追加

Test plan

  • Issue #306関連の163テストが全てパス
  • TypeScript型チェック(Issue #306関連ファイル)エラー0件
  • ESLint エラー0件
  • 受入テスト5項目全てパス

Closes #306

🤖 Generated with Claude Code

Kewton and others added 5 commits February 18, 2026 23:58
Implement auto-yes poller duplicate response prevention with prompt key
deduplication, 5-second cooldown after successful responses, and enhanced
tmux session health checks with structured HealthCheckResult reporting
and multi-stage false positive defense. Extract generatePromptKey() as
shared utility between client hook and server-side poller. All 163 tests
pass (27 new + 136 existing).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rinciples

Refactoring improvements for Issue #306 implementation code:
- Extract PromptKeyInput interface (ISP) for generatePromptKey parameter type
- Promote MAX_SHELL_PROMPT_LENGTH from function-local to module-level constant
- Extract getErrorMessage() helper in auto-yes-manager (DRY with claude-session)
- Add comprehensive JSDoc (@param, @returns, @example) to all public/internal functions
- Add @internal annotations to testing-only exports

Quality Metrics:
- Tests: 163 passed (unchanged)
- ESLint errors: 0
- TypeScript errors: 0 (in target files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Kewton Kewton merged commit a882708 into develop Feb 18, 2026
5 checks passed
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