Assistant: block "Nueva conversación" while a run is streaming
All checks were successful
Deploy to VPS / test (push) Successful in 1m28s
Deploy to VPS / deploy (push) Successful in 21s

MAF persists the thread at run END, so clearing mid-stream deleted the
row only for the finishing run to write the conversation right back —
the thread reappeared after the reload ("chunks" needing a second
clear). The button is now disabled while agent.isRunning.

(The chunked-clear reports on the prior build had a second cause fixed
in 0f34a64: clearing left the client's message copy alive and the next
question re-persisted it.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-07-04 19:53:15 -06:00
parent 3f4df6f16b
commit 15fa18411a

View File

@@ -144,7 +144,10 @@ export default function Asistente() {
variant="outline"
size="sm"
onClick={() => setConfirmClear(true)}
disabled={!agent || agent.messages.length === 0}
// Also disabled mid-run: MAF saves the thread at run END, so
// clearing while an answer streams would delete the row only
// to have the finishing run write it right back.
disabled={!agent || agent.messages.length === 0 || agent.isRunning}
>
<MessageSquarePlus />
Nueva conversación