Skip to content

Add suggested draft task cards and issue triage flow#4287

Open
juliusmarminge wants to merge 1 commit into
mainfrom
t3code/improve-draft-task-cards
Open

Add suggested draft task cards and issue triage flow#4287
juliusmarminge wants to merge 1 commit into
mainfrom
t3code/improve-draft-task-cards

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Add suggested draft task cards to the chat composer.
  • Add GitHub issue reference parsing and issue triage thread flow.
  • Add source-control issue APIs and GitHub CLI integration.
  • Simplify thread list, provider, orchestration, and settings flows by removing settlement and legacy v2 behavior.

Testing

  • Not run (no test execution details provided).

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 getIssue on the source-control provider, gh issue view JSON decoding in GitHubCli, GitManager.resolveIssue / git.resolveIssue RPC, and client atoms (issueResolution) with caching like PR resolution.

Issue triage UI uses IssueThreadDialog (debounced resolve via parseIssueReference) and materializeSuggestedThread in ChatView, which creates the server thread, sets branch/worktree context, and pre-fills the composer without auto-sending. PR checkout follows the same pattern: PullRequestThreadDialog now returns resolved PR metadata to buildPullRequestTask, replacing the older draft-navigation/openOrReuseProjectDraftThread path.

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

  • Adds a DraftSuggestedTasks component to the draft hero area with four actions: check out a PR, triage an issue, review current changes, and fix failing checks.
  • Adds IssueThreadDialog for resolving a GitHub issue reference (debounced, with validation), then prefilling the composer with a triage prompt.
  • Updates PullRequestThreadDialog to defer closing until the parent confirms successful thread creation via the onPrepared return value.
  • Introduces a resolveIssue RPC endpoint (git.resolveIssue) wired through contracts, WebSocket server, GitWorkflowService, GitManager, and GitHubCli to return normalized issue metadata.
  • Selecting a suggested task immediately creates a server thread using the current draft's model/runtime settings and seeds the composer prompt without sending.
📊 Macroscope summarized 4c4e10a. 20 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

- 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
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8e1dfc39-f3c8-42dc-9fb7-db1d1ff80859

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/improve-draft-task-cards

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Jul 22, 2026
mode,
...(mode === "worktree" ? { threadId } : {}),
});
setPreparingMode(null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 4c4e10a. Configure here.

cause: error.cause,
})
: error,
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4c4e10a. Configure here.

@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant