-
fix(sentry): suppress Anthropic quota and API timeout errors from Sentry (#1939)
发布于
2026-05-14 01:03:22 +00:00 - fix(sentry): filter Anthropic quota and API timeout errors from Sentry
Two classes of LLM provider errors were reaching Sentry as bugs even
though they represent operator-actionable, non-code conditions:-
Anthropic HTTP 400 "usage limits" (issues #1883 and #1885):
AnthropicBadRequestError messages containing "usage limits" now raise
"Anthropic billing quota exceeded. Check your plan and billing details."
— consistent with the existing OpenAI insufficient_quota handling. -
OpenAI/Openai-compatible API timeout (issue #1934):
The "{provider} API request timed out." message wasn't matched by any
_OPERATOR_ACTIONABLE_LLM_ERROR_PATTERNS entry, so it reached Sentry.
Both cases are now suppressed via two new patterns added to
_OPERATOR_ACTIONABLE_LLM_ERROR_PATTERNS in app/utils/sentry_sdk.py:- r"\bbilling quota exceeded\b" — catches quota exhaustion for all providers
- r"\bapi request timed out\b" — catches transient endpoint timeouts
Closes #1883
Closes #1885
Closes #1934https://claude.ai/code/session_0144hMeudYUNxuULDFvfhWn5
- address greptile feedback
Co-authored-by: Claude noreply@anthropic.com
Co-authored-by: davincios davincios@users.noreply.github.com
Co-authored-by: Cursor cursoragent@cursor.com下载附件