Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): a new thread's first reply shows without reloading #27522

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/27522/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 69 additions and 1 deletion (loading 1).

x
0 of 4 viewed, 4 left
4 additions and 1 deletionapps/web/src/components/chat/useThreadLifecycle.tsxModified
View file
@@ -87,6 +87,8 @@
readonly activeThread: EnvironmentThreadShell | undefined;
readonly activeThreadId: ThreadId | null;
readonly activeThreadRef: ScopedThreadRef | null;
+ /** Null until the thread's detail may load; see resolveThreadDetailRef. */
+ readonly threadDetailRef: ScopedThreadRef | null;
readonly activeThreadKey: string | null;
readonly activeThreadShell: EnvironmentThreadShell | null;
readonly activeLatestRun: EnvironmentThreadShell["latestRun"];
@@ -138,6 +140,7 @@
activeThread,
activeThreadId,
activeThreadRef,
+ threadDetailRef,
activeThreadKey,
activeThreadShell,
activeLatestRun,
@@ -524,7 +527,7 @@
​
const forceStop = useForceStopThread(environmentId);
const anyRunStop = useAtomValue(
- activeThreadRef ? environmentThreadDetails.runStopAtom(activeThreadRef) : NO_RUN_STOP_ATOM,
+ threadDetailRef ? environmentThreadDetails.runStopAtom(threadDetailRef) : NO_RUN_STOP_ATOM,
// A background Stop matters only while that work is still pending.
const runStop = anyRunStop?.background && activeBackgroundTasks.length === 0 ? null : anyRunStop;