fix(cli): make banner update state branch-aware - #33498
Open
Dusk1e wants to merge 2 commits into
Open
Conversation
Collaborator
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for pursuing parity between the update command and startup surfaces.
Problems
- This branch predates current update-check safeguards. Its
_check_via_local_git()athermes_cli/banner.py:203-228removes the shallow-clone path now required byhermes_cli/banner.py:204-239;tests/hermes_cli/test_update_check.py:132-170verifies that shallow clones must not run a history count across the boundary. - The PR cache payload at
hermes_cli/banner.py:321-326omits the currentverkey used byhermes_cli/banner.py:330-344to invalidate stale results after a pip upgrade. check_for_updates()also powers the dashboard (hermes_cli/web_server.py:3639-3651), while its changelog remains deliberately pinned toHEAD..origin/main(hermes_cli/web_server.py:3534-3555). Changing only the count reference can make the count and displayed changelog disagree.- Current docs define
origin/mainas the default update target, with non-main selection via--branch(website/docs/getting-started/updating.md:36-43).
Suggested changes
- Salvage the branch-aware idea onto current
banner.pywithout dropping the current shallow-clone, Docker, SSH-remote, and version-cache safeguards. - Decide whether passive checks should remain on the documented main default or make the dashboard/changelog path branch-aware as one coherent behavior.
Automated hermes-sweeper review.
| try: | ||
| result = subprocess.run( | ||
| ["git", "rev-list", "--count", "HEAD..origin/main"], | ||
| ["git", "rev-list", "--count", f"HEAD..{compare_ref}"], |
Contributor
There was a problem hiding this comment.
This unconditional history count regresses the shallow-installer safeguard now on main: shallow clones must fetch with --depth 1 and compare tips rather than run rev-list --count across the boundary. Please preserve that behavior when rebasing this helper.
| "ts": now, | ||
| "behind": behind, | ||
| "rev": embedded_rev, | ||
| "compare_ref": compare_ref, |
Contributor
There was a problem hiding this comment.
Please retain the current ver: VERSION cache discriminator here. Main uses it to invalidate a fresh cache after pip install --upgrade; without it, an old behind result survives until the six-hour TTL expires.
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
Fixes a state parity gap between branch-aware update operations and localized system surfaces by making the startup banner visualization and the
.update_checkcache model completely branch-aware.Why This Is Merge-Worthy
A behavior divergence existed between the branch-aware core update mechanics and adjacent interface surfaces. While a recent update introduced specific branch tracking capabilities to the update engine, the terminal welcome banner and the 6-hour filesystem cache block still evaluated remote drift metrics exclusively against a hard-coded
origin/maintarget. Consequently, users operating on custom engineering or feature branches saw erroneous ahead/behind status logs or inherited invalid configuration keys from stale cache payloads.Parity Reference Source
This modification directly aligns interface surfaces with the invariant established in:
feat(cli): add --branch flag to hermes updateScope of Changes
origin/<current-branch>) before utilizing traditionalorigin/mainfallbacks..update_checklocal storage configuration schema to scope valid entry arrays explicitly by their resolvedcompare_refparameters.Verified Test Suites
Targeted git state resolution checks and branch-flag update regressions completed with absolute success:
tests/hermes_cli/test_banner_git_state.pytests/hermes_cli/test_cmd_update.py::TestCmdUpdateBranchFlagtests/hermes_cli/test_cmd_update.py::TestCmdUpdateCheckBranchFlag