Add suggested draft task cards and issue triage flow#4287
Add suggested draft task cards and issue triage flow#4287juliusmarminge wants to merge 1 commit into
Conversation
- Resolve GitHub issues and pull requests into focused draft threads - Add review and failing-check prompts with source-control integration - Extend Git contracts, RPCs, providers, and tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| mode, | ||
| ...(mode === "worktree" ? { threadId } : {}), | ||
| }); | ||
| setPreparingMode(null); |
There was a problem hiding this comment.
🟠 High components/PullRequestThreadDialog.tsx:150
handleConfirm sets preparingMode back to null immediately after preparePullRequestThreadAction.run resolves, then awaits onPrepared. During that await, preparingMode is null and preparePullRequestThreadAction.isPending is false, so both confirm buttons and the Cancel button re-enable while the thread materialization is still in flight. A second click or Enter during this window starts another preparePullRequestThreadAction.run call and another onPrepared invocation for the same thread, causing duplicate checkout/worktree preparations. Move setPreparingMode(null) after the onPrepared await completes so the dialog stays busy for the full duration.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/components/PullRequestThreadDialog.tsx around line 150:
`handleConfirm` sets `preparingMode` back to `null` immediately after `preparePullRequestThreadAction.run` resolves, then awaits `onPrepared`. During that await, `preparingMode` is `null` and `preparePullRequestThreadAction.isPending` is `false`, so both confirm buttons and the Cancel button re-enable while the thread materialization is still in flight. A second click or Enter during this window starts another `preparePullRequestThreadAction.run` call and another `onPrepared` invocation for the same thread, causing duplicate checkout/worktree preparations. Move `setPreparingMode(null)` after the `onPrepared` await completes so the dialog stays busy for the full duration.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 4c4e10a. Configure here.
| cause: error.cause, | ||
| }) | ||
| : error, | ||
| ), |
There was a problem hiding this comment.
Issue not-found errors misclassified
High Severity
The classifyNonZeroExit helper misclassifies "issue not found" errors from gh issue view commands. Since it only recognizes "pull request not found" errors, getIssue returns a generic GitHubCliCommandError instead of the specific GitHubIssueNotFoundError, leading to unhelpful error messages for users.
Reviewed by Cursor Bugbot for commit 4c4e10a. Configure here.
| setComposerDraftPrompt(draftId, input.prompt); | ||
| composerRef.current?.resetCursorState({ cursor: input.prompt.length, prompt: input.prompt }); | ||
| scheduleComposerFocus(); | ||
| return true; |
There was a problem hiding this comment.
Early create races first send
High Severity
materializeSuggestedThread creates the server thread immediately, seeds the prompt, and focuses the composer, but does not wait for the client serverThread projection. Until that lands, isLocalDraftThread stays true, so the first send still includes bootstrap.createThread for the same id and the turn fails with thread-already-exists.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4c4e10a. Configure here.
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. This PR introduces a new feature with new components, RPC endpoints, and user-facing workflows (issue triage, suggested tasks). Additionally, three unresolved high-severity review comments identify race conditions and error handling bugs that should be addressed before merging. You can customize Macroscope's approvability policy. Learn more. |


Summary
Testing
Note
Medium Risk
Touches git workflow RPCs, GitHub CLI parsing, and draft thread creation; changes are additive with tests but PR/issue flows now depend on the new materialization path.
Overview
Adds suggested task cards on the draft chat hero for checking out a PR, triaging a GitHub issue, seeding a “review current changes” prompt, and seeding a “fix failing checks” prompt (git-backed actions disabled when the workspace isn’t a git repo).
GitHub issue lookup is wired end-to-end: optional
getIssueon the source-control provider,gh issue viewJSON decoding inGitHubCli,GitManager.resolveIssue/git.resolveIssueRPC, and client atoms (issueResolution) with caching like PR resolution.Issue triage UI uses
IssueThreadDialog(debounced resolve viaparseIssueReference) andmaterializeSuggestedThreadinChatView, which creates the server thread, sets branch/worktree context, and pre-fills the composer without auto-sending. PR checkout follows the same pattern:PullRequestThreadDialognow returns resolved PR metadata tobuildPullRequestTask, replacing the older draft-navigation/openOrReuseProjectDraftThreadpath.Reviewed by Cursor Bugbot for commit 4c4e10a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add suggested draft task cards and issue triage flow to chat view
DraftSuggestedTaskscomponent to the draft hero area with four actions: check out a PR, triage an issue, review current changes, and fix failing checks.IssueThreadDialogfor resolving a GitHub issue reference (debounced, with validation), then prefilling the composer with a triage prompt.PullRequestThreadDialogto defer closing until the parent confirms successful thread creation via theonPreparedreturn value.resolveIssueRPC endpoint (git.resolveIssue) wired through contracts, WebSocket server,GitWorkflowService,GitManager, andGitHubClito return normalized issue metadata.📊 Macroscope summarized 4c4e10a. 20 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.