Skip to content

Stacked threads: pick, show, change, and rebase onto a base branch - #778

Merged
currentbits merged 14 commits into
mainfrom
coder/merge-ci-inspect-refused-false-positive-760
Aug 29, 2026
Merged

currentbits merged 14 commits into
mainfrom
coder/merge-ci-inspect-refused-false-positive-760

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Summary

Diff is the 23 stacked-base files only. #761 / #766 / #772 are already on main and are not remelted. Follow-ups left open: #773 (picker polish), #777 (style rebase-conflict as a Git-pane card).

Closes #774. Closes #775. Closes #776.

Test plan

  • npm run typecheck
  • Renderer: threadHeader / worktreeConflict / sidebarWorktreeCreate (54/54)
  • Electron: setBaseBranch + create/services coverage (96/96), setBaseBranch after merging main (12/12)
  • Create a worktree thread on a non-default local branch; header and Git pane show that base
  • Change base on a clean worktree; HEAD moves; Merge / Create PR target the new base
  • Dirty worktree Change base is refused and the recorded base stays
  • After the first PR, Change base is hidden

Made with Cursor

Willem and others added 14 commits August 29, 2026 08:39
…760)

The blast-radius gate fail-closed on git diff main...HEAD when only origin/main existed, and on a missing worktree directory. Both showed a Sign off banner that could not unblock the merge.

Co-authored-by: Cursor <[email protected]>
… When going through the llm picker when we are opencode the m
… When a thread is working, waiting, delegating or done i want
… I want a search in the model picker so not the first screen
… Cursor runs get no MCP injection: memory, orchestration, pre
… Kimi emits no cost/usage: spend tracking, daily budget gate,
… Living codebase docs: auto-maintained repo wiki and visual c
… Fork: i want the right sidebar default state to be closed. I
… i want you to take a look at the t3 code main scren agent wo
… Fork: Fork: Fork: Merge worktree lands on the project checko
… Merge worktree lands on the project checkout branch, not ori
… Fork: Fork: Fork: Fork: Fork: Merge worktree lands on the pr
… Fork: Fork: Fork: Fork: Merge worktree lands on the project
@currentbits
currentbits merged commit 36bb6c1 into main Aug 29, 2026
3 of 6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ea5806dd8

ℹ️ 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".

Comment thread electron/worktrees.js
Comment on lines +1583 to +1584
recordedBaseBranch(thread) || repoDefaultBranch(project.path);
const oldStart = resolveStartPoint(project.path, oldStartName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the old base commit after its branch is deleted

When a parent thread is merged locally, cleanupWorktree normally deletes its branch, but child threads still record that branch as their base. Attempting to retarget such a child to main then resolves the deleted branch here and throws Unknown base branch, even though the old base commit remains in the child's history; this blocks the normal stacked workflow after the parent lands. Persist the base SHA or otherwise derive the old boundary without requiring the branch ref to still exist.

Useful? React with 👍 / 👎.

Comment thread electron/services.js
Comment on lines +1953 to +1955
const listed = listBranches(project.path);
if (!listed.branches.includes(name)) {
throw new Error(`Unknown base branch: ${name}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject a worktree branch as its own base

Once a worktree exists, its generated coder/... branch is included in listBranches, displayed by the Change base picker, and accepted by this local-branch check. If selected, the thread records its own branch as the base; a later Merge resolves the target checkout to that same worktree, performs a no-op self-merge, and then removes the worktree and deletes its only branch ref without landing the changes elsewhere. Reject name === thread.branch and omit it from the picker.

Useful? React with 👍 / 👎.

Comment thread electron/worktrees.js
Comment on lines +1508 to +1512
const start = resolveStartPoint(
project.path,
mergeBaseName(thread, project.path),
);
gitOut(project.path, ["worktree", "add", "-b", branch, addPath, start]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compare removal safety against the recorded base

For a worktree created from a non-default base here, removeWorktree still checks defaultBranch(project.path)..branch rather than thread.baseBranch..branch. Consequently, even an untouched stacked worktree reports every commit from its selected base as unmerged and requires the user to confirm a force removal, presenting a misleading data-loss warning for base commits that were never produced by the thread.

Useful? React with 👍 / 👎.

currentbits added a commit that referenced this pull request Aug 29, 2026
* docs: spec for expanding the first-party stats dashboard

Countries, browsers, UTMs, live window, and fixed funnels stay inside
the cookieless daily-hash model. No new dependencies.

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit bcae898)

* docs: implementation plan for the expanded stats dashboard

TDD tasks for ingest dimensions, buildStats, HTML, and Girder graft.

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit b1447f0)

* stats-api: store country, browser, and utm keys in event props

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit db122a2)

* stats-api: hourly series, live window, funnels, and extra totals

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit b5303f5)

* docs: record stats dashboard expand SDD progress (#757)

(cherry picked from commit a8a761e)

* stats-api: dashboard live strip, funnels, and 90-day range

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit 4a88395)

* stats-api: do not hide All downloads behind the empty sentence

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit 1a12168)

* Merge worktree coder/git-pane-style-rebase-conflict-as-a-conf-bd952a: Git pane: style rebase-conflict as a conflict card

(cherry picked from commit 37ee975)

* Merge worktree coder/187-base-branch-picker-95f0a9: #187 base-branch picker

(cherry picked from commit ec7002e)

* Merge worktree coder/composer-power-ups-reply-as-context-past-1f5c7f: Composer power-ups: reply-as-context, paste-cards, prompt st

(cherry picked from commit 3c70067)

* Merge worktree coder/focus-view-hide-tool-rows-behind-a-per-t-c774c7: Focus view: hide tool rows behind a per-turn summary

(cherry picked from commit beb5af5)

* Merge worktree coder/kimi-live-thinking-from-stream-json-stde-72e641: Kimi live thinking from stream-json stderr

(cherry picked from commit 24105f1)

* Merge worktree coder/opencode-refresh-zen-catalog-and-send-va-c553cf: OpenCode: refresh Zen catalog and send --variant

(cherry picked from commit 5a71f7e)

* Merge worktree coder/workflow-kimi-phases-run-without-effort--f8aa58: Workflow kimi phases run without effort control and without

(cherry picked from commit 69c6cb2)

* fix: drop #187 bindings that duplicated #778 stacked-base APIs

Cherry-picking the leftover #187 squash onto origin/main (already #778)
inserted a second listBranches/listBaseBranches/normalizeBaseBranch and
broke the teach spread in devCoder.create.

Co-authored-by: Cursor <[email protected]>

* fix: Summary mode skips T3 grouping so Focus folds can mount

#768 collapseTimeline eats tool message rows. Focus (#461) keys off those
ids. Leave grouping for Normal/Verbose; Summary uses the leftover Focus path.

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Willem <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Willem <[email protected]>
@currentbits currentbits mentioned this pull request Aug 29, 2026
10 tasks
@currentbits
currentbits deleted the coder/merge-ci-inspect-refused-false-positive-760 branch October 3, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant