Fix premature plan consolidation with explicit completion signal (TAS-79) - #26
Open
yanismydj wants to merge 1 commit into
Open
Fix premature plan consolidation with explicit completion signal (TAS-79)#26yanismydj wants to merge 1 commit into
yanismydj wants to merge 1 commit into
Conversation
…S-79)
This change addresses premature consolidation issues in plan mode by adding:
1. **Explicit completion signal**: Users can now comment with `/done`, `done answering`,
or similar phrases to signal they've finished answering all planning questions
2. **Configurable dynamic debounce**: Replaces fixed 5-second timeout with a formula-based
calculation: baseMs + (questionCount * perQuestionMs), capped at maxMs
- Defaults: 3s base + 1s per question, max 30s
- Configurable via env vars: WEBHOOK_CHECKBOX_DEBOUNCE_BASE_MS,
WEBHOOK_CHECKBOX_DEBOUNCE_PER_QUESTION_MS, WEBHOOK_CHECKBOX_DEBOUNCE_MAX_MS
3. **Graceful handling of unanswered questions**: Consolidation tracks which questions
were answered vs skipped, providing clear feedback to users
4. **Improved plan mode flow**:
- Questions posted with clear instructions to use `/done` when finished
- Debounce timer only triggers consolidation after completion signal received
- Unanswered questions treated as intentionally skipped
Technical implementation:
- Added completion signal detection in webhook handler (handleCommentCreate)
- Modified checkbox debounce logic in handleCommentUpdate to respect completion signals
- Enhanced handleConsolidatePlan to analyze and report question response statistics
- Added configuration schema and env var support for dynamic debounce calculation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <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
This PR fixes premature consolidation issues in multi-question plan mode by implementing an explicit completion signal mechanism. Previously, the bot would consolidate clarifying questions too early due to webhook debounce triggering after individual checkbox changes.
Changes
1. Explicit Completion Signal
/done,done answering,finished answering, etc.2. Configurable Dynamic Debounce
baseMs + (questionCount * perQuestionMs), capped atmaxMsWEBHOOK_CHECKBOX_DEBOUNCE_BASE_MS(default: 3000)WEBHOOK_CHECKBOX_DEBOUNCE_PER_QUESTION_MS(default: 1000)WEBHOOK_CHECKBOX_DEBOUNCE_MAX_MS(default: 30000)3. Graceful Handling of Unanswered Questions
4. Improved Plan Mode UX
/donewhen finishedTechnical Implementation
Modified Files:
src/config.ts: Added webhook checkbox debounce configuration with dynamic calculationsrc/webhook/handler.ts:isCompletionSignal())calculateDebounceTimeout())handleCommentCreate()to detect and process completion signalshandleCommentUpdate()to use dynamic debounce and respect completion signalssrc/queue/processor.ts:handlePlan()to instruct users about/donesignalhandleConsolidatePlan()to analyze and report question response statistics.env.example: Documented new configuration optionsTesting Scenarios
The implementation handles:
/done,done answering, etc.)Related Linear Ticket
https://linear.app/opendoor/issue/TAS-79
🤖 Generated with Claude Code