Problem
openOrReuseProjectDraftThread in apps/web/src/components/ChatView.tsx always reuses the draft currently mapped to the project, not the draft the user started from.
When a project has more than one retained draft (for example after New thread while an older draft still has text), starting from an older draft navigates to and rewrites the other draft's worktree context and prompt.
The setup-script RPC is given the invoking draft's thread ID, so the setup script and the navigated draft can disagree.
This affects both Checkout pull request and Start work from issue; both call the same opener.
Expected
The prepared worktree attaches to the draft that started the action, or the action explicitly creates a new draft, and the setup script runs for that same thread.
Source
Raised by Codex review on #5 (comment 4182817116). Not fixed there because the behaviour is shared with the existing PR checkout flow.
Problem
openOrReuseProjectDraftThreadinapps/web/src/components/ChatView.tsxalways reuses the draft currently mapped to the project, not the draft the user started from.When a project has more than one retained draft (for example after New thread while an older draft still has text), starting from an older draft navigates to and rewrites the other draft's worktree context and prompt.
The setup-script RPC is given the invoking draft's thread ID, so the setup script and the navigated draft can disagree.
This affects both Checkout pull request and Start work from issue; both call the same opener.
Expected
The prepared worktree attaches to the draft that started the action, or the action explicitly creates a new draft, and the setup script runs for that same thread.
Source
Raised by Codex review on #5 (comment 4182817116). Not fixed there because the behaviour is shared with the existing PR checkout flow.