feat(S-104): Add stderr-length and exit-code correlation diagnostics
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user