fix(chat): normalize bash output by stripping ANSI sequences and applying terminal control codes #2554

This commit is contained in:
Bohdan Triapitsyn
2026-08-03 12:50:56 +03:00
committed by GitHub
3 changed files with 187 additions and 12 deletions
@@ -1362,7 +1362,7 @@ const ToolExpandedContent: React.FC<ToolExpandedContentProps> = React.memo(({
const stateWithData = state as ToolStateWithMetadata;
const metadata = stateWithData.metadata;
const input = stateWithData.input;
const rawOutput = getToolOutput(part.tool, stateWithData.output, metadata?.output);
const rawOutput = getToolOutput(part.tool, stateWithData.output, metadata?.output, state.status);
const hasStringOutput = typeof rawOutput === 'string' && rawOutput.length > 0;
const rawOutputString = typeof rawOutput === 'string' ? rawOutput : '';
const isStreamingBash = part.tool === 'bash' && state.status === 'running';