Skip to content

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

fix(chat): stall banner names only this turn's tool, as the timeline does

M3gA-Minda0e14cc6737a
diff --git a/app/src/features/conversations/Conversations.tsx b/app/src/features/conversations/Conversations.tsx
index c75922f051..507ecf8db5 100644
--- a/app/src/features/conversations/Conversations.tsx
+++ b/app/src/features/conversations/Conversations.tsx
@@ -2012,11 +2012,18 @@ const Conversations = ({
? (inferenceStatusByThread[selectedThreadId]?.phase ?? 'thinking')
: null;
// The most recently issued tool still running, so a long healthy step (a
- // build, a CI watch) is named instead of reading as a stuck turn.
+ // build, a CI watch) is named instead of reading as a stuck turn. Run-ledger
+ // rows and detached sub-agents can outlive the turn that started them, so
+ // they say nothing about whether THIS turn is still working.
const selectedRunningTool =
selectedStalledPhase && selectedThreadId
? (toolTimelineByThread[selectedThreadId] ?? [])
- .filter(entry => entry.status === 'running')
+ .filter(
+ entry =>
+ entry.status === 'running' &&
+ entry.sourceToolName !== 'run_ledger' &&
+ entry.subagent?.mode !== 'async'
+ )
.sort((a, b) => b.seq - a.seq)[0]
: undefined;
const stallWarningBanner =
diff --git a/app/src/features/conversations/aui/StallWarning.test.tsx b/app/src/features/conversations/aui/StallWarning.test.tsx
index ace22a7264..d7566c6ea3 100644
--- a/app/src/features/conversations/aui/StallWarning.test.tsx
+++ b/app/src/features/conversations/aui/StallWarning.test.tsx
@@ -8,7 +8,8 @@ const COPY: Record<string, string> = {
'chat.status.quietFor': 'Quiet for {duration}.',
'chat.stallWarning.thinking': 'Still thinking.',
'chat.stallWarning.working': 'No new output for {duration}. The agent may be stuck.',
- 'chat.stallWarning.toolRunning': '{tool} for {duration}. Long steps can take a while.',
+ 'chat.stallWarning.toolRunning': '{tool}. Long steps can take a while.',
+ 'conversations.tools.useApp.active': 'Using {app}',
};
vi.mock('../../../lib/i18n/I18nContext', () => ({
@@ -33,7 +34,7 @@ describe('StallWarning', () => {
});
afterEach(() => vi.useRealTimers());
- it('names a running tool and its elapsed time in a neutral status', () => {
+ it('names a running tool and how long the turn has been quiet in a neutral status', () => {
const onStop = vi.fn();
render(
<StallWarning
@@ -46,14 +47,15 @@ describe('StallWarning', () => {
const warning = screen.getByTestId('chat-stall-warning');
expect(warning).toHaveAttribute('data-chat-stall-state', 'tool');
- expect(warning).toHaveTextContent('Running command for 2m 1s. Long steps can take a while.');
+ expect(warning).toHaveTextContent('Running command. Long steps can take a while.');
+ expect(screen.getByTestId('chat-stall-quiet')).toHaveTextContent('Quiet for 2m 1s.');
expect(warning).not.toHaveTextContent('stuck');
expect(warning.closest('[data-slot="alert"]')).toHaveAttribute('data-variant', 'default');
act(() => {
vi.advanceTimersByTime(5_000);
});
- expect(warning).toHaveTextContent('Running command for 2m 6s.');
+ expect(screen.getByTestId('chat-stall-quiet')).toHaveTextContent('Quiet for 2m 6s.');
const stop = screen.getByTestId('chat-stall-stop');
expect(stop).toHaveAttribute('data-variant', 'tertiary');
@@ -61,6 +63,26 @@ describe('StallWarning', () => {
expect(onStop).toHaveBeenCalledTimes(1);
});
+ it('names the app a delegated integrations agent is using, as the timeline does', () => {
+ render(
+ <StallWarning
+ phase="tool_use"
+ quietSince={Date.now() - 120_000}
+ runningTool={{
+ id: 'call-2',
+ name: 'subagent:integrations_agent',
+ round: 1,
+ seq: 2,
+ status: 'running',
+ sourceToolName: 'delegate_notion',
+ }}
+ onStop={vi.fn()}
+ />
+ );
+
+ expect(screen.getByTestId('chat-stall-warning')).toHaveTextContent('Using Notion.');
+ });
+
it('warns in amber when nothing is running past the window', () => {
render(<StallWarning phase="tool_use" quietSince={Date.now() - 120_000} onStop={vi.fn()} />);
diff --git a/app/src/features/conversations/aui/StallWarning.tsx b/app/src/features/conversations/aui/StallWarning.tsx
index 9b35541e6a..1b952835bf 100644
--- a/app/src/features/conversations/aui/StallWarning.tsx
+++ b/app/src/features/conversations/aui/StallWarning.tsx
@@ -14,8 +14,9 @@ import { Alert, AlertDescription } from '../../../components/ui/Alert';
import Button from '../../../components/ui/Button';
import { useT } from '../../../lib/i18n/I18nContext';
import type { ToolTimelineEntry } from '../../../store/chatRuntimeSlice';
+import { presentTimelineEntry } from '../../../utils/toolTimelineFormatting';
import { formatElapsed } from '../components/AssistantUiToolCall';
-import { describeToolCall, toolLabel } from '../tools/toolPresentation';
+import { toolLabel } from '../tools/toolPresentation';
import { useLiveElapsed } from './useLiveElapsed';
export interface StallWarningProps {
@@ -43,24 +44,11 @@ export function StallWarning({ phase, quietSince, runningTool, onStop }: StallWa
let message: string;
if (runningTool) {
- // A tool's start (or its last args delta) is the turn's last signal, so
- // the quiet time is how long the tool has been running.
- const label = toolLabel(
- {
- ...describeToolCall({
- name: runningTool.name,
- args: runningTool.argsBuffer,
- status: 'running',
- serverLabel: runningTool.displayName,
- serverDetail: runningTool.detail,
- }),
- tense: 'active',
- },
- t
- );
- message = t('chat.stallWarning.toolRunning')
- .replace('{tool}', label)
- .replace('{duration}', shown);
+ // Same label as the timeline row. The duration is shown as quiet time
+ // below, not as the tool's runtime: a parallel call or sub-agent event
+ // mid-run restarts the quiet clock while this tool keeps going.
+ const label = toolLabel({ ...presentTimelineEntry(runningTool), tense: 'active' }, t);
+ message = t('chat.stallWarning.toolRunning').replace('{tool}', label);
} else if (state === 'thinking') {
message = t('chat.stallWarning.thinking');
} else {
@@ -78,7 +66,7 @@ export function StallWarning({ phase, quietSince, runningTool, onStop }: StallWa
data-chat-stall-phase={phase}
data-chat-stall-state={state}>
{message}
- {state === 'thinking' && duration !== undefined && (
+ {state !== 'stuck' && duration !== undefined && (
<>
{' '}
<span data-testid="chat-stall-quiet" className="tabular-nums font-medium">
diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.ts
index e99b53f476..f9d5184cd8 100644
--- a/app/src/lib/i18n/ar.ts
+++ b/app/src/lib/i18n/ar.ts
@@ -1280,7 +1280,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'لا يوجد ناتج جديد منذ {duration}. قد يكون الوكيل عالقًا؛ اضغط إيقاف للإلغاء.',
'chat.stallWarning.toolRunning':
- '{tool} منذ {duration}. قد تستغرق الخطوات الطويلة مثل عمليات البناء أو مراقبة CI بعض الوقت.',
+ '{tool}. قد تستغرق الخطوات الطويلة مثل عمليات البناء أو مراقبة CI بعض الوقت.',
'chat.filter.tasks': 'المهام',
'chat.selectThread': 'اختر محادثة',
'chat.noThreads': 'لا توجد محادثات بعد',
diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.ts
index 2484ea8ede..9bf7c1fdd8 100644
--- a/app/src/lib/i18n/bn.ts
+++ b/app/src/lib/i18n/bn.ts
@@ -1301,7 +1301,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'{duration} ধরে নতুন কোনো আউটপুট নেই। এজেন্ট আটকে থাকতে পারে; বাতিল করতে থামান চাপুন।',
'chat.stallWarning.toolRunning':
- '{tool}, {duration} ধরে। বিল্ড বা CI নজরদারির মতো দীর্ঘ ধাপে কিছুটা সময় লাগতে পারে।',
+ '{tool}। বিল্ড বা CI নজরদারির মতো দীর্ঘ ধাপে কিছুটা সময় লাগতে পারে।',
'chat.filter.tasks': 'টাস্ক',
'chat.selectThread': 'একটি থ্রেড বেছে নিন',
'chat.noThreads': 'এখনো কোনো থ্রেড নেই',
diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.ts
index b7570d31de..0b89eb5788 100644
--- a/app/src/lib/i18n/de.ts
+++ b/app/src/lib/i18n/de.ts
@@ -1342,7 +1342,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'Seit {duration} keine neue Ausgabe. Der Agent hängt möglicherweise; drücke Stoppen, um abzubrechen.',
'chat.stallWarning.toolRunning':
- '{tool} seit {duration}. Lange Schritte wie Builds oder CI-Überwachung können eine Weile dauern.',
+ '{tool}. Lange Schritte wie Builds oder CI-Überwachung können eine Weile dauern.',
'chat.filter.tasks': 'Aufgaben',
'chat.selectThread': 'Wähle einen Thread aus',
'chat.noThreads': 'Noch keine Threads',
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index 5d119a5679..639dc07933 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -1498,8 +1498,7 @@ const en: TranslationMap = {
'Still thinking. No new output for 2 minutes, but the agent is still working. Press Stop if you want to cancel.',
'chat.stallWarning.working':
'No new output for {duration}. The agent may be stuck; press Stop to cancel.',
- 'chat.stallWarning.toolRunning':
- '{tool} for {duration}. Long steps like builds or CI watches can take a while.',
+ 'chat.stallWarning.toolRunning': '{tool}. Long steps like builds or CI watches can take a while.',
'chat.filter.tasks': 'Tasks',
'chat.selectThread': 'Select a thread',
'chat.noThreads': 'No threads yet',
diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.ts
index bdc7563995..1d3fc53e52 100644
--- a/app/src/lib/i18n/es.ts
+++ b/app/src/lib/i18n/es.ts
@@ -1332,7 +1332,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'Sin resultados nuevos desde hace {duration}. Puede que el agente se haya atascado; pulsa Detener para cancelar.',
'chat.stallWarning.toolRunning':
- '{tool} desde hace {duration}. Los pasos largos, como compilaciones o el seguimiento de CI, pueden tardar.',
+ '{tool}. Los pasos largos, como compilaciones o el seguimiento de CI, pueden tardar.',
'chat.filter.tasks': 'Tareas',
'chat.selectThread': 'Selecciona un hilo',
'chat.noThreads': 'Sin hilos aún',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index 434813f493..e30dd3ddda 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -1341,7 +1341,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
"Aucune nouvelle sortie depuis {duration}. L'agent est peut-être bloqué ; appuie sur Arrêter pour annuler.",
'chat.stallWarning.toolRunning':
- '{tool} depuis {duration}. Les étapes longues, comme les builds ou le suivi de la CI, peuvent prendre du temps.',
+ '{tool}. Les étapes longues, comme les builds ou le suivi de la CI, peuvent prendre du temps.',
'chat.filter.tasks': 'Tâches',
'chat.selectThread': 'Sélectionne un fil',
'chat.noThreads': "Aucun fil pour l'instant",
diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.ts
index b443874d33..da5db84307 100644
--- a/app/src/lib/i18n/hi.ts
+++ b/app/src/lib/i18n/hi.ts
@@ -1308,7 +1308,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'{duration} से कोई नया आउटपुट नहीं। एजेंट अटका हो सकता है; रद्द करने के लिए रोकें दबाएँ।',
'chat.stallWarning.toolRunning':
- '{tool}, {duration} से। बिल्ड या CI निगरानी जैसे लंबे चरणों में समय लग सकता है।',
+ '{tool}। बिल्ड या CI निगरानी जैसे लंबे चरणों में समय लग सकता है।',
'chat.filter.tasks': 'टास्क',
'chat.selectThread': 'एक थ्रेड चुनें',
'chat.noThreads': 'अभी कोई थ्रेड नहीं',
diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.ts
index d6e7fef68a..dbe563fa5b 100644
--- a/app/src/lib/i18n/id.ts
+++ b/app/src/lib/i18n/id.ts
@@ -1317,7 +1317,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'Tidak ada keluaran baru selama {duration}. Agen mungkin macet; tekan Hentikan untuk membatalkan.',
'chat.stallWarning.toolRunning':
- '{tool} selama {duration}. Langkah panjang seperti build atau pemantauan CI bisa memakan waktu.',
+ '{tool}. Langkah panjang seperti build atau pemantauan CI bisa memakan waktu.',
'chat.filter.tasks': 'Tugas',
'chat.selectThread': 'Pilih thread',
'chat.noThreads': 'Belum ada thread',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index d561ea851c..8cf033ca80 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -1329,7 +1329,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
"Nessun nuovo output da {duration}. L'agente potrebbe essersi bloccato; premi Interrompi per annullare.",
'chat.stallWarning.toolRunning':
- '{tool} da {duration}. I passaggi lunghi, come le build o il monitoraggio della CI, possono richiedere tempo.',
+ '{tool}. I passaggi lunghi, come le build o il monitoraggio della CI, possono richiedere tempo.',
'chat.filter.tasks': 'Attività',
'chat.selectThread': 'Seleziona un thread',
'chat.noThreads': 'Nessun thread',
diff --git a/app/src/lib/i18n/ja.ts b/app/src/lib/i18n/ja.ts
index 86ad17e0f4..28406f8fbe 100644
--- a/app/src/lib/i18n/ja.ts
+++ b/app/src/lib/i18n/ja.ts
@@ -1493,7 +1493,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'{duration}間、新しい出力がありません。エージェントが停止している可能性があります。キャンセルするには「停止」を押してください。',
'chat.stallWarning.toolRunning':
- '{tool}({duration}経過)。ビルドや CI の監視など、長いステップには時間がかかることがあります。',
+ '{tool}。ビルドや CI の監視など、長いステップには時間がかかることがあります。',
'chat.filter.tasks': 'タスク',
'chat.selectThread': 'スレッドを選択',
'chat.noThreads': 'スレッドがありません',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index 53f5bf092f..829894eeea 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -1289,8 +1289,7 @@ const messages: TranslationMap = {
'아직 생각 중입니다. 2분 동안 새 출력이 없지만 에이전트는 계속 작업 중입니다. 취소하려면 중지를 누르세요.',
'chat.stallWarning.working':
'{duration} 동안 새 출력이 없습니다. 에이전트가 멈췄을 수 있습니다. 취소하려면 중지를 누르세요.',
- 'chat.stallWarning.toolRunning':
- '{tool} · {duration} 경과. 빌드나 CI 감시 같은 긴 단계는 시간이 걸릴 수 있습니다.',
+ 'chat.stallWarning.toolRunning': '{tool}. 빌드나 CI 감시 같은 긴 단계는 시간이 걸릴 수 있습니다.',
'chat.filter.tasks': '작업',
'chat.selectThread': '스레드 선택',
'chat.noThreads': '아직 스레드가 없습니다',
diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.ts
index d1c49bd99a..2c5003ba1d 100644
--- a/app/src/lib/i18n/pl.ts
+++ b/app/src/lib/i18n/pl.ts
@@ -1320,7 +1320,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'Brak nowych danych od {duration}. Agent mógł utknąć; naciśnij Zatrzymaj, aby anulować.',
'chat.stallWarning.toolRunning':
- '{tool} od {duration}. Długie kroki, takie jak kompilacje czy śledzenie CI, mogą chwilę potrwać.',
+ '{tool}. Długie kroki, takie jak kompilacje czy śledzenie CI, mogą chwilę potrwać.',
'chat.filter.tasks': 'Zadania',
'chat.selectThread': 'Wybierz wątek',
'chat.noThreads': 'Brak wątków',
diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.ts
index cfa9f8dbbb..04bb5d2db1 100644
--- a/app/src/lib/i18n/pt.ts
+++ b/app/src/lib/i18n/pt.ts
@@ -1327,7 +1327,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'Nenhuma saída nova há {duration}. O agente pode estar travado; pressione Parar para cancelar.',
'chat.stallWarning.toolRunning':
- '{tool} há {duration}. Etapas longas, como builds ou o acompanhamento de CI, podem demorar.',
+ '{tool}. Etapas longas, como builds ou o acompanhamento de CI, podem demorar.',
'chat.filter.tasks': 'Tarefas',
'chat.selectThread': 'Selecione uma conversa',
'chat.noThreads': 'Nenhuma conversa ainda',
diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.ts
index 6fe58acf72..070a77efb9 100644
--- a/app/src/lib/i18n/ru.ts
+++ b/app/src/lib/i18n/ru.ts
@@ -1316,7 +1316,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
'Нового вывода нет уже {duration}. Возможно, агент завис; нажмите «Остановить», чтобы отменить.',
'chat.stallWarning.toolRunning':
- '{tool} уже {duration}. Долгие шаги, например сборка или отслеживание CI, могут занять время.',
+ '{tool}. Долгие шаги, например сборка или отслеживание CI, могут занять время.',
'chat.filter.tasks': 'Задачи',
'chat.selectThread': 'Выбери чат',
'chat.noThreads': 'Чатов пока нет',
diff --git a/app/src/lib/i18n/tr.ts b/app/src/lib/i18n/tr.ts
index 4dbffbf9a4..1628392368 100644
--- a/app/src/lib/i18n/tr.ts
+++ b/app/src/lib/i18n/tr.ts
@@ -1348,7 +1348,7 @@ const messages: TranslationMap = {
'chat.stallWarning.working':
"{duration} boyunca yeni çıktı yok. Ajan takılmış olabilir; iptal etmek için Durdur'a basın.",
'chat.stallWarning.toolRunning':
- '{tool}, {duration} süredir. Derleme veya CI izleme gibi uzun adımlar biraz zaman alabilir.',
+ '{tool}. Derleme veya CI izleme gibi uzun adımlar biraz zaman alabilir.',
'chat.filter.tasks': 'Görevler',
'chat.selectThread': 'Bir sohbet dizisi seçin',
'chat.noThreads': 'Henüz sohbet dizisi yok',
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index 399141788b..0df01fc84c 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -1220,8 +1220,7 @@ const messages: TranslationMap = {
'chat.stallWarning.thinking':
'仍在思考。已有 2 分钟没有新输出,但助手仍在工作。如需取消,请点击停止。',
'chat.stallWarning.working': '已有 {duration} 没有新输出。助手可能卡住了;点击停止即可取消。',
- 'chat.stallWarning.toolRunning':
- '{tool},已持续 {duration}。构建或 CI 监视等较长步骤可能需要一段时间。',
+ 'chat.stallWarning.toolRunning': '{tool}。构建或 CI 监视等较长步骤可能需要一段时间。',
'chat.filter.tasks': '任务',
'chat.selectThread': '选择一个对话',
'chat.noThreads': '暂无对话',
diff --git a/app/src/pages/__tests__/Conversations.render.test.tsx b/app/src/pages/__tests__/Conversations.render.test.tsx
index 7967f64753..502947b719 100644
--- a/app/src/pages/__tests__/Conversations.render.test.tsx
+++ b/app/src/pages/__tests__/Conversations.render.test.tsx
@@ -2129,6 +2129,17 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {
status: 'running',
argsBuffer: '{"command":"cargo build"}',
},
+ // A detached run from an earlier turn, hydrated from the run
+ // ledger after this turn's call: issued later, still running,
+ // but not this turn's work.
+ {
+ id: 'subagent:run-old',
+ name: 'subagent:researcher',
+ round: 0,
+ seq: 1,
+ status: 'running',
+ sourceToolName: 'run_ledger',
+ },
],
})
);
@@ -2141,7 +2152,7 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {
const warning = await screen.findByTestId('chat-stall-warning');
expect(warning).toHaveAttribute('data-chat-stall-phase', 'tool_use');
expect(warning).toHaveAttribute('data-chat-stall-state', 'tool');
- expect(warning).toHaveTextContent('Running command for');
+ expect(warning).toHaveTextContent('Running command.');
expect(warning).not.toHaveTextContent('may be stuck');
expect(store!.getState().thread.activeThreadIds[thread.id]).toBe(true);
} finally {