Skip to content
Draft
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
2 changes: 1 addition & 1 deletion src/cursor-sdk-process-error-guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function shouldSuppressProcessError(event: string | symbol, args: readonly unkno
const classification = classifyCursorConnectError(error);
if (!classification) return false;
if (classification.kind === "abort") return hasActiveAbortSuppression();
return activeProviderTurns.size > 0 && isCursorProvenance(classification.source);
return activeProviderTurns.size > 0 && (classification.kind === "network" || isCursorProvenance(classification.source));
}

function installProcessEmitPatch(): void {
Expand Down
4 changes: 2 additions & 2 deletions test/cursor-sdk-process-error-guard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe("Cursor SDK process error guard", () => {
}
});

it("does not suppress non-Cursor network ConnectErrors", () => {
it("suppresses generic connect-node network ConnectErrors while a provider turn is active", () => {
const suppression = installCursorSdkProcessErrorGuard();
let listenerCalled = false;
const listener = () => {
Expand All @@ -235,7 +235,7 @@ describe("Cursor SDK process error guard", () => {
try {
const emitted = process.emit("uncaughtException", makeNonCursorNetworkConnectError(), "uncaughtException");
expect(emitted).toBe(true);
expect(listenerCalled).toBe(true);
expect(listenerCalled).toBe(false);
} finally {
process.removeListener("uncaughtException", listener);
suppression.dispose();
Expand Down