diff --git a/src/lib/error-reporting.ts b/src/lib/error-reporting.ts index ac145c6e5..6f996ef7d 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,12 @@ export function classifySilenced(error: unknown): SilenceReason | null { if (error instanceof ContextError) { return "context_missing"; } + // A ValidationError always means the user supplied an invalid argument value + // (e.g. an empty issue identifier). It is never a CLI bug, so silence the + // whole class to avoid noise from AI-agent callers passing bad input. + 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`