fix(#306): Auto-Yes Poller重複応答防止とtmuxセッション安定性改善#310
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context left until auto-compact: N%がシェルプロンプトと誤判定される問題を多段防御(行長チェック→パターン判定)で解決lastAnsweredPromptKeyによる同一プロンプトの重複送信抑制(最大129回の重複を1回に削減)isSessionHealthy()の戻り値にreason付きログを追加Changes
New files
src/lib/prompt-key.ts—generatePromptKey()共通ユーティリティ(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_MSsrc/hooks/useAutoYes.ts— generatePromptKey() 使用に統一tests/unit/lib/claude-session.test.ts— 15テスト追加tests/unit/lib/auto-yes-manager.test.ts— 7テスト追加Test plan
Closes #306
🤖 Generated with Claude Code