Skip to content

[desktop] Fix desktop bootstrap existing install pinning - #39884

Closed
CHYJ1227 wants to merge 1 commit into
NousResearch:mainfrom
CHYJ1227:fix/desktop-bootstrap-existing-install-pin
Closed

[desktop] Fix desktop bootstrap existing install pinning#39884
CHYJ1227 wants to merge 1 commit into
NousResearch:mainfrom
CHYJ1227:fix/desktop-bootstrap-existing-install-pin

Conversation

@CHYJ1227

@CHYJ1227 CHYJ1227 commented Jun 5, 2026

Copy link
Copy Markdown

What does this PR do?

Prevents packaged desktop bootstrap reruns from passing the build-stamp commit to the installer when activeRoot is already a git checkout. Fresh desktop bootstrap installs still receive the exact commit pin, but existing installs now stay on their configured branch during bootstrap repair/update instead of getting detached back to an older packaged stamp after hermes update.

I reproduced this from local desktop logs: bootstrap found an existing installation, updated to a newer HEAD, then immediately passed the packaged commit and ran Pinning checkout to commit ..., which detached the checkout back to the packaged app build stamp.

Related: #39192 also touches desktop install stamps, but it still pins official stamped commits unless commitPinned=false. This focused fix covers existing git checkouts on current main.

Related Issue

No issue filed.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • apps/desktop/electron/bootstrap-runner.cjs: add existing-git-checkout detection and skip commit pins for existing installs while preserving branch args.
  • apps/desktop/electron/bootstrap-runner.test.cjs: add regression coverage for fresh installs keeping commit pins and existing checkouts omitting them.

How to Test

  1. Start from a packaged desktop app whose install stamp points at an older commit.
  2. Ensure ~/.hermes/hermes-agent is an existing git checkout that has been updated beyond that stamp.
  3. Trigger desktop bootstrap again; the repository stage should not pass --commit/-Commit, so it should not detach the checkout back to the packaged stamp.

Validation run locally:

  • node --test apps/desktop/electron/bootstrap-runner.test.cjs
  • npm run test:desktop:platforms --workspace apps/desktop
  • npx eslint electron/bootstrap-runner.cjs electron/bootstrap-runner.test.cjs from apps/desktop
  • git diff --check
  • python3 scripts/check-windows-footguns.py apps/desktop/electron/bootstrap-runner.cjs apps/desktop/electron/bootstrap-runner.test.cjs

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.5.1 arm64

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Local log evidence before the fix showed repeated bootstrap repository stages like:

  • Existing installation found, updating...
  • HEAD is now at <newer branch head>
  • Pinning checkout to commit <older packaged stamp>...
  • HEAD is now at <older packaged stamp>

@CHYJ1227 CHYJ1227 changed the title [codex] Fix desktop bootstrap existing install pinning [desktop] Fix desktop bootstrap existing install pinning Jun 5, 2026
@CHYJ1227
CHYJ1227 marked this pull request as ready for review June 5, 2026 14:46
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have labels Jun 5, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator

Superseded by #61935 (current-main salvage of #59902 / this PR's core idea).

Closing as stale against the ts-ified desktop bootstrap runner.

@OutThisLife

Copy link
Copy Markdown
Collaborator

Superseded by #61935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants