diff --git a/bin/gstack-gbrain-detect b/bin/gstack-gbrain-detect index 2ad615e1a..00f98a9c2 100755 --- a/bin/gstack-gbrain-detect +++ b/bin/gstack-gbrain-detect @@ -147,7 +147,10 @@ interface DoctorVerdict { function runDoctor(extraArgs: string[], timeoutMs: number): DoctorVerdict { let r: ReturnType; try { - r = spawnGbrain(["doctor", "--json", ...extraArgs, "--scope=brain"], { timeout: timeoutMs }); + r = spawnGbrain(["doctor", "--json", ...extraArgs, "--scope=brain"], { + timeout: timeoutMs, + stdio: ["ignore", "pipe", "ignore"], + }); } catch (e) { const error = `gbrain doctor could not start: ${e instanceof Error ? e.message : String(e)}`; return { brain_ok: false, status: null, brain_failures: [], skill_failures: [], report: null, error }; @@ -158,11 +161,8 @@ function runDoctor(extraArgs: string[], timeoutMs: number): DoctorVerdict { } catch {} if (!report || typeof report !== "object") { const cause = r.error ? r.error.message : r.signal ? `killed by ${r.signal}` : `exit ${r.status}`; - const stderr = (r.stderr || "").trim().split("\n").slice(-5).join("\n"); - return { - brain_ok: false, status: null, brain_failures: [], skill_failures: [], report: null, - error: `gbrain doctor printed no JSON report (${cause})${stderr ? `: ${stderr}` : ""}`, - }; + const error = `gbrain doctor printed no JSON report (${cause})`; + return { brain_ok: false, status: null, brain_failures: [], skill_failures: [], report: null, error }; } const failed = (Array.isArray(report.checks) ? report.checks : []).filter((c) => c?.status === "fail"); const skill_failures = failed.filter((c) => c.category === "skill").map((c) => c.name ?? "unnamed");