The GitHub Actions job "CI" on 
rocketmq-dashboard.git/fix/ai-composer-stopping-draft has failed.
Run started by GitHub user unbridled-41 (triggered by unbridled-41).

Head commit for run:
d9059b1f47e377daeeed72660d7f74a9ea3a5aff / unbridled-41 
<[email protected]>
fix(ai): keep the composer draft when Enter arrives during stopping

The composer treats "stopping" as idle: canSend was derived from
`generating = isStreaming && !stopRequested`, so while the stop round-trip
is in flight the send slot is a disabled `stopping` button but canSend is
true. The Enter handler calls handleSend() regardless of the button state,
and handleSend() clears the draft before the caller can refuse:

  onSend(text);      // startStream() returns early: chatInFlightRef is true
  onChange('');      // draft already gone

startStream refuses to open a second stream while the run is still in
flight, so the prompt is silently dropped - no request, no toast, no
restored draft. For an existing conversation startRun even returns the
conversation id, so the page's `target === null` draft-restore never fires.

Fix: derive canSend from `!isStreaming`, matching the button's own
disabled state across the whole streaming window. In the `send` state
`generating` and `isStreaming` are equal, so the only behaviour that
changes is Enter during stopping: it now leaves the text in the box.

Tested: Composer.test.tsx -> 18 passed (new regression red before the fix:
onSend called once), all 195 AI page tests pass, tsc -b and eslint clean.

Report URL: 
https://github.com/apache/rocketmq-dashboard/actions/runs/37087125237

With regards,
GitHub Actions via GitBox

Reply via email to