fix(desktop): scope restored navigation by profile (#67709) - #67823
fix(desktop): scope restored navigation by profile (#67709)#67823Tranquil-Flow wants to merge 1 commit into
Conversation
|
Thanks for the focused regression coverage. The underlying issue remains on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
SummaryFifteen PRs address or reference this Desktop issue complex; their diffs cover pin hydration, transcript virtualization, queue affinity and migration, messaging polling, stale-session recovery, new-window isolation, profile-scoped restoration, and composer/session races. For #67709, merged #74277 supplies route-key scoping, while recorded best fix #67823 additionally gates restoration on profile readiness and validates active-profile session ownership. Related pull requests
Duplicates#66270 is substantially duplicated by #67049, which has the stronger hook-boundary regression; #70610 was superseded by #70986; #60607 and #68181 overlap on stale cold-boot fallback, but #60607 uses the stronger terminal-resume signal; #67823 overlaps #74277 on route scoping while retaining distinct profile-readiness and ownership-validation work. Suggested consolidationAuthor action: rebase #67823 onto main, or split out the part that can merge, preserving the current per-profile session behavior from 143942d and route scoping from #74277 while carrying forward the renderer.ready restore gate, explicit active-profile ownership validation, and profile-scoped exhaustion cleanup. Close #66270 as duplicate of #67049, keep #70610 closed as superseded by #70986, and handle the remaining PRs in their distinct pin, polling, stale-session, window-isolation, composer-race, or queue-migration tracks. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I67709(["issue #67709 (open)"])
P67823["PR #67823 (open)"]
P67823 -->|best fix| I67709
class I67709 open
class P67823 open
class P67823 best
class P67823 target
click I67709 "https://github.com/NousResearch/hermes-agent/issues/67709"
click P67823 "https://github.com/NousResearch/hermes-agent/pull/67823"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 15 pull requests and 21 issues in this complex. Each diff was read against this issue; Assessment working set: 192 kB of PR diffs, 82 kB of issue/PR text, 53 kB of discussion (62 comments), 60 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
monerostar
left a comment
There was a problem hiding this comment.
Native Windows multi-profile live check on this PR (monerostar).
Env: Win11 10.0.26200 · Hermes Agent v0.20.0 (2026.8.3) · install tree %LOCALAPPDATA%\hermes\hermes-agent · Git Bash · head d491170f0 vs current origin/main f5be9236e
What still bites on current main (this box)
- Cold-start restore in
use-desktop-integrationsstill fires before primary profile adopt (profileReady/renderer.readynot gated). defaultstill uses the unsuffixedhermes.desktop.lastRoute/lastSessionIdkeys. On a tech-primary Desktop, we watched that global key hold an old tech session id and reopen it on every tech login until cleared/archived.- Fleet here: 6 profiles with
state.db(main/tech/house/lifestyle/x/play-free-win). Sticky primary is tech viaactive-profile.json.
PR unit tests on this host
Swapped the PR’s 5 files into the install apps/desktop tree (worktree has no node_modules), ran:
npm run test -- --run src/app/contrib/hooks/use-desktop-integrations.test.tsx src/store/session.test.ts
Result: 32/32 passed (2 files). Install sources restored after.
Rebase status
git cherry-pick --no-commit d491170f0 onto current origin/main conflicts in:
apps/desktop/src/app/contrib/hooks/use-desktop-integrations.tsapps/desktop/src/app/contrib/wiring.tsxapps/desktop/src/store/session.ts
Main already has a partial per-profile key scheme (lastRoute.<profile>, unsuffixed for default). This PR’s stronger shape (.profile.<encoded>, discard legacy globals, wait for profile ready, sessionBelongsToProfile) is still the right end state for #67709, but needs a clean rebase before merge.
Verdict: direction LGTM for the lived Windows multi-profile sticky-restore class; blocking only on rebase/conflict resolution, not on the approach. Happy to re-run the 32 after a refreshed tip.
d491170 to
11669f3
Compare
monerostar
left a comment
There was a problem hiding this comment.
Quick delta on our 15:33 note: the 08-04 rebase landed the blocking item we flagged. GitHub now reports CLEAN/MERGEABLE and all CI is green including Desktop E2E, so the three-file conflict on our earlier cherry-pick test is resolved.
Both main partials are confirmed ancestors (143942d session-id scoping, #74277 route scoping merge b84389c), so this PR's delta is the collision-proof .profile.<encoded> namespace, the legacy-global discard, and the sessionBelongsToProfile ownership gate. Still the right end state for #67709 from the Windows side.
One more for reviewers: #69572 (clear stale chat before profile switch) is a separate open PR on the sibling symptom, different mechanism, no diff overlap.
|
Salvaged as #79142 — rebased cleanly onto current with zero conflicts (the reported conflicts were from a dirty working tree, not actual content divergence; the PR's base and current main have identical content in all 5 affected files). The salvage also folds three findings from /simplify-code review:
All credit to @Tranquil-Flow for the original implementation. Closing in favor of #79142. |
|
Closed via salvage #79142 — items satisfied. kshitijk4poor merged #79142 (commit 8770754) on Aug 5 with the same profile-scoped restoration semantics (active-profile ownership, legacy global-key discard, profile-ready gate before restore, profile-scoped session/route storage). Tranquil-Flow author preserved on the merged commit. |
Closes #67709
What changed
renderer.readyWhy
The previous global keys could restore one profile's session into another. Restoration also raced primary-profile adoption, while the initial
/route could overwrite remembered history before the correct profile was ready.Verification
upstream/main: 6 failed, 26 passed with the two regression files copied over unchangedassert-dist-built: passedgit diff --check: passedupstream/mainRelated PR audit
Timeline-linked PRs #48473 and #59608 address profile forwarding to secondary/detached windows, not primary-window remembered navigation. PR #58138 contains runtime profile-switch session memory but does not repair the global localStorage keys or the boot/profile-adoption race. No open PR references #67709, and no same-author duplicate exists.
Auto-published by Moonsong via Path B automated pipeline.