You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chain mode does not rebase existing branches onto previous chain link #126
When using --chain mode with sequant run, if branches already exist from previous runs, they are checked out as-is instead of being rebased onto the previous branch in the chain.
Reproduction
# First run creates branches correctly
sequant run 114 116 --sequential --chain --base feature/dashboard
# Branches get pushed to origin# Second run reuses existing branches without rebasing
sequant run 114 116 --sequential --chain --base feature/dashboard
# Result: #116 still based on feature/dashboard, not on #114
Expected behavior
In chain mode, each issue's branch should be based on the previous issue's branch:
feature/dashboard → #114 → #116
Actual behavior
When branches already exist, they retain their original base:
In src/commands/run.ts:245-257, when branchExists is true, the worktree is added with the existing branch without rebasing:
if(branchExists){// Use existing branch - does NOT rebase onto previous chain linkcreateResult=spawnSync("git",["worktree","add",worktreePath,branch], ...);}
The previousBranch parameter is correctly passed through the chain, but it's ignored when branches already exist.
Suggested fix options
Rebase existing branches onto the previous chain link when --chain is used
Warn and skip issues with existing branches that aren't properly chained
Force recreate the branch from the correct base (destructive, needs user confirmation)
Option 1 seems most user-friendly, with a fallback to option 2 if rebase conflicts occur.
Impact
Parallel development on same files leads to merge conflicts
Chain structure is broken, defeating the purpose of --chain
Activity
admarble commentedon Jan 19, 2026
📋 Implementation Plan
Acceptance Criteria Checklist
Implementation Steps
Modify
ensureWorktree()function (src/commands/run.ts:244-257)chainModeparameter to explicitly indicate chain behaviorbranchExists && chainMode && baseBranch:baseRefUpdate
WorktreeInfointerfacerebased: booleanfield for trackingAdd console output
"🔄 Rebasing existing branch onto previous chain link..."Add unit tests for all three AC scenarios
Verification Methods
Recommended Workflow: exec → qa
Quality Loop: disabled (well-defined bug fix)
Ready to implement.
fix(#126): rebase existing branches onto previous chain link in chain…
admarble commentedon Jan 19, 2026
QA Review ✅
AC Coverage
Quality Metrics
Verdict: READY_FOR_MERGE ✅
The implementation correctly addresses the bug:
chainModeparameter distinguishes chain from non-chain behaviorgit rebase --abortand user warningsPR: #127
admarble commentedon Jan 19, 2026
/fullsolve Complete ✅
Issue: #126 Chain mode does not rebase existing branches onto previous chain link
Status: READY_FOR_MERGE
Summary
Iterations
Key Changes
chainModeparameter toensureWorktree()functiongit rebase --abortrebasedfield toWorktreeInfofor trackingPR: #127
Ready for human review and merge.
docs: add changelog entry for chain mode rebase fix (#126)
fix(#126): rebase existing branches onto previous chain link in chain…