fix(observability): suppress VOYAGE_API_KEY not configured Sentry noise (#2912)#2915
Conversation
Backend returns {"success":false,"error":"VOYAGE_API_KEY is not configured"}
on every embedding request when the env var is absent. This is a known
server-side config state, not an app error — ~5K Sentry events
(TAURI-RUST-2H5) were being filed needlessly.
Add `_api_key is not configured` to the `ApiKeyMissing` substring check
in `expected_error_kind`. The `_api_key` anchor (lower-cased trailing
segment of an env-var name) scopes the match to ALL_CAPS_API_KEY-style
names and prevents generic "X is not configured" prose from being silenced.
Closes tinyhumansai#2912. Same suppression pattern as PR tinyhumansai#2850 and tinyhumansai#2899.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAdds explanatory block comments around the existing ChangesAPI key missing error suppression
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Kept PR's VOYAGE_API_KEY comment block and test documentation; preserved both `embedding model is not configured` (HEAD) and `provider 'voyage' is not configured in settings` (upstream) as non-match test cases in does_not_classify_unrelated_is_not_configured_messages.
oxoxDev
left a comment
There was a problem hiding this comment.
LGTM. Adds _api_key is not configured to the existing ApiKeyMissing arm — the _api_key suffix anchors on ALL_CAPS env-var names so generic "X is not configured" prose stays actionable (verified: model/workspace/provider variants → None). CI green. Approving.
Summary
_api_key is not configuredto theApiKeyMissingsubstring matcher inexpected_error_kind(src/core/observability.rs){"success":false,"error":"VOYAGE_API_KEY is not configured"}as a 400 on every embedding request when the env var is absent — this is a known server-side config state, not an app error_api_keyanchor (lower-cased trailing segment of an env-var name likeVOYAGE_API_KEY) scopes the match to ALL_CAPS env-var-style names and prevents generic "X is not configured" prose from being silencedclassifies_backend_env_api_key_not_configuredanddoes_not_classify_unrelated_is_not_configured_messagesCloses #2912
Test plan
cargo checkpasses cleanlycargo test --lib core::observability— 90 tests pass (0 failures)classifies_backend_env_api_key_not_configuredasserts VOYAGE_API_KEY and COHERE_API_KEY shapes →ApiKeyMissingdoes_not_classify_unrelated_is_not_configured_messagesasserts generic "X is not configured" prose →NoneSummary by CodeRabbit