fix(desktop): surface an error when session actions race controller startup#3946
Merged
Conversation
…tartup NewSession/ClearSession returned nil when the active tab's controller didn't exist yet (lazy per-tab construction includes MCP startup, so the window is real), and the frontend reset the transcript regardless — the click was swallowed with no feedback, and with a second workspace open "new session" appeared simply broken (#3938). The backend now names the reason (still starting, or the tab's startup failure), and the frontend only resets the transcript when the backend actually rotated the session. Closes #3938
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.
With two workspaces open, "new session" in the not-yet-started workspace did nothing:
App.NewSession/ClearSessionreturnnilwhen the tab's controller is still being built (lazy per-tab construction includes MCP startup, so the window is real — cf. #3818), and the frontend then dispatched itsresetregardless, clearing the visible transcript even though the backend did nothing. Silent success-shaped failure on both sides (#3938, discussion #3831).workspace is still starting, orworkspace failed to start: <tab.StartupErr>when the build actually failed (that case already has the topbar banner explaining itself).newSession/clearSessiononly reset the transcript when the backend call succeeded; a refusal keeps the conversation on screen instead of faking a fresh session.Test covers both the no-controller error and the startup-failure message carrying the tab's error.
Closes #3938