Repository navigation
Count source updates from the running commit, not the checkout HEAD - #6513
Merged
Merged
Conversation
When the source checkout was pulled without restarting bb, the update check counted and listed commits from the pulled HEAD, so Settings showed '+2 commits' for a server 32 commits behind. Updating then restarted on the pulled HEAD instead of origin/main because the shim required HEAD to still equal the running commit. Count and list incoming commits from the running commit, and let the shim fast-forward any checkout whose HEAD the target contains. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 3, 2026
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Nov 3, 2026
Sync Aleph to upstream bb 8c184323a0 (get-bb#6513, resolves launcher-controller.ts)
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.
Human comments
What was wrong
When a
pnpm startsource checkout is pulled (git pull) while bb keeps running, there are three commits in play: the commit bb is running, the checkout HEAD, andorigin/main. The source update check counted and listed incoming commits from the checkout HEAD, while Settings shows the running commit on the left. So a server runningf8c0701with a checkout pulled to055e758showedf8c0701 → 0950d00 (+2 commits)when it was 32 commits behind. A checkout pulled all the way toorigin/mainreported "up to date" while bb still ran old code.Applying the update in that state also went wrong. The source shim only fast-forwarded when HEAD still equalled the running commit recorded in the pending update. A pulled HEAD failed that check, so the shim skipped the fast-forward, install and rebuild, relaunched on the pulled HEAD, and recorded "bb started 055e758 instead of 0950d00".
What changed
packages/bb-app/src/app-update/source-checkout.ts:inspectSourceCheckouttakes the running commit and counts and lists incoming commits asrunning..origin/main. The diverged check still uses HEAD (origin/main..HEAD).fastForwardSourceno longer needs HEAD to equal afromcommit. It requires the target to contain HEAD, so a partly or fully pulled checkout fast-forwards (or no-ops) to the target. A checkout with commits the target lacks is refused with a clear message.packages/bb-app/src/app-update/source-shim.ts: the shim applies any pending source update throughfastForwardSource, so a mismatch is recorded as a failed result instead of silently skipped. Install and rebuild always run, which a pulled-but-unbuilt checkout needs. Removed the now-unusedreadHeadargument and its wiring inlauncher.ts.launcher-controller.tspassesargs.current.commitfor both thecheck-sourcerequest and the apply-time recheck.The launcher and server share the existing
SourceUpdateCheckshape, so nothing on the wire changes and there's no daemon protocol bump.How you verified
pnpm exec turbo run typecheck test --filter=bb-app: 223 tests pass. New tests on real git fixtures:origin/mainstill offers the update (previously reported up to date)fastForwardSourcecompletes from a partly pulled checkout and refuses one with commits the target lackspnpm start: built a fresh clone of this branch against a local bare upstream, with its own data dir and ports. Published 3 commits upstream and pulled the checkout forward by 1 without restarting.04e5411 → e4a5168 (+3 commits)with all three subjects.pnpm installand the rebuild, and relaunched.GET /api/v1/system/app-updatethen reportedcurrent=e4a5168andlastResult.outcome: "updated", and Settings showed "Up to date".🤖 Generated with Claude Code