fix(observability): demote expected chat failures out of Sentry (TAURI-RUST-68, closes #2926)#2928
Conversation
…I-RUST-68, tinyhumansai#2926) `inference_test_provider_model` fires `error!` for every `simple_chat` failure (401 API key invalid, 429 rate-limit, model not found, etc.). These sub-errors already have their own Sentry reports from the provider layer, making every `[inference::ops] test_provider_model:error` event a duplicate — 1,309 events across releases. Fix: gate the ops-level error log on `is_expected_chat_failure`, which delegates to the shared `expected_error_kind` classifier in `core::observability`. Expected conditions are demoted to `warn!` (local log, no Sentry). Genuine unexpected failures (5xx, payload parse errors, I/O) still escalate via `error!`. Adds four unit tests anchored on the same `expected_error_kind` classifier to prevent the guard from drifting out of sync. Closes tinyhumansai#2926
|
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 (2)
📝 WalkthroughWalkthroughThe PR introduces a provider chat error classifier ( ChangesExpected Error Classification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
oxoxDev
left a comment
There was a problem hiding this comment.
LGTM. is_expected_chat_failure delegates to the shared expected_error_kind classifier, so the ops-level test_provider_model wrapper stops duplicating Sentry events the provider layer already reported (or that are deterministically expected). Polarity verified: genuine 500s, unexpected payloads, local I/O errors, and empty strings are NOT demoted. CI green. Approving.
Summary
inference_test_provider_modelfireserror!for everysimple_chatfailure (401, 429, model not found, etc.), creating 1,309 duplicate Sentry events (TAURI-RUST-68). The sub-errors already have their own Sentry reports from the provider layer.is_expected_chat_failurehelper that delegates to the sharedexpected_error_kindclassifier incore::observability. Expected conditions are demoted towarn!(local log, no Sentry event). Genuine unexpected failures (5xx, payload parse errors, I/O) still escalate.Pre-push hook failed due to
node_modulesmissing in worktree (prettiernot found) — this is a pre-existing environment issue, not caused by these Rust-only changes.Test plan
cargo test --lib -- "inference::ops"— all 21 tests pass (17 existing + 4 new)cargo check --manifest-path Cargo.toml— no errorscargo fmt— appliedSummary by CodeRabbit
Release Notes
Bug Fixes
Tests