Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/web/src/components/chat/useThreadLifecycle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,11 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {
: null;

const forceStop = useForceStopThread(environmentId);
// A draft's thread does not exist yet; loading it early caches the thread as deleted.
const anyRunStop = useAtomValue(
activeThreadRef ? environmentThreadDetails.runStopAtom(activeThreadRef) : NO_RUN_STOP_ATOM,
activeThreadRef && activeThreadShell !== null
? environmentThreadDetails.runStopAtom(activeThreadRef)
: NO_RUN_STOP_ATOM,
);
// A background Stop matters only while that work is still pending.
const runStop = anyRunStop?.background && activeBackgroundTasks.length === 0 ? null : anyRunStop;
Expand Down
Loading