From 90e4055da63af483eaa82a512351ce3ade1eecec Mon Sep 17 00:00:00 2001 From: Muhammad Mustaqeem <265153888+Mustaqeem66@users.noreply.github.com> Date: Thu, 13 Aug 2026 22:01:55 +0500 Subject: [PATCH 1/2] fix(lsp): don't report a crashed checker as a clean workspace runWorkspaceDiagnostics awaited proc.exited but discarded the exit status, then treated empty output as success. A checker that never ran - missing toolchain, crash, OOM kill - writes nothing to either pipe, so the agent was told "No issues found" when nothing had been checked at all. Capture the exit code and, when the checker produced no output *and* exited non-zero, report the failure instead. A non-zero exit with output is how tsc/cargo/pyright normally report diagnostics and is unaffected. This mirrors the exit-status gate that resolveGoWorkspaceDiagnosticsCommand already applies in this file. Refs #8386 --- .../src/lsp/workspace-diagnostics.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/src/lsp/workspace-diagnostics.ts b/packages/coding-agent/src/lsp/workspace-diagnostics.ts index f79cb3d61..4ccd34bfc 100644 --- a/packages/coding-agent/src/lsp/workspace-diagnostics.ts +++ b/packages/coding-agent/src/lsp/workspace-diagnostics.ts @@ -146,10 +146,27 @@ export async function runWorkspaceDiagnostics( new Response(proc.stdout).text(), new Response(proc.stderr).text(), ]); - await proc.exited; + const exitCode = await proc.exited; throwIfAborted(signal); const combined = (stdout + stderr).trim(); if (!combined) { + // A checker that exits non-zero without writing a single byte never + // inspected the workspace: it failed to start (missing toolchain), + // crashed, or was killed (OOM). Reporting "No issues found" there + // tells the agent the workspace is clean when nothing actually + // checked it. A non-zero exit *with* output is the normal way + // tsc/cargo/pyright report diagnostics and still falls through to + // the branch below. Mirrors the exit-status gate + // `resolveGoWorkspaceDiagnosticsCommand` already applies above. + if (exitCode !== 0) { + const detail = proc.signalCode + ? `was killed by ${proc.signalCode}` + : `exited with code ${exitCode}`; + return { + output: `Failed to run ${projectType.command.join(" ")}: the checker ${detail} without reporting anything, so the workspace was not verified`, + projectType, + }; + } return { output: "No issues found", projectType }; } // Limit output length From 6a6d5f02e7645faf6336e75580db2cf5df2d67f9 Mon Sep 17 00:00:00 2001 From: Muhammad Mustaqeem <265153888+Mustaqeem66@users.noreply.github.com> Date: Thu, 13 Aug 2026 22:08:13 +0500 Subject: [PATCH 2/2] style(lsp): collapse the exit-status ternary to satisfy biome The conditional fits in the 120-column budget at indentWidth 3, so the formatter wants it on a single line. --- packages/coding-agent/src/lsp/workspace-diagnostics.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/coding-agent/src/lsp/workspace-diagnostics.ts b/packages/coding-agent/src/lsp/workspace-diagnostics.ts index 4ccd34bfc..d6ac52d64 100644 --- a/packages/coding-agent/src/lsp/workspace-diagnostics.ts +++ b/packages/coding-agent/src/lsp/workspace-diagnostics.ts @@ -159,9 +159,7 @@ export async function runWorkspaceDiagnostics( // the branch below. Mirrors the exit-status gate // `resolveGoWorkspaceDiagnosticsCommand` already applies above. if (exitCode !== 0) { - const detail = proc.signalCode - ? `was killed by ${proc.signalCode}` - : `exited with code ${exitCode}`; + const detail = proc.signalCode ? `was killed by ${proc.signalCode}` : `exited with code ${exitCode}`; return { output: `Failed to run ${projectType.command.join(" ")}: the checker ${detail} without reporting anything, so the workspace was not verified`, projectType,