The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(observability): classify the backend error code from the raw message
M3gA-Mindf589b918d415
diff --git a/crates/openhuman-core/src/core/observability_reporting.rs b/crates/openhuman-core/src/core/observability_reporting.rsindex b41e587634..e33cce8e2f 100644--- a/crates/openhuman-core/src/core/observability_reporting.rs+++ b/crates/openhuman-core/src/core/observability_reporting.rs@@ -48,7 +48,8 @@ pub fn report_error_or_expected<E: Display + ?Sized>(fn report_expected_message(kind: ExpectedErrorKind, message: &str, domain: &str, operation: &str) {// Same redaction as `report_error_message`: these lines reach the log// sinks (and Sentry breadcrumbs) too. Classification ran on the raw text.- let scrubbed = crate::core::log_redaction::scrub_secrets(message);+ let raw = message;+ let scrubbed = crate::core::log_redaction::scrub_secrets(raw);let message = scrubbed.as_str();match kind {ExpectedErrorKind::LocalAiDisabled => {@@ -448,7 +449,8 @@ fn report_expected_message(kind: ExpectedErrorKind, message: &str, domain: &str,ExpectedErrorKind::BackendErrorCodeOwned => {// The classifier's canonical token aids triage without re-parsing// provider-specific strings in this generic module.- let code = crate::inference::registry::classify_backend_error(None, message)+ // Classify the raw text: scrubbing can swallow the code next to a secret.+ let code = crate::inference::registry::classify_backend_error(None, raw).and_then(|classification| classification.token).unwrap_or_default();tracing::warn!(diff --git a/crates/openhuman-core/src/core/observability_tests.rs b/crates/openhuman-core/src/core/observability_tests.rsindex 1d36f9609a..c1d7a69778 100644--- a/crates/openhuman-core/src/core/observability_tests.rs+++ b/crates/openhuman-core/src/core/observability_tests.rs@@ -180,3 +180,26 @@ fn expected_and_reported_errors_are_logged_scrubbed() {"{reported}");}++#[test]+fn a_backend_error_code_survives_a_secret_in_the_message() {+ let body = "OpenHuman API error (400): {\"error\":{\"message\":\"bad Bearer sekrit-value\",\"errorCode\":\"x\"}}";+ register_backend_classifier_fixture(+ body,+ BackendErrorClassification {+ provider_owned: true,+ backend_owned: true,+ reportable: false,+ token: Some("fixture-owned".to_string()),+ kind: Some(BackendErrorKind::Internal),+ malformed_bad_request: false,+ },+ );+ assert_eq!(+ expected_error_kind(body),+ Some(ExpectedErrorKind::BackendErrorCodeOwned)+ );+ let logs = captured_logs(|| report_error_or_expected(&body, "d", "o", &[]));+ assert!(logs.contains("errorCode=fixture-owned"), "{logs}");+ assert!(!logs.contains("sekrit"), "{logs}");+}