Keep proven external connection failures out of Sentry (#15590)

Apply the reviewed change for Keep proven external connection failures out of Sentry.

Validation: local typecheck/build and focused regression tests, passing exact-head CI, Greptile 5/5, and independent source review. The PR records full-suite evidence and any local environment limitations.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Devin FoleyandPaperclip authored and GitHub committed 2026-10-08 10:19:40 -07:00
1 parent 0ac194450a
commit 3d0e74e743
29 files changed
+2097 -80

No files matched your search

+4 -3
View File
@@ -13,6 +13,7 @@ import {
redactSensitiveValueOccurrences,
} from "./redact-sensitive.js";
import { recordResponsibleUserDenialOnActiveRun } from "../services/responsible-user-denial-run-outcomes.js";
import { isExpectedMcpConnectionFailure } from "../services/mcp-connection-failure.js";
export interface ErrorContext {
error: {
@@ -85,10 +86,10 @@ function sanitizeSecretSensitiveResponse(
}
/** Report a server-side crash to every error sink. */
function reportCrash(error: Error): void {
function reportCrash(error: Error, reportToSentry = true): void {
const tc = getTelemetryClient();
if (tc) trackErrorHandlerCrash(tc, { errorCode: error.name });
captureException(error);
if (reportToSentry) captureException(error);
}
function getPaperclipDb(req: Request): Db | null {
@@ -176,7 +177,7 @@ export function errorHandler(
},
reportableError,
);
reportCrash(reportableError);
reportCrash(reportableError, !isExpectedMcpConnectionFailure(err));
}
const secretSensitiveServerError =
err.status >= 500 &&