Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(conversations): add stall warning for assistant responses

Steven Enamakele097f2bc3bbb
diff --git a/app/src/features/conversations/aui/StallWarning.tsx b/app/src/features/conversations/aui/StallWarning.tsx
index 7effcad498..9e818fb7db 100644
--- a/app/src/features/conversations/aui/StallWarning.tsx
+++ b/app/src/features/conversations/aui/StallWarning.tsx
@@ -12,8 +12,8 @@ import { useLiveElapsed } from './useLiveElapsed';
export interface StallWarningProps {
/** `inferenceStatusByThread.phase` of the quiet turn. */
phase: string;
- /** Epoch ms of the turn's last inference signal. */
- quietSince: number;
+ /** Epoch ms of the turn's last inference signal; unknown hides the duration. */
+ quietSince: number | undefined;
onStop: () => void;
}
@@ -24,17 +24,22 @@ function formatQuiet(ms: number): string {
export function StallWarning({ phase, quietSince, onStop }: StallWarningProps) {
const { t } = useT();
- const quietMs = useLiveElapsed(quietSince, true) ?? 0;
+ const quietMs = useLiveElapsed(quietSince, true);
return (
<div className="mb-2 flex items-start justify-between gap-3" role="status">
<p
className="text-xs text-amber-700"
data-testid="chat-stall-warning"
data-chat-stall-phase={phase}>
- {t(phase === 'thinking' ? 'chat.stallWarning.thinking' : 'chat.stallWarning.working')}{' '}
- <span data-testid="chat-stall-quiet" className="tabular-nums font-medium">
- {t('chat.status.quietFor').replace('{duration}', formatQuiet(quietMs))}
- </span>
+ {t(phase === 'thinking' ? 'chat.stallWarning.thinking' : 'chat.stallWarning.working')}
+ {quietMs !== undefined && (
+ <>
+ {' '}
+ <span data-testid="chat-stall-quiet" className="tabular-nums font-medium">
+ {t('chat.status.quietFor').replace('{duration}', formatQuiet(quietMs))}
+ </span>
+ </>
+ )}
</p>
<button
type="button"
diff --git a/app/src/features/conversations/components/AssistantUiToolCall.test.tsx b/app/src/features/conversations/components/AssistantUiToolCall.test.tsx
index bb96543029..ddce98bc1d 100644
--- a/app/src/features/conversations/components/AssistantUiToolCall.test.tsx
+++ b/app/src/features/conversations/components/AssistantUiToolCall.test.tsx
@@ -1,4 +1,3 @@
-import { render, screen, within } from '@testing-library/react';
import { act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { describe, expect, it, vi } from 'vitest';