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
Session-not-found errors are only detected in the exact V1 shape, other wrappers are missed #48012
isSessionNotFoundError / isLocalSessionNotFoundError in the app only recognise the exact V1 tagged shape (_tag === "SessionNotFoundError" with matching sessionID) and the exact local Error.message. When the server returns session-deletion errors through other wrappers — a plain string body, an object with name: "NotFoundError" and data.message, or any serialised object whose message contains the not-found text — the detector misses it, so UI code that should treat the session as gone (hide the entry, stop retrying, drop references) instead keeps it or shows a generic failure.
Plugins
N/A
OpenCode version
dev (current upstream/dev)
Steps to reproduce
Open a session, then delete it on the server (or let a worker remove it).
Trigger a request against the deleted session (rename, load, switch).
The error arrives shaped as a string "Session not found: <id>" or as a NotFoundError object. isSessionNotFoundError returns false, so the app does not route to the "session gone" handling and surfaces a generic error.
Screenshot and/or share link
N/A
Operating System
Windows 11 (platform-independent)
Terminal
N/A (app UI / desktop)
Related / duplicate check
No open issue matches this specific error-shape detection gap; verified by search.
If your issue is specifically about the isSessionNotFoundError / isLocalSessionNotFoundError detection functions missing non-V1 error shapes (plain string, NotFoundError object, etc.), it may be distinct from the above. Please cross-reference and close or link as appropriate.
These related issues describe observable symptoms of a session going away (renderer crash on a stale lastProjectSession pointer, unhandled rejection bursts from stale subagent sessions, survivor references). This issue is narrower and distinct: it targets the two detection predicates (isSessionNotFoundError / isLocalSessionNotFoundError) that decide whether an incoming error is a not-found shape at all. Fixing the predicates makes all three symptom paths route correctly through the existing "session gone" handling instead of treating the error as generic.
Cross-reference: the mQorva fork has a related fix for the survivor-reference path (#47683 / stale-session-references); this issue covers the shared predicate that both that fix and the crash/overlay paths depend on.
On current dev, the server converts a missing session into a tagged SessionNotFoundError ({ _tag: "SessionNotFoundError", sessionID, message }) in packages/server/src/handlers/session-error.ts, and isSessionNotFoundError in the app matches that shape. I couldn't find a v2 server path that returns name: "NotFoundError" with data.message; that looks like the v1 error format. To check whether there's a real gap, could you share:
The exact action and request that failed (for example rename, load or switch, and which endpoint it calls, if you know).
The raw error the app received: the response body and status from the network tab or the server logs, or the error value reaching isSessionNotFoundError.
The output of opencode --version for the server you were connected to, and how it was started (desktop app, opencode serve, etc.).
You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
Closing this for now, since we haven't heard back. To tell whether isSessionNotFoundError really misses a case, we'd need to see a v2 server send a session-not-found error in a shape the check doesn't recognise. The server code on dev always sends the tagged SessionNotFoundError, and the check matches that.
If you see this happen, please comment here or open a new issue with:
the action or request that failed
the raw response body and status, or the error value the app received
your opencode --version
We'll be happy to take another look. Thanks for reporting!
Activity
github-actions commentedon Sep 8, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about the
isSessionNotFoundError/isLocalSessionNotFoundErrordetection functions missing non-V1 error shapes (plain string,NotFoundErrorobject, etc.), it may be distinct from the above. Please cross-reference and close or link as appropriate.CannonRS commentedon Sep 8, 2026
These related issues describe observable symptoms of a session going away (renderer crash on a stale lastProjectSession pointer, unhandled rejection bursts from stale subagent sessions, survivor references). This issue is narrower and distinct: it targets the two detection predicates (
isSessionNotFoundError/isLocalSessionNotFoundError) that decide whether an incoming error is a not-found shape at all. Fixing the predicates makes all three symptom paths route correctly through the existing "session gone" handling instead of treating the error as generic.Cross-reference: the mQorva fork has a related fix for the survivor-reference path (#47683 / stale-session-references); this issue covers the shared predicate that both that fix and the crash/overlay paths depend on.
opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up!
On current
dev, the server converts a missing session into a taggedSessionNotFoundError({ _tag: "SessionNotFoundError", sessionID, message }) inpackages/server/src/handlers/session-error.ts, andisSessionNotFoundErrorin the app matches that shape. I couldn't find a v2 server path that returnsname: "NotFoundError"withdata.message; that looks like the v1 error format. To check whether there's a real gap, could you share:errorvalue reachingisSessionNotFoundError.opencode --versionfor the server you were connected to, and how it was started (desktop app,opencode serve, etc.).You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
opencodejr commentedon Oct 31, 2026
Closing this for now, since we haven't heard back. To tell whether
isSessionNotFoundErrorreally misses a case, we'd need to see a v2 server send a session-not-found error in a shape the check doesn't recognise. The server code ondevalways sends the taggedSessionNotFoundError, and the check matches that.If you see this happen, please comment here or open a new issue with:
opencode --versionWe'll be happy to take another look. Thanks for reporting!