Skip to content

Studio: rename the edit composer's Update button to Send, and resend an unchanged prompt - #11407

Merged
shimmyshimmer merged 2 commits into
mainfrom
studio/edit-composer-send
Sep 21, 2026
Merged

shimmyshimmer merged 2 commits into
mainfrom
studio/edit-composer-send

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

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:

if (newText === originalText) {
  aui.composer().cancel();
  return;
}

And underneath it, DefaultEditComposerRuntimeCore.handleSend only appends when something changed:

if (text !== this._previousText || attachmentsChanged || options?.startRun) {
  this.runtime.append({ ... });
}

So the send now passes { startRun: true }, which ComposerRuntime.send 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.

Testing

Driven against the real Thread in the smoke-heavy-thread harness:

Case Result
Open the editor Footer reads Cancel / Send
Send with zero characters changed New branch 2/2, composer closes, run starts
Send after editing the text New branch 2/2, text updated, run starts

Both 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.send bails on isEmpty. That is pre-existing. Happy to disable the button outright in that state if we would rather make it explicit.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-21T04:55:52.660306Z 7e1fa68 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

…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.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Good catch on the keyboard path, that was a real gap. ComposerPrimitive.Root is a form and the input submits it with requestSubmit(), so Enter reached ComposerRoot's own handler and called send() with no options, which still hit the unchanged-message guard.

Fixed in 7e1fa68. There is one submit path now: the form's onSubmit preventDefaults, which skips the library handler via composeEventHandlers, and runs submitEdit. The button is type=submit instead of carrying its own onClick, and the IME guard moved into submitEdit so both paths keep it.

Verified against the real thread, Enter with the text untouched: new branch 2/2, composer closes, run starts. Click unchanged and click after editing both still produce 2/2, and Cancel still creates no branch.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 7e1fa68557

ℹ️ 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".

@shimmyshimmer
shimmyshimmer merged commit b32e63e into main Sep 21, 2026
47 of 51 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio/edit-composer-send branch September 21, 2026 05:54
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…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]>
danielhanchen added a commit to NilayYadav/unsloth that referenced this pull request Sep 29, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant