You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
References to a deleted session outlive it: address bar, recent-tab pointer and persisted handoff #47683
params.dir only exists on the legacy /:dir/session/:id route. On /server/:serverKey/session/:id there is no directory, so currentHref stays undefined, removedCurrent stays false, and the navigation to the next tab never runs. tabHref builds from
server and session id alone and does not need the directory.
The recent-tab pointer survives. It is only cleared when the removed session still had an open
tab (if (recent.key && removed.includes(recent.key))). The pointer is persisted separately and
outlives the tab, so deleting a session that had already been closed leaves it aimed at the deleted
id.
The persisted layout handoff survives. It carries a session id across a layout switch
(store.handoff.tabs in packages/app/src/context/layout.tsx) and nothing clears it on deletion,
so later starts try to restore a session that is gone.
Fallout. When the app then resolves that id, current() throws. The two effects that read it — LegacyTargetSessionRedirect in packages/app/src/app.tsx and ResolvedTargetSessionRoute in packages/app/src/pages/session.tsx — throw from inside an effect. Solid's ErrorBoundary only
catches throws during render, so this passes the scoped SessionRouteErrorBoundary (which would
show the "not found" page) and reaches the global one, replacing the whole window with "something
went wrong" for a chat that was merely deleted.
Your report adds useful detail (the removeSessions route-param guard bug and the recent-tab pointer not being cleared), so it may still be worth keeping open as a broader umbrella for all three reference sites, but please review the linked issues to avoid duplicated effort.
Thanks for the detailed write-up. I tried this on the commit you reported (ea2d59d7ca) and on the latest dev (b6c43a52), in the web app with its end-to-end test setup and a mock server. I couldn't reproduce it:
Address bar: at ea2d59d7ca, deleting the open session on /server/:serverKey/session/:id from the session header's menu moved the URL to the next session. The header's delete action navigates away by itself, so the params.dir check in removeSessions doesn't matter on that path. On current dev, removeSessions no longer checks params.dir, and the existing tab test that deletes the current session passes: the URL moves to the next tab.
Recent-tab pointer: besides the check you quoted, the tabs store clears the recent pointer whenever no open tab matches it. Closing a tab already clears the pointer, so it shouldn't still point at a later-deleted session. I only checked this in the code; I didn't run a separate test for it.
"Something went wrong" page: opening a deleted session id, where the server answers with its usual "session not found" error, showed the scoped "This session cannot be found" page with a Close Tab button on both commits, not the global error page.
Layout handoff:store.handoff.tabs / context/layout.tsx no longer exist on current dev, and I couldn't test the restart path.
If you still see this, could you share:
whether it's the desktop app or the web app, and the build or version;
exactly how you deleted the session (session header menu, tab context menu, sidebar, home list, …);
the error details from the "Something went wrong" page, or the console output, after a restart.
Closing this for now. I couldn't reproduce it on ea2d59d7ca or on the latest dev (b6c43a52). Deleting the open session moved the URL to the next session. Opening a deleted session showed the "This session cannot be found" page with a Close Tab button, not the global error page. We haven't heard back about which app you use (desktop or web), how you deleted the session, or what the error page showed.
If it still happens on a current build, please reply with those details or open a new issue that links back to this one (#47683), and we'll take another look. Thanks for the detailed report.
Activity
github-actions commentedon Sep 6, 2026
This issue might be a duplicate of existing issues. Please check:
lastProjectSessionreferences a session missing fromopencode.db— also covers stale session pointers surviving deletion and causing fatal crashes on next launch.Your report adds useful detail (the
removeSessionsroute-param guard bug and the recent-tab pointer not being cleared), so it may still be worth keeping open as a broader umbrella for all three reference sites, but please review the linked issues to avoid duplicated effort.opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up. I tried this on the commit you reported (
ea2d59d7ca) and on the latestdev(b6c43a52), in the web app with its end-to-end test setup and a mock server. I couldn't reproduce it:ea2d59d7ca, deleting the open session on/server/:serverKey/session/:idfrom the session header's menu moved the URL to the next session. The header's delete action navigates away by itself, so theparams.dircheck inremoveSessionsdoesn't matter on that path. On currentdev,removeSessionsno longer checksparams.dir, and the existing tab test that deletes the current session passes: the URL moves to the next tab.store.handoff.tabs/context/layout.tsxno longer exist on currentdev, and I couldn't test the restart path.If you still see this, could you share:
opencodejr commentedon Oct 31, 2026
Closing this for now. I couldn't reproduce it on
ea2d59d7caor on the latestdev(b6c43a52). Deleting the open session moved the URL to the next session. Opening a deleted session showed the "This session cannot be found" page with a Close Tab button, not the global error page. We haven't heard back about which app you use (desktop or web), how you deleted the session, or what the error page showed.If it still happens on a current build, please reply with those details or open a new issue that links back to this one (#47683), and we'll take another look. Thanks for the detailed report.