fix(update): preserve dashboard session token on respawn - #83252
fix(update): preserve dashboard session token on respawn#83252mazikooooo wants to merge 1 commit into
Conversation
Capture each manually-started backend's HERMES_DASHBOARD_SESSION_TOKEN before the update kill (alongside the argv/HERMES_HOME snapshots), then forward only that token to the respawned child's environment. Rebased onto the NousResearch#78821 respawn filtering: tokens are re-attached to the filtered commands by normalized cmdline (first occurrence wins, matching the filter's dedupe order), and the bare-argv respawn call is kept when no token was captured.
f579720 to
9d3de9f
Compare
fix(update): preserve dashboard session token on respawn
No blocking issues found. |
Summary
Preserve an explicitly injected
HERMES_DASHBOARD_SESSION_TOKENwhenhermes updaterespawns a manually startedhermes dashboardorhermes serveprocess.Without this, the replacement backend can remain HTTP-healthy while Hermes Desktop loses authenticated WebSocket access because the updater inherited different launch-time state than the old backend.
Root cause
The update path already captures each manual backend's argv before stopping stale code, then respawns that argv after the update. Process-only authentication state was not captured, so the replacement inherited only the updater's environment.
Changes
--stop,--no-open, and failure-reporting paths unchanged.Security
Tests
29 passed, 3 skippedintest_update_stale_dashboard.py(includes the upstream [Bug]: hermes update respawns every orphanhermes serve --port 0, accumulating backends across updates #78821 respawn-filter tests, unchanged and green).11 passedacrosstest_dashboard_lifecycle_flags.py+test_lazy_command_exports.py.git diff --checkpasses.Rebase note (2026-08-15)
Rebased onto current
main(post-#78821 respawn filtering). Tokens are nowcaptured alongside the argv/
HERMES_HOMEpre-kill snapshots and re-attachedto the filtered respawn commands by normalized cmdline (first occurrence wins,
matching the filter's dedupe order). When no token was captured, the respawn
call keeps its original bare-argv form, so existing callers and mocks are
unaffected. New tests also carry the class's POSIX
skipifmarkers.Platforms
Tested on WSL2/Linux. The existing native-Windows manual-respawn exclusion is unchanged; native macOS and Windows were not exercised locally.
Related work
This is deliberately narrower than #54034. It does not persist generated session tokens across arbitrary daemon restarts; it preserves an explicitly injected token only across the existing manual update-respawn transaction.