Skip to content

feat(desktop): restore session when switching profiles - #77957

Open
zaycruz wants to merge 2 commits into
NousResearch:mainfrom
zaycruz:feat/desktop-profile-session-restore
Open

feat(desktop): restore session when switching profiles#77957
zaycruz wants to merge 2 commits into
NousResearch:mainfrom
zaycruz:feat/desktop-profile-session-restore

Conversation

@zaycruz

@zaycruz zaycruz commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Closes #77952.

Hermes Desktop already stores the last route and session per profile for cold-start restore. Profile switching still discarded the foreground session and opened a fresh draft. This change uses the existing per-profile state for live profile switching.

Behavior

  • Save and restore the last non-overlay route for each profile.
  • Restore the remembered session when the route points to a session.
  • Open a new chat when the target profile has no remembered session.
  • Wait for the target gateway before restoring the route.
  • Coalesce rapid profile switches so an older switch cannot restore the wrong profile.
  • Keep explicit New Session actions unchanged.
  • Restore correctly when leaving All profiles mode.

Verification

  • npx vitest run --project ui src/store/profile.test.ts — passed, 15 tests.
  • npm run typecheck — passed.
  • npx prettier --check src/app/contrib/wiring.tsx src/store/profile.ts src/store/profile.test.ts — passed.
  • npm run build — passed.
  • npm run lint -- --quiet — blocked because the workspace install did not link eslint.
  • The combined profile/session test command exposed an existing UI test setup failure: its localStorage stub has no setItem, removeItem, or clear methods. The changed profile test passes independently.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) area/config Config system, migrations, profiles labels Aug 3, 2026
@zaycruz

zaycruz commented Aug 3, 2026

Copy link
Copy Markdown
Author

Adversarial quality gate — GREEN

Iteration 2 passed all required available gates on base and head:

  • Focused unit: base 11/11, head 15/15
  • Affected regression: base 57/57, head 61/61
  • Adjacent route/session tests: 53/53 on both
  • Type check, format, ESLint, and production build: pass on both

Adversarial review found no MUST-FIX findings.

ACCEPTABLE-RISK:

  1. The exact ContribWiring React effect has no direct component harness.
  2. Desktop E2E is disabled globally by the repository CI orchestrator while Desktop E2E red on every PR since Aug 1 engines churn — suite temporarily disabled, needs root fix + re-enable #76627 tracks the failure.

The durable Markdown and HTML reports are saved locally at:

/Users/master/Mac-Studio/Hermes/Quality Reports/hermes-agent-pr-77957-cf1c9975c/

The gate caught and corrected false local failures caused by invalid Node localStorage setup and incomplete baseline dependencies before assigning the final result.

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

Labels

area/config Config system, migrations, profiles comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): restore the last selected session when switching profiles

2 participants