Skip to content

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

chore(core): update stale doc references and add doctor model tests

Steven Enamakeldda8ef446aa6
diff --git a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
index c72e46610d..a7e41449df 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
@@ -7,7 +7,6 @@ use super::super::Channel;
use super::common::{use_real_agent_handler, RecordingChannel, SlowModel};
use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};
use crate::core::events::DomainEvent;
-use crate::inference::provider;
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
diff --git a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
index de30fd662d..752e7f76d0 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
@@ -8,7 +8,6 @@ use super::common::{
IterativeToolModel, MockPriceTool, ModelCaptureModel, RecordingChannel,
TelegramRecordingChannel, ToolCallingModel,
};
-use crate::inference::provider;
use std::collections::HashMap;
use std::sync::atomic::Ordering;
use std::sync::{Arc, Mutex};
diff --git a/crates/openhuman-core/src/config/schema/memory.rs b/crates/openhuman-core/src/config/schema/memory.rs
index 093b972665..ad5b49d055 100644
--- a/crates/openhuman-core/src/config/schema/memory.rs
+++ b/crates/openhuman-core/src/config/schema/memory.rs
@@ -205,10 +205,10 @@ pub struct MemoryAgentConfig {
/// Default `embedding_provider`: the OpenHuman backend (Voyage-backed).
pub const DEFAULT_EMBEDDING_PROVIDER: &str = "cloud";
/// Default `embedding_model`; keep in sync with
-/// `inference::embedding_host::DEFAULT_CLOUD_EMBEDDING_MODEL`.
+/// `tinyinference_embeddings::DEFAULT_CLOUD_MODEL`.
pub const DEFAULT_EMBEDDING_MODEL: &str = "embedding-v1";
/// Default `embedding_dimensions`; keep in sync with
-/// `inference::embedding_host::DEFAULT_CLOUD_EMBEDDING_DIMENSIONS`.
+/// `tinyinference_embeddings::DEFAULT_CLOUD_DIMENSIONS`.
pub const DEFAULT_EMBEDDING_DIMENSIONS: usize = 1024;
/// Default `embedding_rate_limit_per_min` (cloud backends cap ~60/min).
pub const DEFAULT_EMBEDDING_RATE_LIMIT_PER_MIN: u32 = 60;
diff --git a/crates/openhuman-core/src/core/observability.rs b/crates/openhuman-core/src/core/observability.rs
index b0d506fac4..1b56e8b494 100644
--- a/crates/openhuman-core/src/core/observability.rs
+++ b/crates/openhuman-core/src/core/observability.rs
@@ -1707,7 +1707,7 @@ fn is_provider_user_state_message(lower: &str) -> bool {
return true;
}
- // OPENHUMAN-TAURI-YJ: `inference/provider/models/catalog_listing.rs::list_models` probed a
+ // OPENHUMAN-TAURI-YJ: `inference/provider/models/catalog_listing.rs::list_configured_models` probed a
// user-configured custom-provider's `/models` endpoint and the upstream
// server returned 404. Wire shape emitted at `ops.rs:118-122`:
//
@@ -1727,7 +1727,7 @@ fn is_provider_user_state_message(lower: &str) -> bool {
// - 400: typically request-shape bugs in OUR client; must escalate.
// - 429 / 5xx: transient — handled by other matchers / retry policy.
//
- // No `inference/provider/models/catalog_listing.rs::list_models` other than this site emits
+ // No `inference/provider/models/catalog_listing.rs::list_configured_models` other than this site emits
// the `provider returned NNN` prefix (verified via grep), so the prefix
// alone is a sufficient anchor.
//
diff --git a/crates/openhuman-core/src/core/session_expiry.rs b/crates/openhuman-core/src/core/session_expiry.rs
index 8b40b27a73..58b3e0e623 100644
--- a/crates/openhuman-core/src/core/session_expiry.rs
+++ b/crates/openhuman-core/src/core/session_expiry.rs
@@ -20,7 +20,7 @@
/// `"GET /teams failed (401 Unauthorized): {"success":false}"`. These always
/// start with an HTTP method verb followed by a space and a forward slash.
/// - **Provider / downstream 401s** (`api_error` in
-/// `crates/openhuman-core/src/inference/provider/models/catalog_listing.rs`): formatted as
+/// `crates/openhuman-core/src/inference/provider/http_error.rs`): formatted as
/// `"{ProviderName} API error (401 Unauthorized): {body}"` or
/// `"Discord API error: ... (401): Unauthorized"`. These start with a
/// provider name, NOT an HTTP method verb.
@@ -37,7 +37,7 @@
/// - `"invalid token"` — too broad; also matches Discord / OAuth provider tokens.
///
/// Note: for inference-path OpenHuman backend 401s, `api_error` (in
-/// `inference/provider/models/catalog_listing.rs` lines 479–497) ALREADY publishes `SessionExpired`
+/// `inference/provider/http_error.rs`) ALREADY publishes `SessionExpired`
/// directly, so there is no regression if this predicate misses them — the
/// subscriber is idempotent and a harmless double-publish would still be correct.
pub fn is_session_expired_error(msg: &str) -> bool {
diff --git a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
index d788e2f154..02523251d4 100644
--- a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
+++ b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
@@ -7,8 +7,6 @@ use super::super::openai_codex::resolve_openai_codex_routing;
use super::{
local_runtime::synthesize_local_runtime_entry, openrouter::validate_openrouter_api_key,
};
-use crate::config::schema::cloud_providers::AuthStyle;
-use crate::config::Config;
use tinyinference_core::sanitize::sanitize_api_error;
use tinyinference_llm::catalog::{
append_query_param, endpoint_hosts_models_listing, is_openrouter_provider,
diff --git a/crates/openhuman-core/src/platform/doctor/core_tests.rs b/crates/openhuman-core/src/platform/doctor/core_tests.rs
index 063abcf07d..5717dfb054 100644
--- a/crates/openhuman-core/src/platform/doctor/core_tests.rs
+++ b/crates/openhuman-core/src/platform/doctor/core_tests.rs
@@ -27,6 +27,29 @@ fn model_targets_come_from_the_callers_configured_cloud_providers() {
assert_eq!(report.entries.len(), 1);
assert_eq!(report.entries[0].provider, "custom-test");
assert_eq!(report.entries[0].outcome, ModelProbeOutcome::Skipped);
+
+ let other_config = Config {
+ cloud_providers: vec![crate::config::schema::CloudProviderCreds {
+ id: "p_other_test".into(),
+ slug: "other-test".into(),
+ label: "Other Test Provider".into(),
+ endpoint: "https://other.example.test/v1".into(),
+ auth_style: crate::config::schema::AuthStyle::None,
+ default_model: None,
+ }],
+ ..Config::default()
+ };
+ let other_report = run_models(&other_config, false)
+ .expect("doctor model listing should use each call's config");
+ assert_eq!(other_report.entries.len(), 1);
+ assert_eq!(other_report.entries[0].provider, "other-test");
+}
+
+#[test]
+fn model_targets_without_configured_providers_keep_empty_error() {
+ let err = run_models(&Config::default(), false)
+ .expect_err("empty provider configuration should retain the existing error");
+ assert_eq!(err.to_string(), "No providers available for model probing");
}
#[test]