Repository navigation
fix(#1460): phase agents never get SEQUANT_BASE_BRANCH — skills fall back to main on master-default repos - #1483
Merged
admarble merged 5 commits intoOct 17, 2026
Conversation
resolveBaseRef falls back to origin/<default branch of cwd> instead of a literal origin/main; detectDefaultBranch takes an optional cwd. Entire-Checkpoint: fa884d44fbda
…Ref's fallback now reaches them Entire-Checkpoint: 32d78970d24b
…phase-agents-never-get-sequant-base-branch
…s fallback Entire-Checkpoint: d02fe2563696
3 tasks
…phase-agents-never-get-sequant-base-branch
admarble
deleted the
feature/1460-fix-run-phase-agents-never-get-sequant-base-branch
branch
October 17, 2026 03:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase agents now get
SEQUANT_BASE_BRANCH: the base branch name withoutorigin/, taken fromresolveBaseRef(cwd), set inexecutePhase's env block for every phase. That includes spec, which runs in the main checkout with nothing recorded.resolveBaseRef's literal"origin/main"fallback (no recorded base, detached HEAD, or a git error) is noworigin/<default branch of cwd>, throughdetectDefaultBranch(false, cwd).detectDefaultBranchgained an optionalcwdthat defaults toprocess.cwd(), so existing callers don't change. Skills that read${SEQUANT_BASE_BRANCH:-main}stop guessingmainon amaster-default repo. The skills that read it are #1461, frozen until the plugin freeze lifts.Runner fix after QA (519fa7e): the zero-diff guard's doc comment no longer says the base "defaults to
origin/main".Fixes #1460
Acceptance criteria
phase-executor.base-branch.integration.test.ts› phase env carries SEQUANT_BASE_BRANCH: a worktree phase with a recordedorigin/mastergetsmaster, and a no-worktree spec phase on a repo whoseorigin/HEADismastergetsmaster. Mutation recorded belowphase-executor.test.ts› resolveBaseRef falls back to origin/ of cwd. The integration tests cover a master-default repo with no recorded base and a detached HEAD. Mutation recorded belowgrep -n SEQUANT_BASE_BRANCH docs/reference/run-command.mdfinds line 660, a row in the phase env tableRunner check:
npx vitest runoverphase-executor.base-branch.integration.test.ts,phase-executor.test.ts,phase-pause-handle.test.ts,ready-gate-run.test.tsandworktree-manager.test.tsgives 292/292 passed.Mutation verification
Mutation-verified: AC-1 — deleted the env.SEQUANT_BASE_BRANCH assignment in executePhase;
phase-executor.base-branch.integration.test.ts > phase env carries SEQUANT_BASE_BRANCH (#1460 AC-1) > spec phase: no worktree, nothing recorded, origin/HEAD is master — yields masterfailed, along with the worktree-phase case (2 failed, 205 passed); restored.Mutation-verified: AC-2 — restored the literal origin/main fallback in resolveBaseRef;
phase-executor.test.ts > resolveBaseRef > falls back to origin/<default branch> of cwd when nothing is recorded (#1460)failed, along with both AC-2 integration cases and the spec-phase AC-1 case (4 failed, 203 passed); restored.Follow-ups
document):sequant merge --checkstill hard-codesorigin/main, incombined-branch-test.ts:57and three more places insrc/lib/merge-check/. It's outside this issue's May-touch, so it's tracked in fix(merge): sequant merge --check hard-codes origin/main in four places, so a master-default repo gets empty diffs and a clean report #1484.${SEQUANT_BASE_BRANCH:-main}readers) is fix(skills): origin/main is hard-coded in exec/qa/spec commands, and quality-checks.sh turns the git failure into zeros on master-default repos #1461, frozen until the plugin freeze lifts.🤖 Generated by
sequant run; body rewritten by the graph runner.