Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(core): simplify backend error code extraction

Steven Enamakel94ca3e32fe62
diff --git a/crates/openhuman-core/src/core/observability.rs b/crates/openhuman-core/src/core/observability.rs
index c8bb157efa..7f349d5c46 100644
--- a/crates/openhuman-core/src/core/observability.rs
+++ b/crates/openhuman-core/src/core/observability.rs
@@ -2297,12 +2297,9 @@ 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 classification = crate::inference::registry::classify_backend_error(None, message);
- let code = classification
- .as_ref()
- .and_then(|classification| classification.token.as_deref())
- .unwrap_or_default()
- .to_string();
+ let code = crate::inference::registry::classify_backend_error(None, message)
+ .and_then(|classification| classification.token)
+ .unwrap_or_default();
tracing::warn!(
domain = domain,
operation = operation,