Skip to content

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

refactor(observability): update error classification to use new provider module paths

Steven Enamakel4465aad8a86b
diff --git a/crates/openhuman-core/src/core/observability.rs b/crates/openhuman-core/src/core/observability.rs
index de91ef0373..b0d506fac4 100644
--- a/crates/openhuman-core/src/core/observability.rs
+++ b/crates/openhuman-core/src/core/observability.rs
@@ -102,7 +102,7 @@ pub enum ExpectedErrorKind {
/// tier alias leaked to a provider that only speaks its native ids
/// (#2079), an unknown / stale model pin (#2202), or a model-specific
/// temperature constraint (#2076 — Moonshot Kimi K2). The provider
- /// HTTP layer (`providers::ops::api_error`) already demotes its own
+ /// HTTP layer (`provider::http_error::api_error`) already demotes its own
/// per-attempt event; this catches the *re-report* when the same
/// error is raised again by `agent.run_single` /
/// `web_channel.run_chat_task` under `domain=agent` / `web_channel`.
@@ -911,7 +911,7 @@ fn is_embedding_model_rejected(lower: &str) -> bool {
/// The canonical OpenHuman session-expired wire shapes:
///
/// - `"OpenHuman API error (401 Unauthorized): {…\"Session expired. Please
-/// log in again.\"…}"` — emitted by `providers::ops::api_error` from the
+/// log in again.\"…}"` — emitted by `provider::http_error::api_error` from the
/// OpenHuman backend and re-raised through `agent::run_single` /
/// `web_chat::run_chat_task` (OPENHUMAN-TAURI-26). The
/// `"session expired"` substring anchors the match to the OpenHuman
@@ -1388,7 +1388,7 @@ fn is_channel_supervisor_restart_message(lower: &str) -> bool {
/// scheduler tick handlers — under a different `domain` tag, escaping the
/// provider-scoped filter and producing one Sentry event per failed turn.
///
-/// The canonical wire format from `providers::ops::api_error` is:
+/// The canonical wire format from `provider::http_error::api_error` is:
/// `"<provider> API error (<status>): <sanitized>"` — e.g.
/// `"OpenHuman API error (504 Gateway Timeout): error code: 504"`. Pin the
/// match to that exact `"api error (<status>"` prefix so an unrelated message
diff --git a/crates/openhuman-core/src/core/observability_error_classification_network_tests.rs b/crates/openhuman-core/src/core/observability_error_classification_network_tests.rs
index 573d208f17..d38f1f4946 100644
--- a/crates/openhuman-core/src/core/observability_error_classification_network_tests.rs
+++ b/crates/openhuman-core/src/core/observability_error_classification_network_tests.rs
@@ -263,7 +263,7 @@ fn wrong_http_version_anchor_does_not_silence_unrelated_log_lines() {
#[test]
fn classifies_transient_upstream_http_errors() {
// OPENHUMAN-TAURI-5Z: the canonical shape emitted by
- // `providers::ops::api_error` and re-raised through `agent.run_single`.
+ // `provider::http_error::api_error` and re-raised through `agent.run_single`.
assert_eq!(
expected_error_kind("OpenHuman API error (504 Gateway Timeout): error code: 504"),
Some(ExpectedErrorKind::TransientUpstreamHttp)
@@ -440,7 +440,7 @@ fn channels_dispatch_re_emit_of_provider_502_classifies_as_transient() {
//
// The wrapping shape at the dispatch site is the agent error
// chain rendered via `format!("{e:#}")`. For a backend 502 from
- // `providers::ops::api_error`, that resolves to:
+ // `provider::http_error::api_error`, that resolves to:
// "OpenHuman API error (502 Bad Gateway): error code: 502"
// possibly prepended with a runner / iteration prefix. Both
// shapes must classify as transient so the dispatch re-emit
diff --git a/crates/openhuman-core/src/core/observability_error_classification_session_tests.rs b/crates/openhuman-core/src/core/observability_error_classification_session_tests.rs
index 03786d30c0..1366d37f59 100644
--- a/crates/openhuman-core/src/core/observability_error_classification_session_tests.rs
+++ b/crates/openhuman-core/src/core/observability_error_classification_session_tests.rs
@@ -3,7 +3,7 @@ use super::*;
#[test]
fn couples_list_models_404_source_shape_to_classifier() {
// TAURI-RUST-8X3 coupling guard. Ties the TYPED SOURCE error shape
- // emitted by `inference/provider/ops/models.rs` (the
+ // emitted by `inference/provider/models/catalog_listing.rs` (the
// `provider returned 404: <body>` format) to the classifier, so a
// wording / prefix drift fails CI instead of silently leaking events.
//
diff --git a/crates/openhuman-core/src/inference/ops_tests.rs b/crates/openhuman-core/src/inference/ops_tests.rs
index 8d002b85b7..b0f3b88180 100644
--- a/crates/openhuman-core/src/inference/ops_tests.rs
+++ b/crates/openhuman-core/src/inference/ops_tests.rs
@@ -258,7 +258,7 @@ async fn inference_openai_oauth_disconnect_returns_removed_flag() {
// ── is_unknown_provider_user_config (TAURI-RUST-X) ───────────────────────
//
-// `inference_list_models` calls `providers::ops::list_configured_models`,
+// `inference_list_models` calls `provider::models::catalog_listing::list_configured_models`,
// which surfaces a `String` error when the user-selected provider id isn't
// registered in the cloud-provider list (e.g. picking "ollama" — a local
// runtime — as a cloud provider). The error string is emitted at