Repository navigation
fix(chat): end failed chat loads and restore a chat reopened mid-load - #180
Merged
Merged
Conversation
Three ways opening a chat could leave it blank or loading forever: - A Session snapshot request had no deadline. A stalled request kept the spinner up indefinitely. readSession now times out after 15 s. - A failed snapshot request left the transcript in its loading phase, and clicking the same chat again did nothing. The failure now shows the translated load error with a retry button; retrying the selected chat loads it again. - Switching A -> B -> A while B was still loading kept B's empty loading state on screen, because A's stream was already current and hydration was skipped. A's loaded transcript is now shown again, and B's late response is ignored. Adds `sessionError.messagesLoadFailed` in en, de and es. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Problem
Opening a chat could leave it blank or loading forever:
readSessionhad none, so a stalled request kept the spinner up indefinitely.readSessionrejected,hydrateTranscripthad no error handling and the transcript stayed inloading. Clicking the same chat again did nothing:activeSessionIddidn't change, so no new load started.loadingscope, so A showed nothing.Equivalent fixes have been running in production on a patched 0.6.3 Host since 2026-10-16, after users reported exactly these symptoms. This PR ports them onto the current
HostProvider.Change
host-client.ts):readSessionusesAbortSignal.timeout, 15 s by default. It can be configured withsessionReadTimeoutMs.HostProvider.tsx): a failed hydration dispatchespage.failedwithsessionError.messagesLoadFailed. This only happens if that chat is still selected.HostProvider.tsx,MessageList.tsx): selecting the chat already selected while it is in the error state loads it again. A retry first leaves the error scope, so the loading state shows again.HostProvider.tsx): returning to the chat whose stream is already loaded re-selects its scope and shows that stream again. B's late response is ignored, as before.MessageListViewportShell.tsx,useMessageListModel.ts): the error view hasrole="alert"and a "Try again" button (common.retry). The model reads the error from the transcript store.sessionError.messagesLoadFailedin en, de and es.Tests
All 4 new tests fail on
masterand pass with this change:HostProvider.render.test.tsx:error, and the retry loads the chat.host-client.test.ts: a stalled snapshot request rejects with aTimeoutError.MessageListViewportShell.test.tsx: the error view offers a retry.Results:
pnpm run checkandpnpm run slop-checkpass.pnpm run test: 1,623 tests pass.For review
Returning to A shows the stream as it was loaded. It does not fetch it again, so it behaves like the existing early return. If A changed while it was in the background, the regular event stream still applies.
🤖 Generated with Claude Code