fix(coding-agent): do not highlight read errors (#6731)

This commit is contained in:
Danila Poyarkov
2026-07-17 10:02:50 +03:00
committed by GitHub
parent 056c8cbb80
commit a2c5ee33eb
2 changed files with 20 additions and 2 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ function formatReadResult(
const rawPath = str(args?.file_path ?? args?.path);
const output = getTextOutput(result, showImages);
const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
const lang = !isError && rawPath ? getLanguageFromPath(rawPath) : undefined;
const renderedLines = lang ? highlightCode(replaceTabs(output), lang) : output.split("\n");
const lines = trimTrailingEmptyLines(renderedLines);
const maxLines = options.expanded ? lines.length : 10;