Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/shared/command-executor/execute-hook-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export async function executeHookCommand(
stderr += data.toString();
});

proc.stdin?.on("error", () => {});
proc.stdin?.on("error", (stdinErr) => {
// Ignore stdin errors - process may have already exited
});
proc.stdin?.write(stdin);
proc.stdin?.end();

Expand Down Expand Up @@ -100,13 +102,16 @@ export async function executeHookCommand(
if (!isWin32 && proc.pid) {
try {
process.kill(-proc.pid, signal);
} catch {
} catch (pgErr) {
// Process group kill failed, try direct kill
proc.kill(signal);
}
} else {
proc.kill(signal);
}
} catch {}
} catch (killErr) {
// Process may already be dead
}
};

const timeoutTimer = setTimeout(() => {
Expand Down
4 changes: 3 additions & 1 deletion src/shared/spawn-with-windows-hide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function wrapNodeProcess(proc: ChildProcess): SpawnedProcess {
}

proc.kill(signal)
} catch {}
} catch (killErr) {
// Process may already be dead
}
},
}
}
Expand Down
16 changes: 12 additions & 4 deletions src/tools/lsp/lsp-client-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export class LSPClientTransport {
this.stderrBuffer.shift()
}
}
} catch {}
} catch (err) {
// Silently ignore stderr read errors - stream may close during process shutdown
}
}
read()
}
Expand Down Expand Up @@ -157,7 +159,9 @@ export class LSPClientTransport {
try {
this.sendNotification("shutdown", {})
this.sendNotification("exit")
} catch {}
} catch (err) {
// Ignore shutdown errors - connection may already be closed
}
this.connection.dispose()
this.connection = null
}
Expand All @@ -184,9 +188,13 @@ export class LSPClientTransport {
proc.kill("SIGKILL")
// Wait briefly for SIGKILL to take effect
await Promise.race([proc.exited, new Promise<void>((resolve) => setTimeout(resolve, 1000))])
} catch {}
} catch (sigkillErr) {
// SIGKILL may fail if process already terminated
}
}
} catch {}
} catch (stopErr) {
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Missing error logging statement despite comment claiming errors are logged

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/tools/lsp/lsp-client-transport.ts, line 195:

<comment>Missing error logging statement despite comment claiming errors are logged</comment>

<file context>
@@ -184,9 +188,13 @@ export class LSPClientTransport {
+          }
         }
-      } catch {}
+      } catch (stopErr) {
+        // Process cleanup errors are logged but don't prevent cleanup
+      }
</file context>
Fix with Cubic

// Process cleanup errors are logged but don't prevent cleanup
}
}
this.processExited = true
this.diagnosticsStore.clear()
Expand Down
4 changes: 3 additions & 1 deletion src/tools/lsp/lsp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export class LSPClient extends LSPClientConnection {
if (result && typeof result === "object" && "items" in result) {
return result as { items: Diagnostic[] }
}
} catch {}
} catch (diagErr) {
// Diagnostic request failed, fall back to cached diagnostics
}

return { items: this.diagnosticsStore.get(uri) ?? [] }
}
Expand Down
4 changes: 3 additions & 1 deletion src/tools/lsp/lsp-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ function wrapNodeProcess(proc: ChildProcess): UnifiedProcess {
} else {
proc.kill()
}
} catch {}
} catch (killErr) {
// Process may already be dead
}
},
}
}
Expand Down
18 changes: 13 additions & 5 deletions src/tools/lsp/lsp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class LSPServerManager {
// Stale init can permanently block subsequent calls (e.g., LSP process hang)
try {
await managed.client.stop();
} catch {}
} catch (stopErr) {
// Ignore stop errors during stale init cleanup
}
this.clients.delete(key);
managed = undefined;
}
Expand All @@ -86,11 +88,13 @@ class LSPServerManager {
if (managed.initPromise) {
try {
await managed.initPromise;
} catch {
} catch (initErr) {
// Failed init should not keep the key blocked forever.
try {
await managed.client.stop();
} catch {}
} catch (stopErr) {
// Ignore stop errors after failed init
}
this.clients.delete(key);
managed = undefined;
}
Expand All @@ -104,7 +108,9 @@ class LSPServerManager {
}
try {
await managed.client.stop();
} catch {}
} catch (stopErr) {
// Ignore stop errors when cleaning up dead client
}
this.clients.delete(key);
}
}
Expand All @@ -130,7 +136,9 @@ class LSPServerManager {
this.clients.delete(key);
try {
await client.stop();
} catch {}
} catch (stopErr) {
// Ignore stop errors after init failure
}
throw error;
}
const m = this.clients.get(key);
Expand Down