Skip to content

feat(desktop): add file-backed session pins bridge - #54299

Closed
rerdi92 wants to merge 3 commits into
NousResearch:mainfrom
rerdi92:hq/recovery-stack-pr-20260628-230443
Closed

feat(desktop): add file-backed session pins bridge#54299
rerdi92 wants to merge 3 commits into
NousResearch:mainfrom
rerdi92:hq/recovery-stack-pr-20260628-230443

Conversation

@rerdi92

@rerdi92 rerdi92 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Harden Windows detached gateway restart so HQ Admin Helper is preferred when available, with CLI fallback and preserved upstream restart timeout behavior.
  • Sort numbered Desktop sessions consistently across sidebar, command center, and command palette.
  • Add a file-backed Desktop pinned sessions bridge so external automation can sync pinned session IDs with the renderer/localStorage state.

Test plan

Fresh local verification was run on the PR-ready clean worktree and active local main.

Clean worktree (C:/Users/82109/AppData/Local/hermes/worktrees/hq-upstream-verify-20260628-222651):

  • python -m pytest tests/gateway/test_restart_drain.py -q -n 0 → 22 passed, 2 warnings
  • python -m py_compile gateway/run.py tests/gateway/test_restart_drain.py → passed
  • git diff --check origin/main..HEAD -- gateway/run.py tests/gateway/test_restart_drain.py → passed
  • conflict-marker check for gateway restart files → passed
  • added-line security scan for gateway restart files → passed
  • full git diff --check origin/main..HEAD → passed

Active local main (C:/Users/82109/AppData/Local/hermes/hermes-agent):

  • python -m pytest tests/gateway/test_restart_drain.py -q -n 0 → 21 passed, 2 warnings
  • npm --workspace apps/desktop run test:ui -- src/store/session.test.ts src/store/layout.test.ts → 23 passed
  • npm --workspace apps/desktop run typecheck → passed
  • focused ESLint for changed Desktop files → passed
  • python -m py_compile gateway/run.py gateway/session.py tests/gateway/test_restart_drain.py → passed
  • node --check apps/desktop/electron/main.cjs → passed
  • node --check apps/desktop/electron/preload.cjs → passed
  • targeted git diff --check / conflict marker checks / added-line security scan → passed
  • full git diff --check origin/main..HEAD → passed

Notes

This branch was built from a clean origin/main worktree and keeps the recovery stack separate from the divergent local main state.

@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery platform/windows Native Windows-specific behavior or breakage P3 Low — cosmetic, nice to have sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Jun 28, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the persistence bridge work. The related pinned-session problem remains real on current main, but this patch does not yet make an externally restored aged pin display.

Problems

  • Current refresh still requests only a bounded recent page at apps/desktop/src/app/session/hooks/use-session-list-actions.ts:176; mergeSessionPage() at apps/desktop/src/store/session.ts:188-195 can retain only rows already in memory. The bridge adds IDs, not a fetch for missing session rows, so a cold-start pin outside that page remains unresolved. This matches the cross-referenced Pinned sessions disappear from sidebar — mergeSessionPage doesn't load them if they fall off the page #51685 report.
  • The patch targets apps/desktop/electron/main.cjs and preload.cjs, while current main uses apps/desktop/electron/main.ts and preload.ts; it needs a TypeScript port rather than a direct cherry-pick.

Suggested changes

  • Reconcile missing durable pinned IDs with an authoritative session lookup and add the cold-start/outside-page test.
  • Port the Electron bridge to the current TypeScript entry points and revalidate the focused changes independently.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/sessions Session lifecycle, resume, persistence, history labels Jul 15, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator

Superseded by #74234, which makes pins server-owned so they survive paging and sync between apps. Your work is carried in it and you're credited as a co-author — thank you.

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

Labels

area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants