feat(S-104): Add stderr-length and exit-code correlation diagnostics

This commit is contained in:
2026-05-19 19:51:10 -05:00
parent 106c7d6425
commit 1983dd82e7
3 changed files with 46 additions and 1 deletions
+3 -1
View File
@@ -90,15 +90,17 @@ export async function executePrompt(
clearTimeout(timeout);
const durationMs = Date.now() - startMs;
if (options.debug || options.onDebug) {
const effectiveExitCode = result?.exitCode ?? (err instanceof ExecError ? err.result.exitCode : null);
const debugInfo: DebugInfo = {
command,
args,
pid: child.pid ?? undefined,
exitCode: result?.exitCode ?? (err instanceof ExecError ? err.result.exitCode : null),
exitCode: effectiveExitCode,
exitSignal,
durationMs,
stderrLength: stderr.length,
stdoutLength: stdout.length,
noisySuccess: effectiveExitCode === 0 && stderr.length > 0,
};
options.onDebug?.(debugInfo);
}