Skip to content

perf(banner): scope startup update-check fetch to origin/main (6x faster) - #74188

Merged
teknium1 merged 2 commits into
mainfrom
perf/banner-scoped-fetch
Jul 29, 2026
Merged

perf(banner): scope startup update-check fetch to origin/main (6x faster)#74188
teknium1 merged 2 commits into
mainfrom
perf/banner-scoped-fetch

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

The startup banner update-check now fetches only origin/main instead 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_git in hermes_cli/banner.py used an unscoped git fetch origin, while cmd_update already deliberately scopes its fetch to one branch for the same reason ("unscoped fetch can stall for minutes").

Changes

  • hermes_cli/banner.py: git fetch origingit fetch origin main in 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

Before After
fetch dry-run (warm) 3.0 s (up to 70 s cold) 0.55–0.9 s
behind-count (full clone, rewound ref) 3 3 (tracking ref updated by scoped fetch)
shallow clone FETCH_HEAD updated updated, boundary preserved
tests (update_check + banner_git_state + banner) 33/33 pass

Empirically verified on a real full clone (rewound origin/main tracking ref restored to tip by the scoped fetch, rev-list --count correct) and a real --depth 1 shallow clone (FETCH_HEAD updated, repo stays shallow).

Infographic

banner scoped fetch infographic

teknium1 added 2 commits July 29, 2026 09:09
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).
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 79f3296

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 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)

@alt-glitch alt-glitch added type/perf Performance improvement or optimization P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard area/install-update Installer, updater, packaging, wheels, doctor sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 29, 2026
@teknium1
teknium1 merged commit 58b78f5 into main Jul 29, 2026
43 checks passed
@teknium1
teknium1 deleted the perf/banner-scoped-fetch branch July 29, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install-update Installer, updater, packaging, wheels, doctor comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants