Repository navigation
Stacked threads: pick, show, change, and rebase onto a base branch - #778
Conversation
…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
There was a problem hiding this comment.
💡 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".
| recordedBaseBranch(thread) || repoDefaultBranch(project.path); | ||
| const oldStart = resolveStartPoint(project.path, oldStartName); |
There was a problem hiding this comment.
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 👍 / 👎.
| const listed = listBranches(project.path); | ||
| if (!listed.branches.includes(name)) { | ||
| throw new Error(`Unknown base branch: ${name}`); |
There was a problem hiding this comment.
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 👍 / 👎.
| const start = resolveStartPoint( | ||
| project.path, | ||
| mergeBaseName(thread, project.path), | ||
| ); | ||
| gitOut(project.path, ["worktree", "add", "-b", branch, addPath, start]); |
There was a problem hiding this comment.
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 👍 / 👎.
* 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]>
Summary
threads.setBaseBranch, Stacked threads: choose a base branch other than the repo default #187 / Show and change stacked base after thread create #774).origin/HEAD→main. Hidden after the first PR.Diff is the 23 stacked-base files only. #761 / #766 / #772 are already on
mainand 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 typecheckMade with Cursor