Merged
Conversation
This commit implements reactive checking of PR state to automatically close tasks when their PRs are merged. The changes ensure that tasks are updated immediately when users interact with them, providing a better user experience. Key changes: 1. **Executor enhancements**: - Added PRCache to Executor for caching GitHub PR status - New CheckPRStateAndUpdateTask() method to check PR state on demand - Enhanced isBranchMerged() to prioritize GitHub PR status check - Checks PR state via gh CLI before falling back to git branch checks 2. **UI integration**: - Check PR state when opening task detail view (loadTask) - Check PR state when closing task detail view (Back key) - Check PR state when manually closing a task (Close key) - Batch check all task PR states when loading dashboard - Force fresh PR info fetch when opening task details 3. **Automatic task closure**: - Tasks are automatically closed when PR is detected as merged - Works reactively on view open/close and dashboard refresh - Works periodically via existing background check (every 30s) - Logs the reason for automatic closure This addresses the issue where tasks with merged PRs would remain in non-done states until the next background check cycle. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Resolved conflicts in executor.go by combining TASK_SESSION_ID support from main with --chrome flag additions from this branch. Co-Authored-By: Claude Sonnet 4.5 <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 implements reactive checking of PR state to automatically close tasks when their PRs are merged. The implementation ensures that tasks are updated immediately when users interact with them, providing a better user experience.
Key Changes
1. Executor Enhancements (
internal/executor/executor.go)PRCachetoExecutorstruct for caching GitHub PR statusCheckPRStateAndUpdateTask()public method to check PR state on demandisBranchMerged()to prioritize GitHub PR status check via gh CLINew()andNewWithLogging()2. UI Integration (
internal/ui/app.go)loadTask()3. Automatic Task Closure
Test Plan
Impact
This addresses the issue where tasks with merged PRs would remain in non-done states until the next background check cycle (30 seconds). Now tasks are checked reactively whenever the user views them or navigates the UI.
🤖 Generated with Claude Code