Skip to content

fix(tui): recover to Home when the session route fails to load - #2058

Open
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/session-route-load-recovery
Open

fix(tui): recover to Home when the session route fails to load#2058
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/session-route-load-recovery

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1936. A malformed --session/-s value (e.g. ses_…、) left the TUI on a black screen instead of showing an error and returning to Home.

Root cause: the session-route loader (packages/opencode/src/cli/cmd/tui/routes/session/index.tsx createEffect) calls sdk.client.session.get(…, { throwOnError: true }) and session.actors(…, { throwOnError: true }). With throwOnError, an HTTP error rejects rather than resolving { data: undefined }. The loader had no catch boundary, so a rejection escaped the async effect with the route still set to the failed session → black screen. The same missing boundary underlies the --continue "dummy" placeholder case (#1809).

Fix: wrap the loader body in try/catch. On any load failure, log the error, show a Cannot open session toast, and navigate Home — matching the existing Session not found / !verdict.renderable recovery behavior. No session-ID grammar rewriting required.

Test Plan

  • bun typecheck — clean.
  • Manual (maintainer): mimo -s 'ses_bogus、' → error toast + navigate Home, no black screen.

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed --session value can leave the TUI on a black screen

1 participant