Skip to content

revert: remove all Sentry error suppression (12 PRs)#2959

Open
graycyrus wants to merge 1 commit into
tinyhumansai:mainfrom
graycyrus:revert/sentry-suppressions
Open

revert: remove all Sentry error suppression (12 PRs)#2959
graycyrus wants to merge 1 commit into
tinyhumansai:mainfrom
graycyrus:revert/sentry-suppressions

Conversation

@graycyrus
Copy link
Copy Markdown
Contributor

@graycyrus graycyrus commented May 29, 2026

Summary

Reverts all Sentry error suppression code from 12 PRs that hid bugs instead of fixing root causes.

Affected PRs: #2813, #2850, #2899, #2906, #2915, #2923, #2924, #2928, #2930, #2934, #2937, #2939

Errors will resume firing Sentry events. Each will get a proper root-cause fix in separate PRs.

Why

Suppressing errors hides bugs. The correct approach is to fix the root cause — add backoff, refresh tokens, handle gracefully — not silence the symptom.

Test plan

  • cargo check passes
  • No compile errors from removed code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed overly broad error suppression in monitoring, ensuring more failure scenarios are now properly reported.
    • Tightened error classification to more accurately detect API key and configuration issues.
    • Removed workaround filters that previously masked upstream rate-limit and embeddings errors.
  • Chores

    • Simplified error handling logic for improved consistency across provider integrations and memory operations.

Review Change Stack

…tinyhumansai#2850 tinyhumansai#2899 tinyhumansai#2906 tinyhumansai#2915 tinyhumansai#2923 tinyhumansai#2924 tinyhumansai#2928 tinyhumansai#2930 tinyhumansai#2934 tinyhumansai#2937 tinyhumansai#2939

These PRs suppressed/demoted errors instead of fixing root causes.
Errors will now properly fire Sentry events again so they can be
tracked and fixed with proper root-cause solutions.
@graycyrus graycyrus requested a review from a team May 29, 2026 16:39
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

This PR removes several observability error classification pathways and Sentry suppression filters. Core changes: ExpectedErrorKind::MemoryStorePiiRejection is deleted entirely; ApiKeyMissing, session-expired, and Composio classifiers are tightened; budget filter is simplified from two-tier to single tag-gated tier; Sentry before_send suppression for embeddings 401 and rate-limit patterns is removed; provider /models 404 special handling is removed; and provider config rejection phrase matching is refined.

Changes

Error classification pathway removal and Sentry filter simplification

Layer / File(s) Summary
Core observability classifier refactoring
src/core/observability.rs
ExpectedErrorKind::MemoryStorePiiRejection variant, dispatch arm, and helper predicate removed; ApiKeyMissing matcher tightened to remove env-var "_api_key is not configured" pattern; is_session_expired_message drops "backend rejected session token" matching; Composio direct-mode classifier narrowed to HTTP 401 only; is_budget_event rewritten as single tag-gated tier requiring failure=="non_2xx" and status=="400", with tag-less "Insufficient budget" detection helper removed; unit tests updated to match removed/refined matchers.
Sentry before_send filter removal
src/main.rs
Two suppression filters removed: embeddings-path HTTP 401 events (API-key related) and upstream rate-limit pattern detection (scanning event message/logentry/exception text), allowing those event types to proceed through remaining before_send logic and secret scrubbing.
Provider error handling and config rejection tightening
src/openhuman/inference/provider/ops.rs, src/openhuman/inference/provider/config_rejection.rs
HTTP 404 special handling removed from list_configured_models_from_config (now flows to generic error path); rate-limit body detection suppression removed from api_error; provider config rejection phrase matching refined (thinking-mode substring updated, Ollama subscription anchor more specific, tool-unsupported phrases pruned); associated test coverage deleted for removed behaviors and phrase families.
Inference logging and documentation updates
src/openhuman/inference/ops.rs, src/openhuman/memory_store/factories.rs, src/openhuman/subconscious/store.rs
Inference test-provider error logging changed to unconditional error! (removes expected-error conditional warn! path); Ollama health-gate Sentry reporting documentation clarified; subconscious module documentation shortened and directory-creation error message improved; test coverage adjusted for removed reporting path.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

rust-core, sentry-traced-bug, working

Suggested reviewers

  • oxoxDev
  • M3gA-Mind
  • sanil-23

Poem

🐰 A rabbit hops through classifier code,
Sweeping away the paths no longer rode—
Expect no more for PII and tokens past,
Simpler filters at last, at last!
Tighter phrases, cleaner logic flow,
Watch the noise just go, just go! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the PR's main objective: reverting Sentry error suppression code across multiple prior PRs, which aligns directly with the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. sentry-traced-bug Bug identified via Sentry triage working A PR that is being worked on by the team. labels May 29, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/openhuman/inference/ops.rs (1)

182-182: ⚡ Quick win

