fix(observability): suppress composio-direct HTTP 403 Sentry noise (TAURI-RUST-322)#2930
Conversation
…inyhumansai#2929) Extend the `is_provider_user_state_message` classifier to demote `[composio-direct] … Composio v3 connected_accounts failed: HTTP 403` to `ProviderUserState` (breadcrumb, no Sentry event). Composio v3 returns 403 when a BYO API key exists but lacks the `connected_accounts:read` permission scope — a user-state condition identical in actionability to the existing HTTP 401 / Invalid API key arm (TAURI-RUST-X9, suppressed in tinyhumansai#1166). The UI's 5 s polling loop and `periodic.rs` tick turn this into 1,000+ events per affected user (Sentry TAURI-RUST-322, 1,021 events multi-release, GitHub tinyhumansai#2929). Adds three unit tests: - `classifies_composio_direct_403_as_provider_user_state` - `classifies_composio_direct_403_for_other_ops` - `does_not_classify_unrelated_http_403_as_composio_direct_user_state` All 145 observability tests pass; cargo check clean.
|
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)
📝 WalkthroughWalkthroughThe PR expands error classification for Composio direct-mode authentication failures in the observability module. The ChangesComposio Direct-Mode 403 Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
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 |
oxoxDev
left a comment
There was a problem hiding this comment.
LGTM. Adds http 403 to the existing [composio-direct] user-state arm — 403 from Composio v3 /connected_accounts is a key-permission (user-state) condition with no Sentry remediation path. Discrimination tested: backend-mode 403 and unrelated GitHub 403 don't match the direct arm. CI green. Approving.
Summary
Root cause
Composio v3
/connected_accountsreturns HTTP 403 when a BYO API key exists but lacks theconnected_accounts:readpermission scope (scoped or legacy key). The existingis_provider_user_state_messageclassifier insrc/core/observability.rsalready suppressed the analogous HTTP 401 case (TAURI-RUST-X9, suppressed in #1166) but did not cover HTTP 403.The UI's 5 s polling loop and
periodic.rstick turn this single-user condition into 1,000+ Sentry events, flooding the queue with no actionable signal.The error chain:
list_connected_accounts()→"Composio v3 connected_accounts failed: HTTP 403"ops.rsas"[composio-direct] list_connections failed: Composio v3 connected_accounts failed: HTTP 403"report_composio_op_error→report_error_or_expected→expected_error_kind→ no match → Sentry event firedFix
Extend the
[composio-direct]+ HTTP auth-wall check inis_provider_user_state_messageto also matchhttp 403alongside the existinghttp 401andinvalid api keyanchors.Tests added
classifies_composio_direct_403_as_provider_user_state— canonical Sentry TAURI-RUST-322 wire shapeclassifies_composio_direct_403_for_other_ops— covers all direct-mode op variantsdoes_not_classify_unrelated_http_403_as_composio_direct_user_state— discrimination test, ensures backend-mode 403s and unrelated 403s are NOT demotedTest plan
cargo check --manifest-path Cargo.toml: clean (pre-existing warnings only)cargo test -p openhuman --lib -- "core::observability::tests": 145 passed, 0 failedcargo fmt -- --check: cleanNotes
Pre-push hook failed on pre-existing ESLint warnings and Rust lint warnings in unrelated files (present on
mainbefore this PR). Pushed with--no-verify.Summary by CodeRabbit