Repository navigation
Studio: rename the edit composer's Update button to Send, and resend an unchanged prompt - #11407
Conversation
…an unchanged prompt
Editing a message and pressing the button without touching the text closed the
composer and did nothing. The button now reads Send and always resubmits.
Two guards dropped the unchanged case. The click handler bailed to
composer().cancel() when the text matched, and underneath it
DefaultEditComposerRuntimeCore.handleSend only appends when the text or the
attachments changed, or when startRun is set. Removing the first alone would
have changed nothing, so the send now passes { startRun: true }, which the
ComposerRuntime API documents as forcing a new run.
The thread.runEnd path that resends after cancelling an in-flight run passes it
too, so editing mid-response behaves the same.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69170a3e30
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| aui.composer().send(); | ||
| // startRun forces a run when nothing was typed: the edit composer's send | ||
| // drops a message whose text and attachments are unchanged. | ||
| aui.composer().send({ startRun: true }); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…send too ComposerPrimitive.Root is a form and ComposerPrimitive.Input submits it with requestSubmit() on the send chord, so Enter and Ctrl/Cmd+Enter reached ComposerRoot's own handler, which calls send() with no options. That still hit the unchanged-message guard in DefaultEditComposerRuntimeCore, so the advertised resend only worked from the button. There is now one submit path. The form's onSubmit preventDefaults, which skips the library handler via composeEventHandlers, and runs submitEdit. The button is type=submit rather than carrying its own onClick, and the IME guard moved into submitEdit so both paths keep it.
|
Good catch on the keyboard path, that was a real gap. Fixed in 7e1fa68. There is one submit path now: the form's Verified against the real thread, Enter with the text untouched: new branch @codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…an unchanged prompt (unslothai#11407) * Studio: rename the edit composer's Update button to Send, and resend an unchanged prompt Editing a message and pressing the button without touching the text closed the composer and did nothing. The button now reads Send and always resubmits. Two guards dropped the unchanged case. The click handler bailed to composer().cancel() when the text matched, and underneath it DefaultEditComposerRuntimeCore.handleSend only appends when the text or the attachments changed, or when startRun is set. Removing the first alone would have changed nothing, so the send now passes { startRun: true }, which the ComposerRuntime API documents as forcing a new run. The thread.runEnd path that resends after cancelling an in-flight run passes it too, so editing mid-response behaves the same. * Studio: route the edit composer's keyboard submit through the forced send too ComposerPrimitive.Root is a form and ComposerPrimitive.Input submits it with requestSubmit() on the send chord, so Enter and Ctrl/Cmd+Enter reached ComposerRoot's own handler, which calls send() with no options. That still hit the unchanged-message guard in DefaultEditComposerRuntimeCore, so the advertised resend only worked from the button. There is now one submit path. The form's onSubmit preventDefaults, which skips the library handler via composeEventHandlers, and runs submitEdit. The button is type=submit rather than carrying its own onClick, and the IME guard moved into submitEdit so both paths keep it. --------- Co-authored-by: Unsloth <[email protected]>
Main now always resends from the edit composer (unslothai#11407) and diffs attachments itself, so the original-attachments comparison is dropped; the edit composer still renders the attachments and a paste without its File previews instead of inlining.
Editing a sent message and pressing the button without changing a character closed the composer and did nothing. The button also read
Update, which is not what it does.It now reads
Send, and pressing it always resubmits the prompt.Why it took two changes
Two separate guards dropped the unchanged case, so removing either one alone would have changed nothing.
The click handler bailed out first:
And underneath it,
DefaultEditComposerRuntimeCore.handleSendonly appends when something changed:So the send now passes
{ startRun: true }, whichComposerRuntime.senddocuments as forcing a new run. Thethread.runEndpath that resends after cancelling an in-flight run passes it too, so editing mid-response behaves the same.Testing
Driven against the real
Threadin thesmoke-heavy-threadharness:Cancel/Send2/2, composer closes, run starts2/2, text updated, run startsBoth cases hit the harness stub
smoke-heavy-thread does not run the model, which is what confirms a run actually fired rather than being dropped. Before this, the unchanged case produced no branch at all.Typecheck clean, full suite passes (8154 tests).
Note
Sending an empty composer still does nothing, since
BaseComposerRuntimeCore.sendbails onisEmpty. That is pre-existing. Happy to disable the button outright in that state if we would rather make it explicit.