Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: guard stdin error so a missing claude CLI can't crash the server

Adam Eivy43604238b2fc
diff --git a/server/services/claudeCodeUsage.js b/server/services/claudeCodeUsage.js
index e94170c5cb..e28772e596 100644
--- a/server/services/claudeCodeUsage.js
+++ b/server/services/claudeCodeUsage.js
@@ -170,6 +170,11 @@ function runUsageCli() {
reject(new Error(`Claude Code /usage exited ${code} with no output${stderr ? `: ${stderr.trim()}` : ''}`));
});
+ // If the binary is missing (ENOENT) or the child dies before reading stdin,
+ // writing here emits an 'error' (EPIPE/ENOENT) on the stdin stream. Without
+ // this listener that unhandled stream error crashes the process; the
+ // meaningful rejection still comes from the child 'error' handler above.
+ child.stdin.on('error', () => {});
child.stdin.write(STDIN_INPUT);
child.stdin.end();
});