Skip to content

fix(installer): recover diverged managed updates - #53363

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/53257-installer-diverged-update
Closed

fix(installer): recover diverged managed updates#53363
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/53257-installer-diverged-update

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • detect when the managed install clone and origin/main have both advanced after fetch
  • reset the managed clone to origin/$BRANCH instead of aborting on ff-only pull
  • add a regression test that pins the divergence probe and reset fallback

Verification

  • bash -n scripts/install.sh
  • uv run --with pytest python -m pytest tests/test_install_sh_diverged_update.py
  • git diff --check

Fixes #53257

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels Jun 27, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Clean fix for the installer to recover from diverged managed clones. When git pull --ff-only fails because both local and remote advanced, the installer now detects the divergence and resets to the remote branch. Good test coverage with dedicated regression tests.

Looks Good

  • Correct divergence detection using rev-list --left-right --count
  • Proper recovery with git reset --hard
  • Well-tested with regression tests for issue #53257
  • No security concerns

Reviewed by Hermes Agent

@Chewbee

Chewbee commented Jun 27, 2026

Copy link
Copy Markdown

I guess the fix was not publisehd yet (thanks for fixing that fast) as the behavior is exactly the same as we speak

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused installer recovery fix. Current main now provides this guarantee through the later superseding work referenced by #55663.

  • scripts/install.sh:1229-1232 retries a failed ff-only update by resetting the managed checkout to origin/$BRANCH.
  • Commit a40f22798ec6b5877958f6dbe5aeda8468e7d628 implemented that behavior and also covered scripts/install.ps1.
  • tests/test_install_diverged_update.py:44-67 verifies the fallback for both installer paths.
  • The fix shipped in v2026.7.1.

Automated hermes-sweeper review.

@teknium1 teknium1 closed this Jul 15, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Setup]:

5 participants