fix(tui): recover to Home when the session route fails to load - #2058
Open
YOMXXX wants to merge 1 commit into
Open
fix(tui): recover to Home when the session route fails to load#2058YOMXXX wants to merge 1 commit into
YOMXXX wants to merge 1 commit into
Conversation
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.
Summary
Fixes #1936. A malformed
--session/-svalue (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.tsxcreateEffect) callssdk.client.session.get(…, { throwOnError: true })andsession.actors(…, { throwOnError: true }). WiththrowOnError, 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 sessiontoast, and navigate Home — matching the existingSession not found/!verdict.renderablerecovery behavior. No session-ID grammar rewriting required.Test Plan
bun typecheck— clean.mimo -s 'ses_bogus、'→ error toast + navigate Home, no black screen.Notes
mimo -c(continue) shows black screen after upgrade — sessionID"dummy"rejected by backend #1809 (same missing recovery boundary via the--continueplaceholder) benefits from the same catch.