fix(input): gate stop branch on live processing state; never send ghost suggestion on stop click#343
Merged
chadbyte merged 1 commit intochadbyte:mainfrom Apr 29, 2026
Conversation
…st suggestion on stop click Regression after chadbyte#337 / 0753833 (ghost-text suggestion pattern). The sendBtn click handler checked hasSendableContent() and the ghost suggestion before the processing-stop branch, so clicking the visible Stop button while a ghost suggestion was queued sent the stale suggestion instead of stopping the SDK loop. Same shape on the Enter handler: pressing Enter while waiting on Claude adopted the ghost. Both paths now check (ctx.processing && !hasSendableContent()) up front: in that state the click/Enter is a Stop (or no-op for Enter) and never adopts a ghost suggestion. Otherwise the original send paths run unchanged. Predicating on live state instead of the button's "stop" CSS class avoids tying user-facing send behavior to the button-state machine in app-connection.js, which can drift on mobile (backgrounding, ws reconnect) and would wedge the input if its class got stuck.
Owner
|
Reviewed and looks good — merging. Thanks! (Side note: the earlier failing check was a flaw in our PR-checks workflow, not your code — the script it runs only existed on |
Contributor
|
This issue has been resolved in version 2.36.1-beta.3 (main). To update, run: -- Clay Deploy Bot Build anything, with anyone, in one place. |
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
Regression after #337 / 0753833 (ghost-text suggestion pattern). The
sendBtnclick handler inlib/public/modules/input.jscheckshasSendableContent()and the ghost suggestion before the processing-stop branch, so clicking the visible Stop button while a ghost suggestion is queued sends the stale suggestion instead of stopping the SDK loop. Same shape on the Enter handler: pressing Enter while waiting on Claude adopts the ghost.This PR adds a
(ctx.processing && !hasSendableContent())guard at the top of both handlers. In that state the click/Enter is a Stop (or no-op for Enter) and never adopts a ghost suggestion. Otherwise the original send paths run unchanged.The guard predicates on live state rather than the button's
stopCSS class — that class lives on a state machine that can drift on mobile (backgrounding, ws reconnect) and would wedge the input if its class got stuck.Repro
Before: the ghost suggestion is sent as a new message; the SDK loop keeps running.
After: the SDK loop stops; the ghost is not sent.
Test plan