Test-model diagnostic floods Sentry: error! on user config-rejection (TAURI-RUST-4M6)
Source
Sentry: TAURI-RUST-4M6 (self-hosted, project tauri-rust)
Events: 1296 · Users affected: 54 · First seen: 2026-05-27 · Last seen: 2026-06-12
Live on current latest build (0.57.18, 430 events); also 0.57.13 / 0.57.11 / 0.57.5 / 0.56.0. Not a pre-fix tail.
Symptom
[inference::ops] test_provider_model:error captured as a Sentry error event. No exception — it is a tracing::error! message capture. Representative tracing fields:
provider = ollama:claude-opus-4-8,workload = agenticerror = ollama API error (404 Not Found): {"error":{"message":"model 'claude-opus-4-8' not found","type":"not_found_error",...}}; check that your endpoint URL is correct and the model name exists on your provider
Root cause
inference_test_provider_model (src/openhuman/inference/ops.rs:182-188) is the backend of the Settings "Test model" button. On any failure its final match arm logs error!(... "test_provider_model:error") unconditionally. The Sentry tracing layer (src/core/logging.rs:394 sentry_tracing_layer) maps Level::ERROR -> EventFilter::Event (direct capture), so the error! macro fires a Sentry event directly, bypassing the JSON-RPC report_error_or_expected classifier.
The dominant failure is user-state: the user deliberately tests an arbitrary provider/model and supplies a wrong model id / key. The error already returns to the UI as Err. The shared classifier expected_error_kind (src/core/observability.rs:290) already recognizes these bodies (is_provider_config_rejection_message matches not_found_error) — only the call-site error! leaks them.
Precedent: inference_list_models in the same file already demotes a user-config case to warn! to stop Sentry escalation (TAURI-RUST-X).
Bug shape
Sentry-noise / config-rejection (user-state). Bucket = genuinely-unpreventable user-state during an explicit diagnostic; RCA = route the Err log through expected_error_kind (warn! when expected, error! otherwise). No real defect suppressed — Err still propagates to the UI.
Reproduces on
- Branch:
upstream/main(0.57.39) —ops.rs:182-188still logserror!unconditionally.
I've analyzed the fix for this issue. The connected GitHub account (chrisfbaileycb-arch) only has pull-level access to this repository, so I cannot push the branch or open the PR directly.
The fix is straightforward:
In src/openhuman/inference/ops.rs, lines 185-189 (inside inference_test_provider_model), replace the unconditional error! with a conditional that checks is_unknown_provider_user_config(err) and demotes to warn! for user-config errors (wrong model id / bad key), matching the pattern already used in inference_list_models (lines 264-282).
Steps for someone with write access:
git checkout -b fix/3627-test-model-sentry-flood main- Edit
src/openhuman/inference/ops.rslines 185-189 as described in the issue git commit -m "fix(inference): demote test_provider_model user-config errors to warn (#3627)"git push origin fix/3627-test-model-sentry-flood- Open PR against
mainwith title "fix(inference): demote test_provider_model user-config errors to warn" and body:
Closes #3627
The Settings "Test model" button logs `error!` unconditionally on any
failure. The dominant failure mode is user-state (wrong model id / bad
key) — not a defect. This floods Sentry with ~1296 events/month.
Uses `is_unknown_provider_user_config` to classify errors: expected
config rejections get `warn!` (local logs only), real errors still
reach Sentry with the error embedded in the format string.
Same pattern as `inference_list_models`.