fix(observability): skip Sentry for vision-disabled RAM-tier errors (OPENHUMAN-TAURI-3B)#1623
Conversation
…PENHUMAN-TAURI-3B)
`local_ai_download_asset` returns a deliberate user-state error when a
user on a 0–4 GB RAM tier requests the vision asset:
"Vision is disabled for this RAM tier. Switch to the 4-8 GB tier
or above to enable it."
It also has a sibling shape emitted from `vision_embed.rs` when a vision
summarization call is made on the same tier:
"vision summaries are unavailable for this RAM tier. Use OCR-only
summarization or switch to a higher local AI tier."
Both are surfaced for the UI to act on (prompt the user to bump tiers) —
they carry no remediable signal for Sentry. Today they flow through
`rpc.invoke_method` → `report_error_or_expected`, which captures them as
error events (28 occurrences in the last 4 days against `openhuman@0.53.35`).
Extend `expected_error_kind` with a new `LocalAiCapabilityUnavailable`
variant, anchored on the shared substring `"for this RAM tier"`. The
classifier is intentionally narrow so unrelated messages that mention
RAM in other contexts (sizing, doc refs) are not silenced.
Logged at `info!` via `report_expected_message` so the sentry-tracing
layer records at most a breadcrumb, not an error event — same pattern as
`LocalAiDisabled`.
Tests:
- `classifies_local_ai_capability_unavailable_errors` exercises both
canonical wire shapes plus the wrapped `rpc.invoke_method failed: …`
shape that reaches the classifier in production.
- `does_not_classify_unrelated_messages_as_capability_unavailable`
pins the anchor so future tier-related messages don't accidentally
silence unrelated paths.
|
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 skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRecognize local-AI "capability unavailable for this ram tier" messages in observability: new ExpectedErrorKind variant and helper classify them, and matched errors are logged at info level instead of reported as errors; tests added for positive and negative cases. ChangesLocal AI Capability Unavailable Error Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
graycyrus
left a comment
There was a problem hiding this comment.
PR #1623 Review — fix(observability): skip Sentry for vision-disabled RAM-tier errors
Walkthrough
Adds a third expected-error variant, LocalAiCapabilityUnavailable, to ExpectedErrorKind in src/core/observability.rs. When the local-AI service rejects a request because the user's RAM tier doesn't support vision, the error now routes to tracing::info! instead of being captured as a Sentry event. Correctly motivated: these are deliberate user-state signals (28 occurrences in 4 days on v0.53.35), not bugs. Implementation follows the existing LocalAiDisabled pattern exactly.
Changes
| File | Summary |
|---|---|
src/core/observability.rs |
Adds LocalAiCapabilityUnavailable variant; is_local_ai_capability_unavailable_message classifier anchored on "for this ram tier"; match arm in report_expected_message logging at info!; 2 new test functions |
Comments
[minor] Short warning-field form not pinned in tests
assets.rs also emits a shorter form "Vision is disabled for this RAM tier." (just a period, no trailing sentence) as a warning field. The classifier handles it correctly (substring is present), but the test suite only covers the full-sentence forms. Consider adding it as a third entry in the for raw in [...] loop — one line, zero extra scaffolding:
"Vision is disabled for this RAM tier.",[nitpick] Inline source-location comment in classifier body
The docstring above is_local_ai_capability_unavailable_message already documents the emitting sites, but a short inline comment in the function body itself would make it obvious to future developers adding a third capability gate:
fn is_local_ai_capability_unavailable_message(lower: &str) -> bool {
// Anchor shared by local_ai/service/assets.rs (ensure_capability_ready)
// and local_ai/service/vision_embed.rs (summarize).
lower.contains("for this ram tier")
}Take or leave — the existing docstring covers intent well.
Verified / Looks Good
- Anchor
"for this ram tier"is present verbatim in both emitting sites (assets.rs,vision_embed.rs) afterto_ascii_lowercase() is_local_ai_capability_unavailable_messageis correctly private (fn, notpub fn)- New variant is additive —
ExpectedErrorKindderivesPartialEq, Eq, match is exhaustive - Log level
info!matchesLocalAiDisabledprecedent;ApiKeyMissinguseswarn!(intentional distinction) - No PII in logged messages
- No new deps, no module layout violations
- Tests cover positive (2 canonical shapes + RPC-wrapped) and negative (2 unrelated RAM mentions) paths
- All 17 CI checks pass, coverage gate ≥80% met
Overall: Clean, well-scoped fix. One minor suggestion (pin the short form in tests), one nitpick. Would approve as-is or with the minor addressed.
|
pr-manager follow-up — merge conflict resolved, reviewer suggestions applied. Changes applied (commit abb4fc8)
Quality checks
NoteThis is a cross-repo PR. The commit was pushed to `senamakel/openhuman:pr/1623` (the user's fork). The contributor's fork (`CodeGhost21/openhuman`) is not updated by this push. A maintainer can merge from the fork branch or cherry-pick abb4fc8 onto the PR branch directly. |
…p-vision-ram-tier-3b # Conflicts: # src/core/observability.rs
…OPENHUMAN-TAURI-3B) (tinyhumansai#1623)
Summary
ExpectedErrorKind::LocalAiCapabilityUnavailableto the observability classifier so RAM-tier "vision disabled" / "vision unavailable" responses stop being captured as Sentry errors."for this RAM tier", the shared marker emitted fromassets.rs(Vision is disabled for this RAM tier…) andvision_embed.rs(vision summaries are unavailable for this RAM tier…).info!inreport_expected_message, mirroring the existingLocalAiDisabledpath — sentry-tracing records a breadcrumb, not an error.Fixes OPENHUMAN-TAURI-3B (28 occurrences in 4 days on
openhuman@0.53.35, surfaced viaopenhuman.local_ai_download_asset→rpc.invoke_method).Why this is noise, not signal
The local-AI service deliberately returns this error so the UI can prompt the user to bump tiers when their hardware doesn't support vision. It's a pure user-state condition with no remediable Sentry signal — same shape as the existing
local ai is disabledskip. Today it flows throughrpc.invoke_methodand gets captured byreport_error_or_expectedfor every download attempt.Test plan
cargo test --lib core::observability::— 13 tests pass, including the two new classifier tests.classifies_local_ai_capability_unavailable_errorscovers both canonical wire shapes plus the wrappedrpc.invoke_method failed: …form that hits the classifier in production.does_not_classify_unrelated_messages_as_capability_unavailablepins the anchor so unrelated RAM-mentioning messages aren't silenced.cargo check --lib— no new warnings.cargo fmt.Summary by CodeRabbit
Bug Fixes
Tests