diff --git a/frontend/app/components/assistant-ui/thread.tsx b/frontend/app/components/assistant-ui/thread.tsx index f6cafe2..c8a5942 100644 --- a/frontend/app/components/assistant-ui/thread.tsx +++ b/frontend/app/components/assistant-ui/thread.tsx @@ -856,7 +856,11 @@ const ComposerWorkspaceStatus: FC<{ sessionId: string | null }> = ({ const ComposerAction: FC = () => { const runtimeRunning = useAuiState((s) => s.thread.isRunning); const replayedRun = useReplayedRunState(); - const cancelSessionId = replayedRun.sessionId; + const currentSessionId = useCurrentThreadSessionId({ + includePending: true, + includeActive: true, + }); + const cancelSessionId = replayedRun.sessionId ?? currentSessionId; return (
@@ -880,21 +884,22 @@ const ComposerAction: FC = () => { ) : null} {runtimeRunning ? ( - - - + ) : null} {!runtimeRunning && replayedRun.active ? ( (storedElapsedMs); + const initialStartedAtMs = metadataRunStartedAtMs ?? contentRunStartedAtMs; + const [elapsedMs, setElapsedMs] = useState(() => { + if (storedElapsedMs !== null) return storedElapsedMs; + if (initialStartedAtMs !== null) { + return Math.max(0, Date.now() - initialStartedAtMs); + } + return null; + }); const label = useAuiState((s) => { const message = s.message; const status =