perf(banner): scope startup update-check fetch to origin/main (6x faster) - #74188
Merged
Conversation
The banner update-check ran an unscoped 'git fetch origin', transferring all ~1,400 remote heads (measured 3.0s dry-run vs 0.55s scoped, and up to 70s on a cold ref store) and frequently burning its full 10s timeout on slow links. cmd_update already scopes its fetch for exactly this reason. A scoped 'git fetch origin main' updates both the origin/main tracking ref (full-clone count path) and FETCH_HEAD (shallow compare path), so behind-count semantics are unchanged — verified empirically on a full clone (rewound tracking ref restored to tip, count correct) and a --depth 1 shallow clone (FETCH_HEAD updated, boundary preserved).
Contributor
૮ >ﻌ< ა ci reviewran on 79f3296 ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job1 visual diff. inline evidence upload failed. Failed to upload diff-665a0833239e-onboarding-overlay-diff.png with gh image (exit code 1): Error uploading /home/runner/work/_temp/e2e-evidence/diff-665a0833239e-onboarding-overlay-diff.png: step 0 (get upload token): uploadToken not found on repo page — do you have write access to NousResearch/hermes-agent? (or, if NousResearch enforces SAML SSO, authorize at https://github.com/orgs/NousResearch/sso) |
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
The startup banner update-check now fetches only
origin/maininstead of every remote head — 6x faster (3.0 s → 0.55 s dry-run on this repo's ~1,400 heads; up to 70 s → <1 s on a cold ref store) and far less likely to burn its full 10 s timeout on slow links.Root cause:
_check_via_local_gitinhermes_cli/banner.pyused an unscopedgit fetch origin, whilecmd_updatealready deliberately scopes its fetch to one branch for the same reason ("unscoped fetch can stall for minutes").Changes
hermes_cli/banner.py:git fetch origin→git fetch origin mainin the banner update-check (both full-clone and shallow paths).tests/hermes_cli/test_update_check.py: shallow-fetch argv contract updated to the scoped form.Validation
Empirically verified on a real full clone (rewound
origin/maintracking ref restored to tip by the scoped fetch,rev-list --countcorrect) and a real--depth 1shallow clone (FETCH_HEAD updated, repo stays shallow).Infographic