Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions webui/src/components/common/SessionChat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3818,6 +3818,29 @@ describe('ChatToolPart bash rendering', () => {
expect(screen.getByText('$').closest('pre')).toHaveClass('max-h-64');
expect(screen.getByText('tests passed').closest('pre')).toHaveClass('max-h-64');
});

it.each([
'Tool execution was interrupted',
'Command failed with exit code 1',
])('renders the bash error once: %s', (error) => {
render(
React.createElement(ChatToolPart, {
part: {
id: 'bash-error-part',
type: 'tool',
tool: 'bash',
callID: 'call-bash-error',
state: {
status: 'error',
input: { command: 'exit 1' },
error,
},
} as any,
}),
);

expect(screen.getAllByText(error)).toHaveLength(1);
});
});

describe('ChatToolPart question result rendering', () => {
Expand Down
2 changes: 1 addition & 1 deletion webui/src/components/common/SessionChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6275,7 +6275,7 @@ export function ChatToolPart({ part, pendingQuestion, onAnswer, onReject, proces
</details>
)}

{status === 'error' && state.error && (
{!isBashTool && status === 'error' && state.error && (
<div className="rounded-md border border-red-100 bg-red-50 px-2.5 py-1.5 text-[11px] text-red-600 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-300">
{state.error}
</div>
Expand Down