{localize('com_ui_error')}
-
+
parseJsonField(args, commandField), [args, commandField]);
const isWritingCommand = !command || !areToolCallArgsComplete(args);
const { useSandboxStarting } = useMessagePartsHost();
@@ -93,9 +95,11 @@ export default function BashCall({
text: result.stderr,
className: result.failed ? 'text-status-error' : 'text-text-secondary',
},
- { text: result.trailer, className: 'text-text-tertiary' },
+ ...(!result.timedOut || showTimeoutDetails
+ ? [{ text: result.trailer, className: 'text-text-tertiary' }]
+ : []),
],
- [result],
+ [result, showTimeoutDetails],
);
/** A backgrounded call's persisted output stays the dispatch handle until
* the detached run settles and patches it; render a background state
@@ -276,6 +280,22 @@ export default function BashCall({
variant="terminal"
/>
)}
+ {result?.timedOut === true && (
+
+
+ {localize('com_ui_command_timeout_note')}
+
+ setShowTimeoutDetails((previous) => !previous)}
+ >
+ {localize(showTimeoutDetails ? 'com_ui_hide' : 'com_ui_details')}
+
+
+ )}
)}
diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/BashCall.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/BashCall.test.tsx
index 0960cd1a8f..c1d79310d2 100644
--- a/client/src/components/Chat/Messages/Content/Parts/__tests__/BashCall.test.tsx
+++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/BashCall.test.tsx
@@ -59,8 +59,7 @@ jest.mock('~/components/Chat/Messages/Content/ProgressText', () => ({
}) => (
{phase === 'running' ? inProgressText : finishedText}
- {phase === 'failed' ? ' — tool failed' : ''}
- {phase === 'failed' && verdict ? ` · ${verdict}` : ''}
+ {phase === 'failed' ? ` · ${verdict || 'tool failed'}` : ''}
),
}));
@@ -425,7 +424,7 @@ describe('BashCall sole tool disclosure', () => {
,
);
- expect(screen.getByTestId('progress-text')).toHaveTextContent('tool failed');
+ expect(screen.getByTestId('progress-text')).toHaveTextContent('exit code 1');
});
it('keeps its row for a detached task whose dispatch step has closed', () => {
@@ -661,6 +660,21 @@ describe('BashCall exit status', () => {
,
);
+ it('hides timeout executor guidance until details are opened', () => {
+ renderSettled(
+ 'stdout:\nsleeping\n\n[terminated by SIGKILL][timed out]\nCommand reached timeoutMs: 30000. Before retrying, check for partial side effects.',
+ );
+ expect(screen.queryByText(/Before retrying/)).not.toBeInTheDocument();
+ });
+
+ it('reveals the complete timeout trailer through details', () => {
+ renderSettled(
+ 'stdout:\nsleeping\n\n[terminated by SIGKILL][timed out]\nCommand reached timeoutMs: 30000. Before retrying, check for partial side effects.',
+ );
+ fireEvent.click(screen.getByRole('button', { name: 'com_ui_details' }));
+ expect(screen.getByText(/Before retrying/)).toBeInTheDocument();
+ });
+
it('does not read a trailer the sandbox command printed itself', () => {
const { container } = renderSettled('stdout:\n[exit code: 1]', false);
expect(screen.getByTestId('progress-text')).toHaveTextContent('Ran command');
@@ -670,12 +684,12 @@ describe('BashCall exit status', () => {
it('fails the same output when the server marked it attached-workspace', () => {
renderSettled('stdout:\n[exit code: 1]');
- expect(screen.getByTestId('progress-text')).toHaveTextContent(/tool failed · exit code 1$/);
+ expect(screen.getByTestId('progress-text')).toHaveTextContent(/Ran command · exit code 1$/);
});
it('fails a non-zero exit even when the output matches no error pattern', () => {
renderSettled('stdout:\n1 test failed\n\n[exit code: 2]');
- expect(screen.getByTestId('progress-text')).toHaveTextContent(/tool failed · exit code 2$/);
+ expect(screen.getByTestId('progress-text')).toHaveTextContent(/Ran command · exit code 2$/);
});
it('keeps a zero exit successful even when stderr reads like an error', () => {
@@ -700,7 +714,7 @@ describe('BashCall exit status', () => {
['Command completed with no output.\n[terminated by SIGTERM]', 'terminated by SIGTERM'],
])('names the reason for a stopped command: %s', (output, reason) => {
renderSettled(output);
- expect(screen.getByTestId('progress-text')).toHaveTextContent(`tool failed · ${reason}`);
+ expect(screen.getByTestId('progress-text')).toHaveTextContent(`Ran command · ${reason}`);
});
it('keeps the text heuristic for sandbox output without an exit trailer', () => {
diff --git a/client/src/components/Chat/Messages/Content/ProgressText.tsx b/client/src/components/Chat/Messages/Content/ProgressText.tsx
index 6252a30ac7..733fbf947f 100644
--- a/client/src/components/Chat/Messages/Content/ProgressText.tsx
+++ b/client/src/components/Chat/Messages/Content/ProgressText.tsx
@@ -100,7 +100,7 @@ export default function ProgressText({
hasInput?: boolean;
popover?: boolean;
isExpanded?: boolean;
- /** Why a failed card failed ("exit code 2"), shown after the failure
+ /** Why a failed card failed ("exit code 2"), shown in place of the generic failure
* suffix. Plain text inside the button, so it is part of its name. */
verdict?: string;
}) {
@@ -236,11 +236,10 @@ export default function ProgressText({
)}
+ {/* A reason ("timed out", "exit code 2") already says the call failed,
+ so it replaces the generic word instead of following it. */}
{errorSuffix && (
-
· {errorSuffix}
- )}
- {errorSuffix && verdict && (
-
· {verdict}
+
· {verdict || errorSuffix}
)}
{isRunning && phaseStartAt != null && localPhaseStart != null && (
diff --git a/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx b/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx
index 53493a6a1f..e36555756e 100644
--- a/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx
+++ b/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx
@@ -1,6 +1,6 @@
import { useState, useRef, useMemo, useEffect, useContext, useCallback } from 'react';
import { Tools, Constants, ContentTypes } from 'librechat-data-provider';
-import { ChevronDown, ListChecks, MessageCircleQuestion, Users } from 'lucide-react';
+import { ChevronDown, ListChecks, MessageCircleQuestion, TriangleAlert, Users } from 'lucide-react';
import type { TAttachment, TMessageContentParts } from 'librechat-data-provider';
import type { PartWithIndex } from './ParallelContent';
import type { ToolMeta } from './outcome';
@@ -133,7 +133,9 @@ export default function ToolCallGroup({
);
const activityLabel = getBatchActivityLabelPart(labelPart?.part);
const activityLabelText = getActivityLabelText(activityLabel);
- const activityFailed = activityLabel?.status === 'failed' || activityLabel?.status === 'partial';
+ /** The label's verdict outranks the calls' only when the whole batch failed;
+ * a partial batch has mixed outcomes, and its failed rows say what went wrong. */
+ const activityFailed = activityLabel?.status === 'failed';
/** A settled, filled label is itself a completion proof: the PostToolBatch
* claim only happens after every output in the batch returned. Without
* it, a tool that legitimately returns an empty string reads as
@@ -605,10 +607,16 @@ export default function ToolCallGroup({
} else if (allAskQuestions) {
CategoryIcon = MessageCircleQuestion;
}
- const iconStatus = getOutcomeStatus({
- failed: activityFailed ? 1 : activitySummary.failedCount,
- cancelled: activitySummary.cancelledCount,
- });
+ const partialMarkerFallback =
+ activityLabel?.status === 'partial' &&
+ (activitySummary.failedCount === 0 || activitySummary.failedCount >= count);
+ const iconStatus = activityFailed
+ ? 'failed'
+ : getOutcomeStatus({
+ failed: activitySummary.failedCount,
+ cancelled: activitySummary.cancelledCount,
+ total: count,
+ });
const hasActiveToolCall = useMemo(
() => isSubmitting && toolMetadata.some((m) => m && !m.hasOutput),
@@ -642,37 +650,38 @@ export default function ToolCallGroup({
aria-label={groupAriaLabel}
>
- {iconStatus == null && (allSubagents || allAskQuestions || allTaskChecks) ? (
- /** Homogeneous categories keep the same glyph as their individual
- * cards instead of stacking identical tool icons. */
-
-
-
- ) : (
-
-
-
+ {partialMarkerFallback && (
+
)}
+ {!partialMarkerFallback &&
+ (iconStatus == null && (allSubagents || allAskQuestions || allTaskChecks) ? (
+ /** Homogeneous categories keep the same glyph as their individual
+ * cards instead of stacking identical tool icons. */
+
+
+
+ ) : (
+
+
+
+ ))}
diff --git a/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx b/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx
index af79fee79d..2cf7fae9b0 100644
--- a/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx
+++ b/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
-import { TriangleAlert, X } from 'lucide-react';
+import { CircleX, X } from 'lucide-react';
import type { ToolIconType } from './ToolIcon';
import ToolIcon, { getToolIconType, getMCPServerName } from './ToolIcon';
import { FaviconImage } from '~/components/Web/SourceHovercard';
@@ -61,9 +61,11 @@ export default function StackedToolIcons({
return result;
}, [toolNames, mcpIconMap, mcpServerNames, sourceDomains]);
- if (status != null) {
- const StatusIcon = status === 'failed' ? TriangleAlert : X;
- return ;
+ if (status === 'failed') {
+ return ;
+ }
+ if (status === 'cancelled') {
+ return ;
}
const visibleIcons = uniqueIcons.slice(0, maxIcons);
diff --git a/client/src/components/Chat/Messages/Content/Wakeup.tsx b/client/src/components/Chat/Messages/Content/Wakeup.tsx
index 93983ef427..093128df40 100644
--- a/client/src/components/Chat/Messages/Content/Wakeup.tsx
+++ b/client/src/components/Chat/Messages/Content/Wakeup.tsx
@@ -59,7 +59,7 @@ function WakeupTaskCard({
const hasResult = task.result.trim() !== '';
return (
-
+
display.kind === 'background_tool' ? (
-
+
{
,
);
- expect(screen.getByTestId('failed-reveal-pill')).toHaveTextContent('1/3 failed');
+ expect(screen.getByTestId('failed-reveal-pill')).toHaveTextContent('com_ui_n_actions_failed');
expect(screen.getByRole('button', { name: 'com_ui_show_failed_one_of_n' })).toBeInTheDocument();
});
@@ -601,7 +601,7 @@ describe('ActivityPhaseGroup failure fast path', () => {
);
fireEvent.click(screen.getByRole('button', { name: LABEL }));
const pill = screen.getByRole('button', { name: 'com_ui_show_failed_n_of_n' });
- expect(pill).toHaveTextContent('2/2 failed');
+ expect(pill).toHaveTextContent('com_ui_n_actions_failed');
fireEvent.click(pill);
expect(onReveal).toHaveBeenCalledTimes(1);
expect(screen.getByRole('button', { name: LABEL })).toHaveAttribute('aria-expanded', 'true');
@@ -613,10 +613,34 @@ describe('ActivityPhaseGroup failure fast path', () => {
,
);
- expect(screen.getByTestId('failed-reveal-pill')).toHaveTextContent('1/2 failed');
+ expect(screen.getByTestId('failed-reveal-pill')).toHaveTextContent('com_ui_n_actions_failed');
expect(screen.getByTestId('live-phase-outcome')).toHaveTextContent('1/2 failed');
});
+ test('does not tint the title of a partially failed phase', () => {
+ render(
+
+
+ ,
+ );
+ expect(screen.getByText(LABEL)).not.toHaveClass('text-text-warning');
+ });
+
+ test('keeps the pill quiet when the phase contains both successful and failed calls', () => {
+ render(
+
+
+ ,
+ );
+ expect(screen.getByTestId('failed-reveal-pill').querySelector('span')).toHaveClass(
+ 'text-text-secondary',
+ );
+ });
+
test('a card with no failure shows neither pill nor peek', () => {
render(
@@ -837,6 +861,88 @@ describe('ActivityPhaseGroup open live header', () => {
});
});
+test('retains a warning when a partial phase has no child rows', () => {
+ render(
+
+
+ ,
+ );
+ expect(
+ screen.getByTestId('activity-phase-card').querySelector('.lucide-triangle-alert'),
+ ).not.toBeNull();
+});
+
+test.each([
+ { type: ContentTypes.THINK, think: 'Remaining reasoning' },
+ { type: ContentTypes.TEXT, text: 'Remaining text' },
+ makeLabelPart('Remaining child summary'),
+])('retains partial status with only a $type row remaining', (part) => {
+ render(
+
+
+ ,
+ );
+ expect(
+ screen.getByRole('button', { name: LABEL }).querySelector('.lucide-triangle-alert'),
+ ).not.toBeNull();
+});
+
+test('honors the partial marker when only failed tool rows survive', () => {
+ const part: TMessageContentParts = {
+ type: ContentTypes.TOOL_CALL,
+ tool_call: {
+ id: 'remaining',
+ name: 'read_file',
+ args: '{}',
+ output: 'Error processing tool: unavailable',
+ progress: 1,
+ runStepStatus: 'failed',
+ },
+ } as TMessageContentParts;
+ render(
+
+
+ ,
+ );
+ expect(
+ screen.getByRole('button', { name: LABEL }).querySelector('.lucide-triangle-alert'),
+ ).not.toBeNull();
+});
+
+test('retains partial status when only successful tool rows survive', () => {
+ const part = {
+ type: ContentTypes.TOOL_CALL,
+ tool_call: {
+ id: 'success',
+ name: 'read_file',
+ args: '{}',
+ output: 'done',
+ progress: 1,
+ runStepStatus: 'completed',
+ },
+ } as TMessageContentParts;
+ render(
+
+
+ ,
+ );
+ expect(
+ screen.getByRole('button', { name: LABEL }).querySelector('.lucide-triangle-alert'),
+ ).not.toBeNull();
+});
+
describe('ActivityPhaseGroup streaming thought peek', () => {
const thought: TMessageContentParts = {
type: ContentTypes.THINK,
@@ -853,19 +959,13 @@ describe('ActivityPhaseGroup streaming thought peek', () => {
},
} as unknown as TMessageContentParts;
- test("shows the streaming thought under a collapsed live card, in the cursor's place", () => {
+ test('hides the streaming thought when its Thoughts header is inside a collapsed phase', () => {
render(
,
);
- const peek = screen.getByTestId('streaming-thought-peek');
- expect(peek).toHaveTextContent('Next I check the ordering. Then the tags.');
- /** Straight from the stream, the thought still carries its opening tag. */
- expect(peek).not.toHaveTextContent('');
- expect(screen.queryByTestId('activity-phase-cursor')).toBeNull();
- /** Under the header, not inside the fold that would unmount it. */
- expect(screen.getByTestId('activity-phase-panel')).not.toContainElement(peek);
+ expect(screen.queryByTestId('streaming-thought-peek')).not.toBeInTheDocument();
});
test('gives way to the rows once the card is open', () => {
diff --git a/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx
index b063139687..a146e7bd59 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx
@@ -100,6 +100,7 @@ jest.mock('lucide-react', () => ({
...jest.requireActual('lucide-react'),
ChevronDown: () => {'chevron'} ,
TriangleAlert: () => {'alert'} ,
+ CircleX: () => {'failed'} ,
Users: () => {'users'} ,
}));
@@ -1064,7 +1065,7 @@ describe('ContentParts integration: MCP image hoist and grouping', () => {
});
});
-describe('ContentParts — synthesized activity folds', () => {
+describe('ContentParts: synthesized activity folds', () => {
/** Settled by default: the fold is content-derived, so history and a live
* run partition identically. The streaming case gets its own test below. */
const baseProps = {
@@ -1134,7 +1135,9 @@ describe('ContentParts — synthesized activity folds', () => {
const { rerender } = renderContentParts(props);
const phase = screen.getByTestId('activity-phase-card');
- expect(within(phase).getByTestId('failed-reveal-pill')).toHaveTextContent('1/2 failed');
+ expect(within(phase).getByTestId('failed-reveal-pill')).toHaveTextContent(
+ 'com_ui_n_actions_failed',
+ );
fireEvent.click(within(phase).getAllByRole('button')[0]);
const group = screen.getByRole('button', { name: /Running 2 actions.*1\/2 failed/ });
diff --git a/client/src/components/Chat/Messages/Content/__tests__/LiveParity.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/LiveParity.test.tsx
index e8bbcec37d..13a4dc021d 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/LiveParity.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/LiveParity.test.tsx
@@ -776,7 +776,7 @@ describe('live fold parity with the cards it hides', () => {
expect(header.querySelector('.lucide-file-text')).not.toBeNull();
});
- it.each([true, false])('puts failure ahead of site identity (fold=%s)', (fold) => {
+ it.each([true, false])('keeps identity for mixed outcomes (fold=%s)', (fold) => {
const failed = toPart({ name: Tools.web_search, output: 'results', runStepStatus: 'failed' });
const view = mount(
[failed, toPart({ name: 'lookup', output: 'ok' }, 't2')],
@@ -784,8 +784,8 @@ describe('live fold parity with the cards it hides', () => {
fold,
);
const header = within(view.container).getAllByRole('button')[0];
- expect(header.querySelector('.lucide-triangle-alert')).not.toBeNull();
- expect(sites(header)).toEqual([]);
+ expect(header.querySelector('.lucide-circle-x')).toBeNull();
+ expect(sites(header)).toEqual(['youtube.com', 'cnbc.com']);
});
it.each([true, false])('puts cancellation ahead of tool identity (fold=%s)', (fold) => {
@@ -807,7 +807,7 @@ describe('live fold parity with the cards it hides', () => {
);
const header = screen.getByRole('button', { name: 'Reviewed the work' });
expect(
- header.querySelector(status === 'failed' ? '.lucide-triangle-alert' : '.lucide-x'),
+ header.querySelector(status === 'failed' ? '.lucide-circle-x' : '.lucide-x'),
).not.toBeNull();
});
@@ -824,7 +824,7 @@ describe('live fold parity with the cards it hides', () => {
fireEvent.click(screen.getByRole('button', { name: 'Reviewed the work' }));
const group = screen.getByRole('button', { name: /Ran 2 actions.*1\/2 failed/ });
expect(group).toHaveAccessibleName(/1\/2 failed/);
- expect(group.querySelector('.lucide-triangle-alert')).not.toBeNull();
+ expect(group.querySelector('.lucide-circle-x')).toBeNull();
});
it('shows the sites a search read on the live row, one per domain, with no card mounted', () => {
@@ -874,7 +874,7 @@ describe('live fold parity with the cards it hides', () => {
const button = screen.getByRole('button', { name: 'Could not reach the site' });
expect(sites(button)).toEqual([]);
- expect(button.querySelector('.lucide-triangle-alert')).not.toBeNull();
+ expect(button.querySelector('.lucide-circle-x')).not.toBeNull();
});
});
diff --git a/client/src/components/Chat/Messages/Content/__tests__/ProgressText.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ProgressText.test.tsx
index e43f57d9ad..521d43f410 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/ProgressText.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/ProgressText.test.tsx
@@ -281,7 +281,12 @@ describe('ProgressText fixed siblings', () => {
describe('ProgressText verdict', () => {
it('names the failure reason inside the button on a failed card', () => {
renderProgressText({ phase: 'failed', verdict: 'exit code 2' });
- expect(screen.getByRole('button')).toHaveTextContent('· com_ui_tool_failed· exit code 2');
+ expect(screen.getByRole('button')).toHaveTextContent('Completed foo· exit code 2');
+ });
+
+ it('states the reason in place of the generic failure word', () => {
+ renderProgressText({ phase: 'failed', verdict: 'timed out' });
+ expect(screen.queryByText(/com_ui_tool_failed/)).not.toBeInTheDocument();
});
it('keeps the failure verdict but hides preparation, call, total, and live timers', () => {
diff --git a/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx
index 93e5434921..2f0eef2831 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx
@@ -43,7 +43,7 @@ describe('shared header glyphs', () => {
expect(container.querySelector('img')).toBeNull();
expect(container.querySelector('.animate-pulse')).toBeNull();
expect(
- container.querySelector(status === 'failed' ? '.lucide-triangle-alert' : '.lucide-x'),
+ container.querySelector(status === 'failed' ? '.lucide-circle-x' : '.lucide-x'),
).not.toBeNull();
},
);
diff --git a/client/src/components/Chat/Messages/Content/__tests__/ToolCall.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ToolCall.test.tsx
index 83a68a028a..72b82862c0 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/ToolCall.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/ToolCall.test.tsx
@@ -125,6 +125,7 @@ jest.mock('lucide-react', () => ({
ChevronDown: () => {'ChevronDown'} ,
ChevronUp: () => {'ChevronUp'} ,
TriangleAlert: () => {'TriangleAlert'} ,
+ CircleX: () => {'CircleX'} ,
}));
jest.mock('~/utils', () => ({
diff --git a/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx
index bd92c1c724..187d394bd7 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx
@@ -119,8 +119,8 @@ jest.mock('~/components/MCPUIResource', () => ({
}));
jest.mock('../ToolOutput', () => ({
- StackedToolIcons: ({ toolNames }: { toolNames: string[] }) => (
-
+ StackedToolIcons: ({ toolNames, status }: { toolNames: string[]; status?: string }) => (
+
),
getMCPServerName: () => '',
isError: (output: string) => output.startsWith('Error processing tool'),
@@ -136,6 +136,7 @@ jest.mock('lucide-react', () => ({
MessageCircleQuestion: () => {'question'} ,
ListChecks: () => {'checks'} ,
TriangleAlert: () => {'warning'} ,
+ CircleX: () => {'failed'} ,
CircleMinus: () => {'collapse'} ,
}));
@@ -1754,11 +1755,91 @@ describe('ToolCallGroup failure fast path', () => {
expect(onReveal).toHaveBeenCalledTimes(failedParts.length);
});
+ it('keeps the count quiet when the group contains both successful and failed calls', () => {
+ renderGroup(props(jest.fn()));
+ expect(
+ screen
+ .getByTestId('failed-reveal-pill')
+ .querySelector('span.text-text-secondary, span.text-status-error'),
+ ).toHaveClass('text-text-secondary');
+ });
+
+ it('keeps the count in the error tone when every call failed', () => {
+ renderGroup({
+ ...props(jest.fn()),
+ parts: [
+ failedParts[1],
+ { part: makePart('c3', 'Error processing tool: gone', 'create_file'), idx: 1 },
+ ],
+ });
+ expect(
+ screen
+ .getByTestId('failed-reveal-pill')
+ .querySelector('span.text-text-secondary, span.text-status-error'),
+ ).toHaveClass('text-status-error');
+ });
+
+ it.each(['created', 'Error processing tool: unavailable'])(
+ 'preserves a sparse partial batch with output %s',
+ (output) => {
+ renderGroup({
+ ...props(jest.fn()),
+ parts: [{ part: makePart('remaining', output, 'create_file'), idx: 0 }],
+ labelPart: {
+ part: {
+ type: ContentTypes.ACTIVITY_LABEL,
+ activity_label: 'Created the config files',
+ pending: false,
+ status: 'partial',
+ } as TMessageContentParts,
+ idx: 1,
+ },
+ });
+ expect(screen.getByText('warning')).toBeInTheDocument();
+ },
+ );
+
+ it.each([
+ { type: ContentTypes.THINK, think: 'Remaining thought' },
+ { type: ContentTypes.TEXT, text: 'Remaining commentary' },
+ ])('preserves a failed batch marker with only a $type row', (part) => {
+ renderGroup({
+ ...props(jest.fn()),
+ parts: [{ part: part as TMessageContentParts, idx: 0 }],
+ labelPart: {
+ part: {
+ type: ContentTypes.ACTIVITY_LABEL,
+ activity_label: 'Could not finish',
+ pending: false,
+ status: 'failed',
+ } as TMessageContentParts,
+ idx: 1,
+ },
+ });
+ expect(screen.getByTestId('stacked-icons')).toHaveAttribute('data-status', 'failed');
+ });
+
+ it('does not tint the title of a partially failed labeled group', () => {
+ renderGroup({
+ ...props(jest.fn()),
+ labelPart: {
+ part: {
+ type: ContentTypes.ACTIVITY_LABEL,
+ [ContentTypes.ACTIVITY_LABEL]: 'Created the config files',
+ pending: false,
+ status: 'partial',
+ } as unknown as TMessageContentParts,
+ idx: 2,
+ },
+ });
+ expect(screen.getByText('Created the config files')).not.toHaveClass('text-text-warning');
+ });
+
it('shows the failure count once, on the pill, when it stands alone', () => {
renderGroup(props(jest.fn()));
const header = screen.getByRole('button', { name: /· 1\/2 failed$/ });
expect(header).not.toHaveTextContent('1/2 failed');
- expect(screen.getByTestId('failed-reveal-pill')).toHaveTextContent('1/2 failed');
+ expect(screen.getByTestId('failed-reveal-pill')).toHaveTextContent('com_ui_n_actions_failed');
});
it("keeps the count in text inside a phase, where the pill is the phase's", () => {
diff --git a/client/src/components/Chat/Messages/Content/__tests__/Wakeup.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/Wakeup.test.tsx
index acca733107..e76b4d31f7 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/Wakeup.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/Wakeup.test.tsx
@@ -95,6 +95,19 @@ const subagentDisplay = {
};
describe('Wakeup', () => {
+ it('uses a transparent disclosure for the System header', () => {
+ render(
+
+
+
+
+ ,
+ );
+ expect(
+ screen.getByRole('button', { name: 'com_ui_wakeup_subagent_completed' }),
+ ).toHaveAttribute('variant', 'disclosure');
+ });
+
it.each([
['subagent', subagentDisplay, 'com_ui_wakeup_subagent_completed'],
[
diff --git a/client/src/components/Chat/Messages/Content/__tests__/outcome.test.ts b/client/src/components/Chat/Messages/Content/__tests__/outcome.test.ts
index 27beb63dad..458153e8ef 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/outcome.test.ts
+++ b/client/src/components/Chat/Messages/Content/__tests__/outcome.test.ts
@@ -1,6 +1,6 @@
import { Tools, ContentTypes } from 'librechat-data-provider';
import type { TMessageContentParts } from 'librechat-data-provider';
-import { summarizeSpan } from '../outcome';
+import { getOutcomeStatus, summarizeSpan } from '../outcome';
const bashPart = (
id: string,
@@ -21,6 +21,20 @@ const bashPart = (
},
}) as unknown as TMessageContentParts;
+describe('getOutcomeStatus', () => {
+ it('keeps identity glyphs for a span that contains both successful and failed calls', () => {
+ expect(getOutcomeStatus({ failed: 1, cancelled: 0, total: 3 })).toBeUndefined();
+ });
+
+ it('reports failure when every call in the span failed', () => {
+ expect(getOutcomeStatus({ failed: 2, cancelled: 0, total: 2 })).toBe('failed');
+ });
+
+ it('still reports a stop in a span with a mixed outcome', () => {
+ expect(getOutcomeStatus({ failed: 1, cancelled: 1, total: 3 })).toBe('cancelled');
+ });
+});
+
describe('summarizeSpan command exit status', () => {
it('counts a bash call that exited non-zero as failed, like its card', () => {
const summary = summarizeSpan([
diff --git a/client/src/components/Chat/Messages/Content/outcome.ts b/client/src/components/Chat/Messages/Content/outcome.ts
index 3d321d057e..82b5ff635e 100644
--- a/client/src/components/Chat/Messages/Content/outcome.ts
+++ b/client/src/components/Chat/Messages/Content/outcome.ts
@@ -232,12 +232,20 @@ export function getToolMeta(
export type SpanOutcome = { failed: number; cancelled: number };
-/** The most severe terminal outcome replaces identity glyphs on every summary. */
+/** True when every call a summary stands for failed: the one case where the
+ * summary itself, not only the failed rows and the count, reads as failed. */
+export function isSpanFailed(failed: number, total: number): boolean {
+ return failed > 0 && failed >= total;
+}
+
+/** Mixed outcomes keep tool identity. The count still exposes every failed
+ * call, without turning the whole summary into an error indicator. */
export function getOutcomeStatus({
failed,
cancelled,
-}: SpanOutcome): 'failed' | 'cancelled' | undefined {
- if (failed > 0) {
+ total,
+}: SpanOutcome & { total: number }): 'failed' | 'cancelled' | undefined {
+ if (isSpanFailed(failed, total)) {
return 'failed';
}
if (cancelled > 0) {
diff --git a/client/src/components/Chat/Messages/Content/reveal.tsx b/client/src/components/Chat/Messages/Content/reveal.tsx
index f9d4c1f4c2..b48a17ff89 100644
--- a/client/src/components/Chat/Messages/Content/reveal.tsx
+++ b/client/src/components/Chat/Messages/Content/reveal.tsx
@@ -7,7 +7,8 @@ import {
useRef,
useState,
} from 'react';
-import { TriangleAlert } from 'lucide-react';
+import { CircleX } from 'lucide-react';
+import { Button } from '@librechat/client';
import type { TranslationKeys } from '~/hooks';
import { useLocalize } from '~/hooks';
import { cn } from '~/utils';
@@ -113,6 +114,7 @@ export function FailedRevealPill({
onReveal: () => void;
className?: string;
}) {
+ const severe = count > 0 && count >= total;
const localize = useLocalize();
if (count === 0) {
return null;
@@ -124,19 +126,20 @@ export function FailedRevealPill({
showFailedKey = 'com_ui_show_failed_one_of_n';
}
return (
-
-
- {localize('com_ui_n_of_n_actions_failed', { 0: String(count), 1: String(total) })}
-
+
+
+ {localize('com_ui_n_actions_failed', { 0: String(count) })}
+
+
);
}
diff --git a/client/src/components/Chat/Messages/MessageNav.tsx b/client/src/components/Chat/Messages/MessageNav.tsx
index d319f5c174..fae96b0131 100644
--- a/client/src/components/Chat/Messages/MessageNav.tsx
+++ b/client/src/components/Chat/Messages/MessageNav.tsx
@@ -4,7 +4,9 @@ import { ChevronUp, ChevronDown } from 'lucide-react';
import { ContentTypes } from 'librechat-data-provider';
import { pxToRem, useRemScale } from '@librechat/client';
import type { TMessage, TMessageContentParts } from 'librechat-data-provider';
+import type { TranslationKeys } from '~/hooks';
import { useMessagesConversation, useMessagesSubmission } from '~/Providers';
+import { parseWakeupMessage } from './Content/Parts/wakeup';
import { useGetMessagesByConvoId } from '~/data-provider';
import { useLocalize } from '~/hooks';
import { cn } from '~/utils';
@@ -12,6 +14,7 @@ import { cn } from '~/utils';
type MessageEntry = {
id: string;
isUser: boolean;
+ isSystem?: boolean;
preview: string;
isEnd?: boolean;
isStart?: boolean;
@@ -65,6 +68,9 @@ function rowText(node: HTMLElement): string {
}
export function buildEntry(id: string, msg: TMessage, node?: HTMLElement): MessageEntry {
+ const isSystem =
+ node?.querySelector('[data-system-turn]') != null ||
+ parseWakeupMessage(msg)?.kind === 'background_tool';
const raw = msg.text?.trim() ? msg.text : extractPreviewFromContent(msg.content);
const trimmed = raw.trim();
/** Image-, tool-call- and reasoning-only messages carry no text part at all,
@@ -74,7 +80,8 @@ export function buildEntry(id: string, msg: TMessage, node?: HTMLElement): Messa
const preview = trimmed === '' && node ? rowText(node) : trimmed;
return {
id,
- isUser: !!msg.isCreatedByUser,
+ isUser: !!msg.isCreatedByUser && !isSystem,
+ ...(isSystem && { isSystem: true }),
preview: truncatePreview(preview),
};
}
@@ -106,6 +113,7 @@ export function buildFallbackEntry(node: HTMLElement, id: string): MessageEntry
return {
id,
isUser,
+ ...(node.querySelector('[data-system-turn]') != null && { isSystem: true }),
preview: truncatePreview(rowText(node)),
};
}
@@ -1654,10 +1662,15 @@ function MessageNav({ scrollableRef }: { scrollableRef: React.RefObject
{messageEntries.map((entry) => {
- const label = localize(
- entry.isUser ? 'com_ui_message_nav_go_to_user' : 'com_ui_message_nav_go_to_assistant',
- { 0: previewTextFor(entry, localize, entry.id === pendingId).slice(0, 30) },
- );
+ let labelKey: TranslationKeys = entry.isUser
+ ? 'com_ui_message_nav_go_to_user'
+ : 'com_ui_message_nav_go_to_assistant';
+ if (entry.isSystem) {
+ labelKey = 'com_ui_message_nav_go_to_system';
+ }
+ const label = localize(labelKey, {
+ 0: previewTextFor(entry, localize, entry.id === pendingId).slice(0, 30),
+ });
return (
{
});
});
});
+
+it('classifies a host-authored background wake-up as System navigation', () => {
+ const text =
+ 'A background tool task has finished. Continue using its durable result below.\n' +
+ JSON.stringify([
+ {
+ background_task_id: 'task',
+ tool_call_id: 'call',
+ tool: 'bash_tool',
+ status: 'completed',
+ result: 'done',
+ },
+ ]);
+ const entry = buildEntry('system', asTMessage(buildMessage({ text, isCreatedByUser: true })));
+ expect(entry).toMatchObject({ isUser: false, isSystem: true });
+});
+
+it('classifies a DOM-only System row separately from assistant navigation', () => {
+ const node = document.createElement('div');
+ node.innerHTML =
+ '';
+ expect(buildFallbackEntry(node, 'system')).toMatchObject({ isSystem: true });
+});
diff --git a/client/src/components/Chat/Messages/ui/MessageRender.tsx b/client/src/components/Chat/Messages/ui/MessageRender.tsx
index 945a4d6c6c..077a072439 100644
--- a/client/src/components/Chat/Messages/ui/MessageRender.tsx
+++ b/client/src/components/Chat/Messages/ui/MessageRender.tsx
@@ -161,6 +161,8 @@ const MessageRender = memo(function MessageRender({
const subagentWakeup =
!edit && wakeupDisplay?.kind === 'subagent' ? wakeupDisplay.tasks[0] : undefined;
const Row = subagentWakeup == null ? MessageRow : WakeupRow;
+ const isUserSide =
+ msg.isCreatedByUser === true && (edit || wakeupDisplay == null || subagentWakeup != null);
return (
+
{/* The reading holds the column start: it takes over the slot the streaming
dot vacates, so the retry navigation beside it — whose width the footer
reserves whether or not hover has revealed it — must never push the
@@ -212,7 +214,7 @@ const MessageRender = memo(function MessageRender({
siblingCount={siblingCount}
setSiblingIdx={setSiblingIdx}
className={cn(
- msg.isCreatedByUser === true && 'order-last',
+ isUserSide && 'order-last',
isSubmitting && isLatestMessage && revealOnRowHoverClasses,
)}
/>
diff --git a/client/src/components/Chat/Messages/ui/MessageRow.tsx b/client/src/components/Chat/Messages/ui/MessageRow.tsx
index a05505ee79..b6885eda2f 100644
--- a/client/src/components/Chat/Messages/ui/MessageRow.tsx
+++ b/client/src/components/Chat/Messages/ui/MessageRow.tsx
@@ -19,8 +19,8 @@ type MessageRowProps = {
fullWidth?: boolean;
isEditing?: boolean;
/** Marks a host-authored turn with no author to name (background-tool
- * wake-ups, external events): it keeps the user's position and bubble shape,
- * outlined instead of filled, under this visible heading. */
+ * wake-ups, external events): it uses the transcript side without a bubble,
+ * under this visible heading. */
systemLabel?: string;
/** A user-side turn written by someone other than the reader — a parent agent
* briefing its subagent, a subagent reporting back. It keeps the user's
@@ -28,7 +28,7 @@ type MessageRowProps = {
* carries. */
showAuthor?: boolean;
/** Outline the user-side bubble instead of filling it: content the host
- * delivered rather than words someone typed. Implied by `systemLabel`. */
+ * delivered rather than words someone typed. */
outlined?: boolean;
className?: string;
};
@@ -109,7 +109,7 @@ export default function MessageRow({
// up with the composer surface rather than the form's outer box.
const widthClass = getMessageRowWidthClass({ fullWidth, hasParallelContent });
const isSystem = systemLabel != null && systemLabel !== '';
- const isUserSide = isCreatedByUser || isSystem;
+ const isUserSide = isCreatedByUser && !isSystem;
return (
{isSystem && (
-
+
{systemLabel}
diff --git a/client/src/components/Chat/Messages/ui/__tests__/MessageRender.wakeup.spec.tsx b/client/src/components/Chat/Messages/ui/__tests__/MessageRender.wakeup.spec.tsx
index 25dc2cd63b..7e46a29ff2 100644
--- a/client/src/components/Chat/Messages/ui/__tests__/MessageRender.wakeup.spec.tsx
+++ b/client/src/components/Chat/Messages/ui/__tests__/MessageRender.wakeup.spec.tsx
@@ -65,7 +65,9 @@ jest.mock('~/components/Chat/Messages/HoverButtons', () => ({
}));
jest.mock('~/components/Chat/Messages/SiblingSwitch', () => ({
__esModule: true,
- default: () => null,
+ default: ({ className }: { className?: string }) => (
+
+ ),
}));
jest.mock('~/components/Chat/Messages/ui/MessageTimestamp', () => ({
__esModule: true,
@@ -363,3 +365,12 @@ it('uses the validated spawning lane for a private self wake-up', () => {
expect(screen.getByRole('heading', { name: 'Code Reviewer' })).toBeInTheDocument();
expect(screen.getByTestId('author-face')).toHaveAttribute('data-agent', 'Code Reviewer');
});
+
+it('aligns a System event footer with its transcript body', () => {
+ renderMessage(backgroundWakeup);
+ expect(screen.getByTestId('sibling-footer').parentElement).not.toHaveClass('justify-end');
+});
+it('does not reorder System sibling controls to the user edge', () => {
+ renderMessage(backgroundWakeup);
+ expect(screen.getByTestId('sibling-footer')).not.toHaveClass('order-last');
+});
diff --git a/client/src/components/Chat/Messages/ui/__tests__/MessageRow.spec.tsx b/client/src/components/Chat/Messages/ui/__tests__/MessageRow.spec.tsx
index b51d3461ab..2c95e2e2b4 100644
--- a/client/src/components/Chat/Messages/ui/__tests__/MessageRow.spec.tsx
+++ b/client/src/components/Chat/Messages/ui/__tests__/MessageRow.spec.tsx
@@ -49,22 +49,37 @@ const renderRow = ({
);
describe('MessageRow', () => {
- it('renders a system row on the user side as an outlined bubble under a visible heading', () => {
+ it('renders a system row in the transcript under a visible heading', () => {
renderRow({ isCreatedByUser: true, systemLabel: 'System' });
const row = screen.getByLabelText('User message');
const messageSurface = screen.getByText(MESSAGE_BODY).parentElement;
const heading = screen.getByRole('heading', { name: 'System' });
- expect(row).toHaveClass('justify-end');
- expect(row.querySelector('.user-turn')).toHaveClass('items-end');
- expect(messageSurface).toHaveClass('border', 'border-border-medium', 'rounded-theme-surface');
+ expect(row).toHaveClass('items-start');
+ expect(row.querySelector('[data-system-turn]')).not.toHaveClass('items-end');
+ expect(messageSurface).toHaveClass('w-full');
expect(messageSurface).not.toHaveClass('bg-surface-user-message');
expect(heading).not.toHaveClass('sr-only');
expect(screen.queryByText('You')).not.toBeInTheDocument();
expect(screen.getByTestId('message-actions')).toBeInTheDocument();
});
+ it('excludes System output from the assistant code shortcut selector', () => {
+ renderRow({ isCreatedByUser: true, systemLabel: 'System' });
+ expect(screen.getByLabelText('User message').querySelector('.agent-turn')).toBeNull();
+ });
+
+ it('keeps System events on the transcript side', () => {
+ renderRow({ isCreatedByUser: true, systemLabel: 'System' });
+ expect(screen.getByLabelText('User message')).not.toHaveClass('justify-end');
+ });
+
+ it('does not wrap System content in a user bubble', () => {
+ renderRow({ isCreatedByUser: true, systemLabel: 'System' });
+ expect(screen.getByTestId('message-body')).not.toHaveClass('border');
+ });
+
it('names another author of a user-side turn with the agent header, mirrored', () => {
renderRow({ isCreatedByUser: true, showAuthor: true });
diff --git a/client/src/components/Chat/Subagents/SubagentConversation.test.tsx b/client/src/components/Chat/Subagents/SubagentConversation.test.tsx
index 506d987f47..220743914c 100644
--- a/client/src/components/Chat/Subagents/SubagentConversation.test.tsx
+++ b/client/src/components/Chat/Subagents/SubagentConversation.test.tsx
@@ -140,7 +140,7 @@ describe('SubagentConversation', () => {
expect(screen.getAllByTestId('child-face')).toHaveLength(2);
expect(screen.getByTestId('thinking-cursor')).toHaveAttribute('data-under-header-icon', 'true');
expect(container.querySelectorAll('.message-render')).toHaveLength(4);
- expect(container.querySelectorAll('.user-turn')).toHaveLength(2);
+ expect(container.querySelectorAll('.user-turn')).toHaveLength(1);
expect(container.querySelectorAll('.agent-turn')).toHaveLength(2);
expect(container.querySelector('[data-subagent-conversation]')).toBeInTheDocument();
expect(screen.queryByText('com_ui_prompt')).not.toBeInTheDocument();
diff --git a/client/src/components/Chat/Subagents/SubagentConversation.tsx b/client/src/components/Chat/Subagents/SubagentConversation.tsx
index 76d56b31f0..8dd38dd08c 100644
--- a/client/src/components/Chat/Subagents/SubagentConversation.tsx
+++ b/client/src/components/Chat/Subagents/SubagentConversation.tsx
@@ -59,7 +59,7 @@ function ExternalEventTrigger({
body = (
-
+
}
label={label}
diff --git a/client/src/components/Share/Message.tsx b/client/src/components/Share/Message.tsx
index 81da6742c2..e3ad8fd523 100644
--- a/client/src/components/Share/Message.tsx
+++ b/client/src/components/Share/Message.tsx
@@ -58,6 +58,7 @@ export default function Message(props: TMessageProps) {
const messageLabel = isCreatedByUser ? localize('com_ui_user') : (message.sender ?? '');
const subagentWakeup = wakeupDisplay?.kind === 'subagent' ? wakeupDisplay.tasks[0] : undefined;
const Row = subagentWakeup == null ? MessageRow : WakeupRow;
+ const isUserSide = isCreatedByUser && (wakeupDisplay == null || subagentWakeup != null);
return (
<>
@@ -81,7 +82,7 @@ export default function Message(props: TMessageProps) {
}
className="final-completion"
footer={
-
+
{
}
test.describe('live reasoning', () => {
- test('previews finished sentences and the thought peek, then titles the open card', async ({
+ test('previews finished sentences without exposing a hidden Thoughts preview', async ({
page,
}) => {
test.setTimeout(120000);
@@ -68,7 +68,7 @@ test.describe('live reasoning', () => {
for (const line of lines) {
expect(line, `header line "${line}"`).toMatch(/^(Thinking\.\.\.|Thinking…|.+[.!?])$/);
}
- expect(peekSeen, 'thought peek under the collapsed card').toBe(true);
+ expect(peekSeen, 'no thought peek without the visible Thoughts header').toBe(false);
await expect(messagesView(page).getByText(finalText)).toBeVisible({ timeout: 60000 });
/** The settled thought's header sits at the shared row scale. */
diff --git a/e2e/specs/mock/scenarios/thought-peek-tools.spec.ts b/e2e/specs/mock/scenarios/thought-peek-tools.spec.ts
index 312ca6ce0a..96d24b7435 100644
--- a/e2e/specs/mock/scenarios/thought-peek-tools.spec.ts
+++ b/e2e/specs/mock/scenarios/thought-peek-tools.spec.ts
@@ -37,19 +37,19 @@ async function peekSamples(page: Page, finalText: string) {
}
test.describe('streaming thought peek', () => {
- test('the peek shows only while pure reasoning streams @scenario:thought-peek-only-while-thinking', async ({
+ test('the peek stays hidden when the Thoughts row is folded @scenario:thought-peek-only-while-thinking', async ({
page,
}) => {
test.setTimeout(180000);
- /** Pure reasoning: the peek sits under the collapsed card. */
+ /** Pure reasoning: the Thoughts row is inside the collapsed card. */
const reasoning = uniqueLabel();
await page.goto(NEW_CHAT_PATH, { timeout: 10000 });
await selectMockEndpoint(page, ENDPOINT);
const first = await sendMessage(page, `E2E_SLOW_THINK_REPLY:${reasoning}`);
expect(first.ok()).toBeTruthy();
const pure = await peekSamples(page, `E2E slow think reply done ${reasoning}`);
- expect(pure.visible, 'peek during pure reasoning').toBeGreaterThan(0);
+ expect(pure.visible, 'no peek under a collapsed phase').toBe(0);
await expect(
messagesView(page).getByText(`E2E slow think reply done ${reasoning}`),
).toBeVisible({ timeout: 60000 });