fix: install native Cursor hook and MCP config (#1543)

* fix: install native cursor hook and MCP config

* fix: avoid false healthy stdio mcp probes
This commit is contained in:
Affaan Mustafa
2026-04-21 18:35:21 -04:00
committed by GitHub
parent 8c422a76f4
commit 92e0c7e9ff
8 changed files with 249 additions and 52 deletions

View File

@@ -308,10 +308,15 @@ function probeCommandServer(serverName, config) {
let stderr = '';
let done = false;
let timer = null;
function finish(result) {
if (done) return;
done = true;
if (timer) {
clearTimeout(timer);
timer = null;
}
resolve(result);
}
@@ -354,7 +359,19 @@ function probeCommandServer(serverName, config) {
});
});
const timer = setTimeout(() => {
timer = setTimeout(() => {
// A fast-crashing stdio server can finish before the timer callback runs
// on a loaded machine. Check the process state again before classifying it
// as healthy on timeout.
if (child.exitCode !== null || child.signalCode !== null) {
finish({
ok: false,
statusCode: child.exitCode,
reason: stderr.trim() || `process exited before handshake (${child.signalCode || child.exitCode || 'unknown'})`
});
return;
}
try {
child.kill('SIGTERM');
} catch {