fix(tui): recover safely from invalid session routes - #1937
Open
jnhu76 wants to merge 1 commit into
Open
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
Fix the TUI black screen caused by failed session-route loads.
This covers two entry paths:
mimo -c, where the TUI previously started on a fabricatedsessionID: "dummy"route.mimo -s <session-id>values, where a failed session load could leave the TUI stuck on an unloadable route.Fixes #1809.
Fixes #1936.
Root cause
The
--continuepath used"dummy"as its initial session route while waiting to resolve a real session.The session page then called
session.get()withthrowOnError: truefrom an asynchronous SolidJS effect without a complete rejection boundary. A 400, 404, network failure, or another rejection could therefore leave the route pointing at a session that could never load, resulting in a black screen.The same missing recovery path could be reached through malformed or nonexistent values supplied using
--session/-s.Changes
app.tsx"dummy"initial route for--continue.--sessionvalue priority over--continue.routes/session/index.tsxsdk.client.session.get()withoutthrowOnError: true, allowing ordinary HTTP failures to be handled as results.Session not foundfor 404 responses and a generic load error otherwise, then navigate back to Home.Scope
thread.ts,attach.ts, or the lockfile.Verification
121tests)bun typecheck: PASS12packages): PASSFault injection and renderer-level CPU profiling were not automated. The change ensures that failed session loads terminate in a visible and recoverable Home-route state.