Add correlation fields to the error log.

Include workload and provider on this error event to keep failure logs queryable with the same context as the start event.

Suggested diff
-        Err(err) => error!(error = %err, "{LOG_PREFIX} test_provider_model:error"),
+        Err(err) => error!(
+            workload,
+            provider,
+            error = %err,
+            "{LOG_PREFIX} test_provider_model:error"
+        ),
As per coding guidelines: “Prefix debug logs with stable, grep-friendly identifiers … and include correlation fields such as request IDs, method names, or entity IDs.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/inference/ops.rs` at line 182, The error log at the Err branch
currently only logs the error; update the error! invocation in the Err(err) arm
to include the correlation fields workload and provider (e.g. error!(workload =
%workload, provider = %provider, error = %err, "{LOG_PREFIX}
test_provider_model:error")), keeping the existing LOG_PREFIX message and error
formatting; ensure workload and provider are in scope or passed into the
function containing this Err(err) match arm (refer to the Err branch where
error!(...) is called).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/openhuman/inference/provider/config_rejection.rs`:
- Around line 170-192: Run the project's formatter and commit the changes so CI
passes: execute pnpm format (which runs rustfmt/prettier) and ensure cargo fmt
has formatted Rust files; then add and commit the updated file containing the
string entries "thinking mode must be passed back" and "requires a subscription,
upgrade for access" so pnpm format:check and cargo fmt --check succeed in CI.

---

Nitpick comments:
In `@src/openhuman/inference/ops.rs`:
- Line 182: The error log at the Err branch currently only logs the error;
update the error! invocation in the Err(err) arm to include the correlation
fields workload and provider (e.g. error!(workload = %workload, provider =
%provider, error = %err, "{LOG_PREFIX} test_provider_model:error")), keeping the
existing LOG_PREFIX message and error formatting; ensure workload and provider
are in scope or passed into the function containing this Err(err) match arm
(refer to the Err branch where error!(...) is called).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07dd0604-9948-4940-a388-c4c8b3baedc0

📥 Commits

Reviewing files that changed from the base of the PR and between b7110d0 and 34ed335.

📒 Files selected for processing (8)
  • src/core/observability.rs
  • src/main.rs
  • src/openhuman/inference/ops.rs
  • src/openhuman/inference/ops_tests.rs
  • src/openhuman/inference/provider/config_rejection.rs
  • src/openhuman/inference/provider/ops.rs
  • src/openhuman/memory_store/factories.rs
  • src/openhuman/subconscious/store.rs
💤 Files with no reviewable changes (2)
  • src/openhuman/inference/ops_tests.rs
  • src/main.rs

Comment on lines +170 to 192
// thinking-mode model (DeepSeek-R1 / Moonshot K2-thinking on
// `provider=cloud` custom_openai) rejects a follow-up turn that
// doesn't echo the prior assistant's `reasoning_content` field.
// Body shape (backtick-quoted JSON literal in the upstream body):
// `{"error":{"message":"The `reasoning_content` in the thinking
// mode must be passed back to the API.",...}}`. The
// provider-contract gap is on our side, but until the thinking-
// mode round-tripping ships in the inference layer, every affected
// turn fires a fresh Sentry event — and the UI already surfaces
// the actionable error to the user. Anchor on the unique
// `thinking mode must be passed back` substring so the match
// doesn't depend on the upstream's backtick-quoting around
// `reasoning_content` (some provider versions ship without them).
"thinking mode must be passed back",
// TAURI-RUST-4XK (~649 events) — Ollama Cloud subscription gate.
// Body: `{"error":"this model requires a subscription, upgrade for
// access: https://ollama.com/upgrade (ref: <uuid>)"}` on a 403
// Forbidden from `compatible::OpenAiCompatibleProvider` with
// `name = "ollama"`. User-state: the model picked in Settings is
// a paid-tier Ollama Cloud model the user's account doesn't
// cover. The UI surfaces an actionable upgrade link in the
// remediation message itself.
"requires a subscription, upgrade for access",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Run formatter to unblock CI.

cargo fmt --check and pnpm format:check are failing for this file, so this PR is currently blocked. Please run pnpm format and commit the formatter output.

As per coding guidelines **/*.{ts,tsx,rs,json,js}: “Run pnpm format … before committing; pnpm format:check … must pass in CI.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/inference/provider/config_rejection.rs` around lines 170 - 192,
Run the project's formatter and commit the changes so CI passes: execute pnpm
format (which runs rustfmt/prettier) and ensure cargo fmt has formatted Rust
files; then add and commit the updated file containing the string entries
"thinking mode must be passed back" and "requires a subscription, upgrade for
access" so pnpm format:check and cargo fmt --check succeed in CI.

@sanil-23 sanil-23 self-assigned this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. sentry-traced-bug Bug identified via Sentry triage working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants