Skip to content

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

feat(conversations): add parallel agents card

Steven Enamakel36c5039adc23
diff --git a/app/src/features/conversations/aui/ParallelAgentsCard.test.tsx b/app/src/features/conversations/aui/ParallelAgentsCard.test.tsx
index de0bfef9d1..187a4b9497 100644
--- a/app/src/features/conversations/aui/ParallelAgentsCard.test.tsx
+++ b/app/src/features/conversations/aui/ParallelAgentsCard.test.tsx
@@ -4,7 +4,11 @@ import { describe, expect, it, vi } from 'vitest';
import type { ToolTimelineEntry } from '../../../store/chatRuntimeSlice';
import { ParallelAgentsCard } from './ParallelAgentsCard';
-vi.mock('../../../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (key: string) => key }) }));
+vi.mock('../../../lib/i18n/I18nContext', () => ({
+ useT: () => ({
+ t: (key: string) => (key === 'chat.subagents.ofTotal' ? '{complete} of {total}' : key),
+ }),
+}));
vi.mock('../../../providers/AssistantUiRuntimeProvider', () => ({ useAuiThreadId: () => 't1' }));
vi.mock('./SubagentActivityCard', () => ({ SubagentActivityCard: () => null }));
@@ -49,7 +53,7 @@ describe('ParallelAgentsCard', () => {
child('b', 2, 'completed'),
child('c', 3, 'failed'),
];
- renderCard('running');
+ expect(header).toHaveTextContent('2 of 3');
const header = screen.getByTestId('parallel-agents-header');
expect(header).toHaveTextContent('chat.subagents.ofTotal');
expect(header).toHaveTextContent('chat.subagents.runningCount · chat.subagents.failedCount');
@@ -60,7 +64,9 @@ describe('ParallelAgentsCard', () => {
timeline.entries = [child('a', 1, 'completed'), child('b', 2, 'incomplete')];
renderCard('complete');
const header = screen.getByTestId('parallel-agents-header');
+ expect(header).toHaveTextContent('1 of 2');
expect(header).toHaveTextContent('chat.subagents.incompleteCount');
+ expect(header).not.toHaveTextContent('chat.subagents.runningCount');
expect(header).not.toHaveTextContent('chat.subagents.failedCount');
});
diff --git a/app/src/features/conversations/aui/ParallelAgentsCard.tsx b/app/src/features/conversations/aui/ParallelAgentsCard.tsx
index 9b8f87585f..1ba9430892 100644
--- a/app/src/features/conversations/aui/ParallelAgentsCard.tsx
+++ b/app/src/features/conversations/aui/ParallelAgentsCard.tsx
@@ -83,10 +83,12 @@ export const ParallelAgentsCard: ToolCallMessagePartComponent = ({ toolCallId, s
model: '',
done: !isActiveTimelineStatus(childStatus(entry)),
}));
- const completedCount = agents.filter(agent => agent.done).length;
- const runningCount = children.length - completedCount;
- const failedCount = children.filter(entry => isFailedChild(childStatus(entry))).length;
+ const runningCount = agents.filter(agent => !agent.done).length;
const incompleteCount = children.filter(entry => isIncompleteChild(childStatus(entry))).length;
+ // An incomplete worker has settled but did not finish: it is neither running
+ // nor complete, so the completed total leaves it out.
+ const completedCount = children.length - runningCount - incompleteCount;
+ const failedCount = children.filter(entry => isFailedChild(childStatus(entry))).length;
const progress = children.map(childProgressPct);
const anyRunning = runningCount > 0;
// Every worker is back but the parent call has not settled: it is reading