fix(desktop): preserve new-chat and rail restore intent (#67859) - #67906
fix(desktop): preserve new-chat and rail restore intent (#67859)#67906Tranquil-Flow wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating both launch-intent and rail-restoration behavior.
Problems
apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts:44,75reads and clears the unscoped remembered-session key. Current main's143942d497made this state profile-owned; current restore reads the active profile atapps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts:108. A direct port would leave the stale-session fallback for non-default profiles.- The preview half targets the pre-
96999b116bsession-preview model. Currentapps/desktop/src/app/session/hooks/use-preview-routing.ts:29-115has no restore path, and currentapps/desktop/src/store/preview.ts:94-145uses persistent preview tabs rather thanrestorePreviewTarget/ session registries. Those APIs are absent on main.
Suggested changes
- Rebase the launch-intent logic conceptually onto the current profile-scoped session helpers and add a non-default-profile regression.
- Drop/rework the preview changes against the persistent-tab architecture only if the rail issue still reproduces there.
Automated hermes-sweeper review.
| // it. This survives StrictMode effect replay and later in-app navigation. | ||
| const startupRestoreRef = useRef({ | ||
| route: getRememberedRoute(), | ||
| sessionId: getRememberedSessionId() |
There was a problem hiding this comment.
Current main scopes remembered sessions per profile (143942d497), and its restore reads getRememberedSessionId($activeGatewayProfile.get()). Capture this value with the same active/owning profile and clear that profile's key below; otherwise a non-default profile retains its stale fallback session.
| @@ -57,14 +57,14 @@ export function usePreviewRouting({ | |||
| // open on their own. | |||
| useEffect(() => { | |||
| if (currentView !== 'chat' || !previewSessionId) { | |||
| setPreviewTarget(null) | |||
| restorePreviewTarget(null) | |||
There was a problem hiding this comment.
This restore path was removed by current main's 96999b116b preview-tab refactor: restorePreviewTarget and the session-preview registry no longer exist. Please re-evaluate this behavior against persistent $previewTabs; this hunk cannot be ported directly.
SummaryOne PR, #67906, addresses both reported causes: stale-session fallback after leaving New Chat and preview restoration reopening a collapsed right rail. Its diff implements both fixes against the pre-refactor architecture, while the contributor review documents that current main now uses profile-scoped remembered sessions and persistent preview tabs. Related pull requests
Suggested consolidationKeep #67906 open with a salvage path: retain its New Chat intent logic and regression coverage, but rebase that logic onto the current profile-scoped session helpers and test a non-default profile; reproduce the rail issue against persistent preview tabs and only then rework the obsolete preview portion. This follows the visible keep_open review and preserves #67906 as the recorded best consolidation candidate without recommending its current diff for merging. 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
I67859(["issue #67859 (open)"])
P67906["PR #67906 (open)"]
P67906 -->|best fix| I67859
class I67859 open
class P67906 open
class P67906 best
class P67906 target
click I67859 "https://github.com/NousResearch/hermes-agent/issues/67859"
click P67906 "https://github.com/NousResearch/hermes-agent/pull/67906"
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 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 15 kB of PR diffs, 7 kB of issue/PR text, 2 kB of discussion (4 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
4d423c4 to
c738a6b
Compare
c738a6b to
c725666
Compare
Closes #67859
What changed
/route can overwrite itWhy
The startup effect could persist
/before reading prior navigation, and/then fell through to the stalelastSessionId. Preview restoration also used the explicit-open path, whose synchronous controller listener expanded the right side even when the user had collapsed it before quitting.Verification
/navigated to the stale sessiongit diff --check: passedupstream/mainRelated PR audit
PR #67823 overlaps the remembered-navigation file but addresses profile ownership and boot/profile adoption. Its restore path still falls through from remembered
/to the session, and it does not touch preview/right-rail restoration; it therefore does not cover #67859.Auto-published by Moonsong via Path B automated pipeline.