From ea58049a1414f8c17fe289a2c511a069f393a194 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 22:40:04 +0000 Subject: [PATCH 1/2] fix(error-reporting): Silence ValidationError in telemetry --- src/lib/error-reporting.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/error-reporting.ts b/src/lib/error-reporting.ts index ac145c6e50..9a844879a8 100644 --- a/src/lib/error-reporting.ts +++ b/src/lib/error-reporting.ts @@ -52,7 +52,8 @@ type SilenceReason = | "auth_expected" | "api_user_error" | "api_query_error" - | "network_error"; + | "network_error" + | "validation_error"; /** * Classify whether an error should be silenced. @@ -82,6 +83,13 @@ export function classifySilenced(error: unknown): SilenceReason | null { if (error instanceof ContextError) { return "context_missing"; } + // A ValidationError always means the user passed malformed or out-of-range + // input (e.g. too many positional arguments). It is never a CLI bug — the + // user must correct their invocation. Silence the whole class; the + // `cli.error.silenced` metric preserves the volume. (CLI-1AN) + if (error instanceof ValidationError) { + return "validation_error"; + } // All AuthError reasons are expected auth states the user must act on, not // CLI bugs: `not_authenticated` (no token), `expired` (token aged out), and // `invalid` (a bad/insufficiently-scoped token the user supplied). `invalid` From cb23b9116295d6a58be8b3a8c2cf1ca02c2a62ff Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 18:35:20 +0000 Subject: [PATCH 2/2] fix(error-reporting): silence positional argument ValidationErrors --- src/lib/error-reporting.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/error-reporting.ts b/src/lib/error-reporting.ts index 9a844879a8..17d27e5d00 100644 --- a/src/lib/error-reporting.ts +++ b/src/lib/error-reporting.ts @@ -83,11 +83,13 @@ export function classifySilenced(error: unknown): SilenceReason | null { if (error instanceof ContextError) { return "context_missing"; } - // A ValidationError always means the user passed malformed or out-of-range - // input (e.g. too many positional arguments). It is never a CLI bug — the - // user must correct their invocation. Silence the whole class; the - // `cli.error.silenced` metric preserves the volume. (CLI-1AN) - if (error instanceof ValidationError) { + // A ValidationError with field "positional" means the user passed the wrong + // number of positional arguments — a user invocation mistake, never a CLI + // bug. Silence only this sub-case; other ValidationError fields (e.g. + // "installUrl" from buildFormatFromUrl) may reflect API-contract issues + // worth capturing. The `cli.error.silenced` metric preserves the volume. + // (CLI-1AN) + if (error instanceof ValidationError && error.field === "positional") { return "validation_error"; } // All AuthError reasons are expected auth states the user must act on, not