open-swe/ui/src/lib
Caroline di Vittorio 3297e799de
fix: keep chat prompt bar editable while a run streams (#1533)
* fix: keep prompt bar editable while a run streams

The follow-up submit path awaited stream.submit, which resolves only when the
run finishes. That kept the react-query mutation isPending for the whole run,
so AgentThreadView disabled the prompt bar textarea the entire time the agent
was streaming - the user saw the "queue next" placeholder but couldn't click
in or type. Fire the run without awaiting its full lifecycle (matching the
new-thread path in AgentsHome) so the input stays editable for queueing.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* refactor(ui): guard double-submit internally instead of via disabled prop

Stop threading a run-lifecycle signal (the send mutation's isPending) into the
prompt bar to gate the input. Instead, the prompt bar owns a synchronous
double-submit guard (submittingRef) plus a short-lived isSubmitting state
scoped to the in-flight send. The textarea now stays editable while a run
streams (so follow-ups can be queued), and onSubmit is awaitable so the guard
tracks the actual send request rather than the run.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* fix(ui): surface failed run-start instead of leaving thread running

When stream.submit rejects (e.g. 401 expired token or 409 active-run
race), the fire-and-forget catch was a no-op while onSuccess had already
optimistically set status: running, leaving the thread stuck in a busy
state with no surfaced error. Clear the busy state and mark the thread
errored on submit failure.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: Johannes du Plessis <51395795+johannes117@users.noreply.github.com>
2026-06-15 17:29:17 -07:00
..
agents fix: keep chat prompt bar editable while a run streams (#1533) 2026-06-15 17:29:17 -07:00
api.ts feat: chat with your PR on the review page (#1534) 2026-06-15 17:17:30 -07:00
hotkeys.ts feat: add UI hotkey wiring and Cmd/Ctrl+B sidebar toggle (#1514) 2026-06-12 10:53:28 -07:00
profile.ts feat: Configure subagent model defaults (#1342) 2026-05-27 12:34:52 -07:00
query.ts feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
repo.test.ts feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
repo.ts feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
session.ts feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
theme.ts fix: theme-aware syntax highlighting in chat code blocks (#1479) 2026-06-10 09:58:20 -07:00
utils.ts feat: collapse finished agent work into a Worked for X dropdown (#1509) 2026-06-12 10:08:12 -07:00