Repository navigation
fix(sessions): a link to a gone session shows no other session (#1168) - #1180
Merged
Merged
Conversation
Opening /?session=<id> for a session that no longer exists, in a browser profile with workspace memory, showed the project's last open session and replaced the URL with it. The sidebar reported the missing session (onInitialRestoreDone), adopted its most recent project, and that cwd change went through handleCwdChange's cross-project branch, which restores the workspace's last open session. When the missing id came from the URL (linkedSessionId(); withTabOpen() now marks a tab-memory id with sessionFromTab), handleInitialRestoreDone sets skipWorkspaceRestoreRef and the next handleCwdChange keeps a fresh composer. The sidebar toasts "This session no longer exists". Later project switches restore as before; a gone session only this tab remembered still falls back as a fresh tab does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
…#1168) (agegr#1180) Opening /?session=<id> for a session that no longer exists, in a browser profile with workspace memory, showed the project's last open session and replaced the URL with it. The sidebar reported the missing session (onInitialRestoreDone), adopted its most recent project, and that cwd change went through handleCwdChange's cross-project branch, which restores the workspace's last open session. When the missing id came from the URL (linkedSessionId(); withTabOpen() now marks a tab-memory id with sessionFromTab), handleInitialRestoreDone sets skipWorkspaceRestoreRef and the next handleCwdChange keeps a fresh composer. The sidebar toasts "This session no longer exists". Later project switches restore as before; a gone session only this tab remembered still falls back as a fresh tab does. Co-authored-by: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…#1168) (agegr#1180) Opening /?session=<id> for a session that no longer exists, in a browser profile with workspace memory, showed the project's last open session and replaced the URL with it. The sidebar reported the missing session (onInitialRestoreDone), adopted its most recent project, and that cwd change went through handleCwdChange's cross-project branch, which restores the workspace's last open session. When the missing id came from the URL (linkedSessionId(); withTabOpen() now marks a tab-memory id with sessionFromTab), handleInitialRestoreDone sets skipWorkspaceRestoreRef and the next handleCwdChange keeps a fresh composer. The sidebar toasts "This session no longer exists". Later project switches restore as before; a gone session only this tab remembered still falls back as a fresh tab does. Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1168.
Problem
Opening
/?session=<id>for a session that no longer exists, in a browser profile that already has workspace memory, showed the project's last open session instead, and the URL changed to/. Nothing said the linked session was gone. The path, as the reporter traced it:SessionSidebarcallsonInitialRestoreDone()when the id isn't in its list, then adopts the most recent project.AppShell.handleCwdChange().restoreWorkspaceContext()there picks uppi-web:last-open-by-workspace.Change
lib/initial-navigation.ts:withTabOpen()marks an id that came from this tab's memory (sessionFromTab).linkedSessionId()returns the id only when it came from the URL.components/AppShell.tsx: when the linked id is missing,handleInitialRestoreDonesets a one-shotskipWorkspaceRestoreRef. The nexthandleCwdChange(the sidebar adopting its project) then shows a fresh composer instead of restoring that project's last session. Later project switches restore as before.components/SessionSidebar.tsx: shows a "This session no longer exists" toast in that case. The string is added to en / zh-CN / zh-TW./) still falls back as before.demo/lib/initial-navigation.tsis mirrored, anddocs/agents/sessions.mdhas a short note.Verification
components/AppShell.workspace-memory.test.mjsdrives the real AppShell callbacks the way the sidebar calls them on first load. The URL case fails against main (it restoresp1-last) and passes here; the tab-memory case keeps its fallback.lib/initial-navigation.test.mjscoverslinkedSessionId().tsc --noEmit, eslint, and 151 unit tests (initial-navigation, the AppShell tests, the SessionSidebar tests, i18n, tab-session) pass.node e2e/run.mjspassed 19/19 in 4 of 7 runs on this branch: 3/3 in a clean clone, plus a later run in my worktree. The 3 failures were all ate2e/run.mjs:492, waiting for "Hide sidebar" after returning from the 320px viewport. That is a known flaky step. In the same worktree, main passed 3/3 at that point, and the branch passed there later once.nextwas rebuilt.🤖 Generated with Claude Code