Conversation
The Windows Desktop update hand-off (scripts/desktop-update/windows.ps1) runs its post-update verification as verify_windows_desktop_update(Path.cwd()). But the hand-off is spawned with cwd=HERMES_HOME (see apps/desktop/electron/main.ts), one level above the checkout root HERMES_HOME/hermes-agent that the verifier expects. verify_windows_desktop_update resolves apps/desktop/release under the path it is given, so Path.cwd() points at HERMES_HOME/apps/desktop/... which does not exist. The verify then raises 'The updated Desktop executable is missing' (exit 8) even though hermes update itself succeeded and the desktop app was rebuilt and packaged correctly. Pass $InstallRoot explicitly as sys.argv[1] so the verifier resolves the checkout root regardless of the hand-off's working directory. Adds a source-level regression test guarding that the verify step never falls back to Path.cwd().
Duplicate of #105454 -- same mechanism (pass the explicit |
|
Resolved on main by #106175 (c32e0ac), salvaging @fangliquanflq’s earlier #105168 with authorship preserved. The handoff now sets the native process cwd to InstallRoot before launching update/verification children, retaining all integrity checks. Native Windows regression coverage exercises the production call: neutralizing it reproduces the wrong cwd; restoring it passes all 15 related tests. Receipt: https://github.com/NousResearch/hermes-agent/actions/runs/34293439570. Thanks @KeErBo for the fix and investigation. Closing this superseded proposal to consolidate the resolved cwd bug. |
Summary
The Windows Desktop update hand-off (
scripts/desktop-update/windows.ps1) runs its post-update verification as:But the hand-off is spawned with
cwd: HERMES_HOME(seeapps/desktop/electron/main.ts), which is one level above the checkout rootHERMES_HOME/hermes-agentthatverify_windows_desktop_updateexpects.verify_windows_desktop_updateresolvesapps/desktop/releaseunder the path it is given, soPath.cwd()points atHERMES_HOME/apps/desktop/...— which does not exist. The verify then raises:…and the hand-off exits with code 8, even though
hermes updateitself succeeded and the desktop app was rebuilt and packaged correctly.Root cause
The verify step relies on the process working directory instead of the explicit
-InstallRootargument the script already receives. The hand-off'scwdisHERMES_HOME, not the checkout root.Fix
Pass
$InstallRootexplicitly assys.argv[1]:Test plan
test_verify_step_passes_install_root_not_cwd) guarding that the verify step never falls back toPath.cwd()and always forwards$InstallRoot.pytest tests/test_desktop_update_windows_python_handoff.py— 5 passed.Path.cwd()(exit 1) and confirmed the fix resolves the checkout root correctly (exit 0).