@@ -37,7 +37,7 @@ import {
3737 type QueuedThreadMessage ,
3838 type ThreadOutboxCommandStage ,
3939} from "./thread-outbox-model" ;
40- import { environmentThreadShells , threadEnvironment } from "./threads" ;
40+ import { threadEnvironment } from "./threads" ;
4141import { useAtomCommand } from "./use-atom-command" ;
4242import {
4343 editingQueuedMessageIdsAtom ,
@@ -362,22 +362,12 @@ export function useThreadOutboxDrain(): void {
362362 return true ;
363363 }
364364 // The guards evaluated before the confirmation await are stale by now:
365- // the thread may have gone busy, or the user may have opened this
366- // message in the editor. Re-read both and defer to the next drain pass
367- // (returning true skips the failure/backoff path) rather than sending
368- // a payload the user is editing or racing an active turn.
365+ // the user may have opened this message in the editor. Re-read that
366+ // guard and defer to the next drain pass (returning true skips the
367+ // failure/backoff path) rather than sending a payload being edited.
369368 if ( appAtomRegistry . get ( editingQueuedMessageIdsAtom ) [ nextQueuedMessage . messageId ] ) {
370369 return true ;
371370 }
372- const freshThread = findThread (
373- appAtomRegistry . get ( environmentThreadShells . threadShellsAtom ) ,
374- nextQueuedMessage ,
375- ) ;
376- const freshThreadBusy =
377- freshThread ?. session ?. status === "running" || freshThread ?. session ?. status === "starting" ;
378- if ( deliveryAction === "send" && creation === undefined && freshThreadBusy ) {
379- return true ;
380- }
381371 return deliveryAction === "remove"
382372 ? removeQueuedMessage ( "[thread-outbox] failed to remove message for a missing thread" )
383373 : creation !== undefined
0 commit comments