feat: add retry and new session buttons to disconnect error screen#8313
feat: add retry and new session buttons to disconnect error screen#8313jeffa-block wants to merge 1 commit intoblock:mainfrom
Conversation
Replace the single 'Go home' button on the Failed to Load Session screen with: - 'Retry connection' — clears the error and re-triggers session load - 'New session' — navigates to hub to start fresh - Session ID display (selectable) for context recovery The retry works by adding a retryCount state to useChatStream that is included in the session load effect's dependency array. Incrementing it re-runs the effect, which calls resumeAgent again.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d3400ecee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const retrySessionLoad = useCallback(() => { | ||
| dispatch({ type: 'SET_SESSION_LOAD_ERROR', payload: undefined }); | ||
| dispatch({ type: 'SET_CHAT_STATE', payload: ChatState.LoadingConversation }); | ||
| setRetryCount((c) => c + 1); |
There was a problem hiding this comment.
Invalidate cached session before retrying load
retrySessionLoad() only bumps retryCount, but it never clears resultsCache for this sessionId. In the common disconnect case (session already loaded once), the load effect immediately returns cached data (resultsCache.get(sessionId)) and skips resumeAgent, so "Retry connection" does not actually retry the backend connection and can falsely recover the UI while the server is still down.
Useful? React with 👍 / 👎.
Replace the single "Go home" button on the disconnect error screen with:
retryCountin the effect depsFixes #8311 (PR 2 of 2)
Changes
retrySessionLoad()callback usingretryCountstate in session load effect deps (+11/-2)Testing
Manual — BaseChat has no existing test coverage and is tightly coupled to
useChatStreaminternals. If reviewers want unit tests, happy to extract a<SessionErrorScreen>component as a follow-up.