fix(observability): classify backend 4xx as BackendUserError (OPENHUMAN-TAURI-BC)#1676
Conversation
…AN-TAURI-BC) The integrations / composio backend clients reported every non-2xx response through bare `report_error`, so a 4xx user-input failure (here: SharePoint authorize 400 because the user didn't fill in the required Tenant Name field — Composio slug `ConnectedAccount_MissingRequiredFields`) fired a Sentry event Sentry has no signal to act on — the request was malformed by the user's input, not by our code; the UI already toasts the structured backend error. Adds an `ExpectedErrorKind::BackendUserError` variant matching the canonical `"Backend returned <status>"` wire shape produced by `IntegrationClient::post`/`get` and `ComposioClient::delete`. The classifier covers 4xx (except 408/429, which are transient and stay actionable via the existing path or sustained-rate-limit surfacing). 5xx remains actionable — server bugs should reach Sentry. The three call sites switch from `report_error` to `report_error_or_expected`. Tests pin both directions: - `classifies_backend_user_error_responses`: 400/401/403/404/422/451 and the exact OPENHUMAN-TAURI-BC wire shape classify as BackendUserError - `does_not_classify_transient_or_server_backend_errors_as_user_error`: 408/429/500/502/503/504 do **not** classify (preserves OPENHUMAN-TAURI-8M intent for sustained outages and rate-limit cliffs) - `post_400_user_input_failure_classifies_as_backend_user_error`: HTTP-driven regression — bail message from `IntegrationClient::post` classifies, locking the format string to the classifier match - `post_500_remains_actionable`: 5xx bail message does not classify Fixes OPENHUMAN-TAURI-BC
|
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)
📝 WalkthroughWalkthroughAdds ChangesBackend user-error classification and observability routing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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 |
…PENHUMAN-TAURI-BC) Resolved merge conflicts in src/core/observability.rs and src/openhuman/integrations/client.rs, incorporating the LocalAiCapabilityUnavailable classifier and TRANSIENT_HTTP_STATUSES/TRANSIENT_TRANSPORT_PHRASES constants from main alongside the PR's BackendUserError classification. All 466 related unit tests pass (30 observability, 69 integrations, 367 composio). cargo check clean on both core and Tauri shell crates.
|
pr-manager update (automated) Merge conflicts in Quality suite results:
Note: This branch is on |
…AN-TAURI-BC) (tinyhumansai#1676) Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
Summary
ExpectedErrorKind::BackendUserErrorvariant matching the canonical wire shape"Backend returned <status> ..."produced byIntegrationClient::post/getandComposioClient::delete.src/openhuman/integrations/client.rs::post,::get,src/openhuman/composio/client.rs::delete— from rawreport_errortoreport_error_or_expectedso the classifier suppresses user-input / auth-state shapes.Why
OPENHUMAN-TAURI-BC: a user submitted SharePoint authorize without the required Tenant Name field. Composio correctly returned
400 ConnectedAccount_MissingRequiredFields, the UI surfaced the structured error to the user via toast, but the integrations client still fired a Sentry event with no remediation path — the request was malformed by the user's input, not by our code.Per the established "surface the deeper fix" rule:
Mirrors the existing
NetworkUnreachable(OPENHUMAN-TAURI-32) andTransientUpstreamHttp(OPENHUMAN-TAURI-5Z) skips — both wire user-environment shapes through the samereport_error_or_expectedpath.Fixes OPENHUMAN-TAURI-BC
Test plan
Summary by CodeRabbit
Bug Fixes
Tests