Repository navigation
feat(threads): launch Best of N into isolated candidate worktrees (#1223) - #1272
Conversation
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. |
2907dc3
into
coder/1223-bon-isolate-service
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e54c96c8c4
ℹ️ 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".
| model: entry.model, | ||
| }) | ||
| : await onFork({ provider: entry.provider }); | ||
| const forked = await onFork(bestOfNForkOpts(entry, snapshot)); |
There was a problem hiding this comment.
Preserve the prompt when staging candidate forks
When a second or later fork fails, the earlier onFork has already selected its new thread because App delegates to useCoder.forkThread, which calls setSelectedThreadId. App then gates out the old detail and unmounts its Composer, whose draft exists only in draftsRef; because this new fork-all loop has not started any run yet, the rejection leaves the user on an idle fork with the original prompt permanently lost. Avoid selection while staging, or restore/reselect the source and its draft when staging fails.
Useful? React with 👍 / 👎.
* feat(threads): fail-closed isolate:true on forkThread (#1223) Require a worktree and record the source committed HEAD before creating the candidate. Reuse a caller-supplied SHA so a race shares one start. Ask, remote, non-git, and unsupported scm throw instead of sharing the checkout. Ordinary Fork, worktree:true chips, and worktree:false workers are unchanged. * feat(threads): launch Best of N into isolated candidate worktrees (#1223) (#1272) Preflight before any fork, pass isolate:true with a shared start snapshot through useCoder.forkThread, and start runs only after every candidate is forked. Ordinary Fork and Hand off still omit isolate. Co-authored-by: Willem <[email protected]> --------- Co-authored-by: Willem <[email protected]>
* feat(threads): fail-closed isolate:true on forkThread (#1223) Require a worktree and record the source committed HEAD before creating the candidate. Reuse a caller-supplied SHA so a race shares one start. Ask, remote, non-git, and unsupported scm throw instead of sharing the checkout. Ordinary Fork, worktree:true chips, and worktree:false workers are unchanged. * feat(threads): launch Best of N into isolated candidate worktrees (#1223) (#1272) Preflight before any fork, pass isolate:true with a shared start snapshot through useCoder.forkThread, and start runs only after every candidate is forked. Ordinary Fork and Hand off still omit isolate. Co-authored-by: Willem <[email protected]> --------- Co-authored-by: Willem <[email protected]>
Stack 3/3, based on #1271.
Wires Best of N to the isolate contract: preflight before any fork, pass
isolate: trueplus the first candidate's recorded start snapshot throughuseCoder.forkThread, fork every candidate, then start runs. Ordinary Fork and Hand off still omitisolate. Ask threads keep Best of N hidden.Partial start failure leaves already-forked candidates inspectable. Unsupported projects surface the preflight error instead of launching an unsafe parallel implementation.
Why
This is the user-facing path for #1223. Isolation is chosen before any candidate starts, not patched onto a thread afterward.
Tests
test/bestOfNComposer.test.tsx— fork-all-then-start, isolate + reused snapshot, remote preflight, start failure keeps forkstest/forkHandoff.test.tsx— App Best of N hitsthreads.forkwith isolate; ordinary Fork does nottest/support/fakeCoder.ts/src/devCoder.tshonor isolate fail-closedPR created by the Grok agent