Repository navigation
feat(web): Start from issue dialog with prefilled composer - #5
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds the Start work from issue dialog. It resolves the issue, prepares its worktree, opens the project draft there, and prefills the composer with the issue without discarding text already typed in the draft. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds a Start work from issue command palette action and a branch picker item for issue 123 or a GitHub issue URL. Bare numbers stay pull request checkout. Documents the flow in the source control guide. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review follow-ups: - The palette action now works from any thread. It opens the project's draft first, because the dialog only mounts on a draft. - Matching an issue URL in the draft uses whole tokens, so issue 3 is no longer skipped when the draft mentions issue 31. - Starting a second issue replaces the first issue's untouched prompt instead of appending to it. Edited text is still kept. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="apps/web/src/components/IssueThreadDialog.tsx" line_range="126-131" />
<code_context>
+ if (isAtomCommandInterrupted(result)) prepareIssueThreadAction.resetError();
+ return;
+ }
+ await onPrepared({
+ issue: result.value.issue,
+ branch: result.value.branch,
+ worktreePath: result.value.worktreePath,
+ });
+ onOpenChange(false);
+ }, [
+ cwd,
</code_context>
<issue_to_address>
**issue (bug_risk):** If `onPrepared` throws while opening or navigating to the draft, `handleConfirm` rejects without displaying an error or resetting the action. The issue worktree has already been created, so the dialog remains open while the user receives no failure feedback and can be left with an orphaned worktree.
**Triggers:** When draft navigation or draft setup fails after `prepareIssueThread` succeeds.
**Suggested fix:** Catch failures from `onPrepared`, surface them through the dialog error state, and handle or clean up the already-created worktree as appropriate.
</issue_to_address>
### Comment 2
<location path="apps/web/src/components/issueThread.logic.ts" line_range="12" />
<code_context>
+ .join("\n\n");
+}
+
+function containsUrlToken(text: string, url: string): boolean {
+ return text.split(/\s+/).includes(url);
+}
+
+/**
+ * The project keeps one draft, so starting an issue reuses it. Text the user typed is kept and the
+ * same issue is never added twice. `previousPrefill` is the exact text an earlier issue start wrote;
+ * a draft still equal to it is replaced, so two issues never end up in one prompt.
+ */
+export function mergeIssuePrompt(
+ existing: string,
+ issuePrompt: string,
+ issueUrl: string,
+ previousPrefill?: string,
+): string {
+ if (existing.trim().length === 0 || existing === previousPrefill) return issuePrompt;
+ if (containsUrlToken(existing, issueUrl)) return existing;
+ return `${existing.trimEnd()}\n\n${issuePrompt}`;
+}
</code_context>
<issue_to_address>
**issue (bug_risk):** `containsUrlToken` only recognizes an issue URL when it is separated by whitespace. A draft containing the same URL followed by normal punctuation, such as `https://github.com/o/r/issues/31.`, is not recognized, so starting the issue again appends a duplicate prompt.
**Triggers:** When the draft contains an issue URL followed by punctuation.
**Suggested fix:** Match URL token boundaries while allowing common trailing punctuation, or normalize punctuation before checking for an existing issue URL.
```suggestion
return text.split(/\s+/).some((token) => token.replace(/[.,!?;:)\]}]+$/, "") === url);
```
</issue_to_address>There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 744beb7529
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- An issue URL followed by punctuation in the draft is recognized, so starting the same issue again does not add it twice. - If opening the draft fails after the worktree is created, the dialog shows the error instead of failing silently. Starting again reuses the worktree. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex review follow-ups: - A prompt that mixes user text with an issue is never marked as replaceable, so a later issue start appends instead of deleting the user's text. - Start from issue appears only when the server advertises issueThreads and the project is not the scratch project. - The dialog request carries its project; a chat view for another project drops it instead of starting work in the wrong repository. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56cd3bd7ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…afts - The palette opens a fresh draft whenever the route is a server thread, including threads promoted from a draft that still keep a draft record. - The dialog request matches the logical project, so automatic environment selection moving the new draft no longer drops it; only a confirmed switch to another project closes it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df3ae4e1fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8afe54c25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ting - A start that finishes after navigation closed the dialog no longer opens or prefills the originating draft. - The issue field is disabled while the worktree is prepared, so the shown issue always matches the one being started. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92064eec94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- The dialog request carries the draft it was opened on. Leaving that draft (Back, sidebar, another thread) drops it, while automatic environment selection keeps the same draft and the dialog. - Start from issue is offered only for GitHub repositories. - A failed start no longer lingers after the issue changes or when the dialog is opened again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cc46cff18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
prepareIssueThread creates or checks out an issue branch, but unlike the VCS worktree and ref commands it left the cached ref list alone, so an open branch picker could miss the new branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pgrade Upstream moved reactivity out of effect/unstable when it upgraded to Effect 4.0.1, which broke the issue dialog's import after merging main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c65f8edfa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The dialog used the VCS action's pending flag, which follows the action's scope; automatic environment selection could change that scope mid-start and re-enable Cancel and Start work. The dialog now owns its starting state. Also scope the user guide to web and desktop; mobile has no issue start yet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afeb1cfff9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Automatic environment selection could move the draft while an issue start was running. The dialog then unmounted (dropping the result) or read its error from the new environment's action state (hiding a failure). The dialog now keeps its lookup and start on the environment it opened on and stays mounted. If the draft has moved, it says so instead of attaching a worktree from another environment. Also hide a previous lookup error while a new reference is still being typed, and show the lookup spinner again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Problem
The server can now resolve a GitHub issue and prepare its worktree (#4), but nothing in the app calls it.
Users still have no way to start work from an issue.
Change
123,#123, or a GitHub issue URL. It shows the issue's title and state, then Start work creates the issue worktree and opens the project's draft there.Work on #N: <title>, the issue body, and its URL. Nothing is sent automatically.issue 123or an issue URL. Bare123/#123stay pull request checkout.Scope and approval
Fork-only experiment, tracked in #1 and #3. Stacked on #4.
Mobile is out of scope for v1.
Verification
issueThread.logic,BranchToolbar.logic,CommandPalette.logic, and sharedgit.apps/webandpackages/client-runtimetypecheck clean.dev:mobileworkflow pingdotgg/t3code#123." and Start work stays disabled. The fork's issue feat: start agent work from a GitHub issue #1 resolves with its title and Open state..t3/worktrees/fork-clone/issue-1-…onissue/1-feat-start-agent-work-from-a-github-issu. The draft opened in Worktree mode with the issue in the composer, and 0 messages were sent.issue 1→ Start work from issue reused the same worktree (still 2 worktrees), and the composer held the issue exactly once.getIssue, so every real project said "Only GitHub issues are supported". It is fixed in feat(server): resolve GitHub issues and prepare an issue worktree thread #4 with a registry test.…github-issu).Release note: Start work from a GitHub issue from the command palette or branch picker. T3 Code creates the issue's worktree and prefills the composer.
Fixes #3
Implemented by Claude Opus 5.5 (1M context) in Claude Code, running inside T3 Code.
🤖 Generated with Claude Code