fix: agent WSS send while connecting + prompt input draft persistence - #6191
Merged
Conversation
- Skip relaying feedback over the agent websocket until it is OPEN - session start re-triggers fetchReply while the socket is still connecting and the server already handles the invocation prompt itself - Guard debounced undo-stack snapshot against unmounted PromptInput - Scope prompt drafts correctly per thread/workspace: hydrate input on key change so drafts don't leak across threads, accept slug props on param-less routes (Home), cancel pending writes on draft clear, and stop storing empty drafts
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.
Pull Request Type
Relevant Issues
none
Description
Fixes a handful of small frontend bugs around new agent chats and prompt input draft persistence:
Agent websocket
InvalidStateErroron new agent chatSession start re-triggers
fetchReply(viasetLoadingResponse(true)) while the socket is stillCONNECTING, causingwebsocket.send()to throw. The send was also redundant — the server begins working on the invocation prompt itself on connect. We now skip relaying feedback unless the socket isOPEN.Cannot read properties of null (reading 'selectionStart')The debounced undo-stack snapshot in
PromptInputcan fire after the component remounts (empty→chat transition), whentextareaRefis null. Added a guard.Prompt input draft persistence fixes
undefined.""(existing empty entries are pruned on the next write).PENDING_HOME_MESSAGE.Visuals (if applicable)
Additional Information
Minor behavior change: drafts typed on the bare Home page before a workspace is selected are no longer persisted (they previously went into a shared
undefinedbucket).Developer Validations
yarn lintfrom the root of the repo & committed changes