Skip to content

feat(threads): fail-closed isolate:true on forkThread (#1223) - #1271

Merged
currentbits merged 2 commits into
coder/1223-bon-isolate-contractfrom
coder/1223-bon-isolate-service
Sep 20, 2026
Merged

currentbits merged 2 commits into
coder/1223-bon-isolate-contractfrom
coder/1223-bon-isolate-service

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Stack 2/3, based on #1270.

forkThread({ isolate: true }) now fail-closes: it records the source committed HEAD (or a caller-supplied SHA) before createThread, arms pendingWorktree in the same patch, and copies baseBranch only as the merge/PR destination. Ask, remote, non-git, and unsupported scm throw instead of sharing the checkout.

Ordinary Fork, worktree: true chips, and worktree: false research/orchestration workers keep their previous semantics. Best of N UI still does not pass isolate until stack 3.

Why

A two-provider race must not edit the main checkout. The start SHA is captured once so both candidates share it even if the source advances while the race is launching. Uncommitted source edits are flagged, not copied.

Tests

  • electron/test/best-of-n-isolate.test.js — two real git worktrees, independent edits, dirty source not copied, partial launch keeps the first candidate, sibling forks unchanged.

Follow-up

  • Stack 3: Best of N launch path

  • PR created by the Grok agent

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T16:23:25.664184Z e16e10e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

) (#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]>
@currentbits
currentbits merged commit 8584025 into coder/1223-bon-isolate-contract Sep 20, 2026
0 of 6 checks passed
@currentbits
currentbits deleted the coder/1223-bon-isolate-service branch October 3, 2026 16:07
currentbits added a commit that referenced this pull request Oct 19, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant