Skip to content

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

refactor: update module paths after ops re-exports removed

Steven Enamakelaa32f54744ff
diff --git a/crates/openhuman-core/src/agent_runs/schemas.rs b/crates/openhuman-core/src/agent_runs/schemas.rs
index 7b6e4e2080..d1980230c6 100644
--- a/crates/openhuman-core/src/agent_runs/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/schemas.rs
@@ -265,7 +265,7 @@ fn handle_chat(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
let p = deserialize_params::<AgentChatParams>(params)?;
let mut config = ctx.load_config().await?;
to_json(
- crate::inference::host_runtime::rpc::agent_chat(
+ crate::inference::host_runtime::ops::agent_chat(
&mut config,
&p.message,
p.model_override,
@@ -288,7 +288,7 @@ fn handle_chat_simple(ctx: DispatchCtx, params: Map<String, Value>) -> Controlle
let p = deserialize_params::<AgentChatParams>(params)?;
let config = ctx.load_config().await?;
to_json(
- crate::inference::host_runtime::rpc::agent_chat_simple(
+ crate::inference::host_runtime::ops::agent_chat_simple(
&ctx,
&config,
&p.message,
diff --git a/crates/openhuman-core/src/channels/runtime/startup/chat_workload.rs b/crates/openhuman-core/src/channels/runtime/startup/chat_workload.rs
index c271aa90b5..d3f801657a 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/chat_workload.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/chat_workload.rs
@@ -24,7 +24,7 @@ pub(super) enum ChatWorkloadResolution {
pub(super) fn resolve_chat_workload(config: &Config) -> ChatWorkloadResolution {
let resolved = provider::provider_for_role("chat", config);
let trimmed = resolved.trim();
- if trimmed.is_empty() || trimmed == "cloud" || trimmed == provider::INFERENCE_BACKEND_ID {
+ if trimmed.is_empty() || trimmed == "cloud" || trimmed == provider::factory::INFERENCE_BACKEND_ID {
return ChatWorkloadResolution::Cloud;
}
let slug = trimmed
diff --git a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs
index 0c07dd58ab..21bf24faa2 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs
@@ -112,7 +112,7 @@ pub(crate) fn build_channel_turn_parts(
config,
config.default_temperature,
)?;
- (model, provider::INFERENCE_BACKEND_ID.to_string())
+ (model, provider::factory::INFERENCE_BACKEND_ID.to_string())
}
ChatWorkloadResolution::Workload {
provider_string,
diff --git a/crates/openhuman-core/src/config/mod.rs b/crates/openhuman-core/src/config/mod.rs
index b58926774d..27d7f17e37 100644
--- a/crates/openhuman-core/src/config/mod.rs
+++ b/crates/openhuman-core/src/config/mod.rs
@@ -25,7 +25,7 @@ pub use enrichers::{
};
/// RPC operations for configuration.
-pub use ops as rpc;
+
pub use ops::*;
pub use schema::{
diff --git a/crates/openhuman-core/src/config/schema/memory.rs b/crates/openhuman-core/src/config/schema/memory.rs
index 12c127888c..093b972665 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
-/// `embeddings::cloud::DEFAULT_CLOUD_EMBEDDING_MODEL`.
+/// `inference::embedding_host::DEFAULT_CLOUD_EMBEDDING_MODEL`.
pub const DEFAULT_EMBEDDING_MODEL: &str = "embedding-v1";
/// Default `embedding_dimensions`; keep in sync with
-/// `embeddings::cloud::DEFAULT_CLOUD_EMBEDDING_DIMENSIONS`.
+/// `inference::embedding_host::DEFAULT_CLOUD_EMBEDDING_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/cron/mod.rs b/crates/openhuman-core/src/cron/mod.rs
index aa6656ca6e..a53eaf3aa6 100644
--- a/crates/openhuman-core/src/cron/mod.rs
+++ b/crates/openhuman-core/src/cron/mod.rs
@@ -37,7 +37,7 @@ pub mod scheduler;
#[path = "cutover_tests.rs"]
mod cutover_tests;
-pub use ops as rpc;
+
#[cfg(test)]
pub use ops::update_cron_job;
pub use ops::{add_once, add_once_at, pause_job, resume_job};
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs b/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs
index 343f3e3b79..cefb0f90d0 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs
@@ -115,7 +115,7 @@ pub(super) async fn build_runtime_snapshot(config: &Config, req_id: u64) -> Runt
let t = Instant::now();
let status = match tokio::time::timeout(
SNAPSHOT_SUB_OP_TIMEOUT,
- crate::inference::rpc::inference_status(&config_for_local_ai),
+ crate::inference::ops::inference_status(&config_for_local_ai),
)
.await
{
diff --git a/crates/openhuman-core/src/inference/embedding_host/mod.rs b/crates/openhuman-core/src/inference/embedding_host/mod.rs
index ff86e620f8..6baee7378d 100644
--- a/crates/openhuman-core/src/inference/embedding_host/mod.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/mod.rs
@@ -20,7 +20,7 @@ mod rpc;
mod schemas;
pub use cloud::{
- UnavailableEmbeddingModel, DEFAULT_CLOUD_EMBEDDING_DIMENSIONS, DEFAULT_CLOUD_EMBEDDING_MODEL,
+ UnavailableEmbeddingModel,
};
pub use factory::{
create_embedding_provider_for_chat, create_embedding_provider_with_config,
diff --git a/crates/openhuman-core/src/inference/embedding_host/schemas.rs b/crates/openhuman-core/src/inference/embedding_host/schemas.rs
index 53643e5c73..f496638c38 100644
--- a/crates/openhuman-core/src/inference/embedding_host/schemas.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/schemas.rs
@@ -264,15 +264,6 @@ fn optional_string(name: &'static str, comment: &'static str) -> FieldSchema {
}
}
-fn optional_bool(name: &'static str, comment: &'static str) -> FieldSchema {
- FieldSchema {
- name,
- ty: TypeSchema::Option(Box::new(TypeSchema::Bool)),
- comment,
- required: false,
- }
-}
-
fn optional_u64(name: &'static str, comment: &'static str) -> FieldSchema {
FieldSchema {
name,
diff --git a/crates/openhuman-core/src/inference/host_runtime/mod.rs b/crates/openhuman-core/src/inference/host_runtime/mod.rs
index f8e4b40b4c..675baf026a 100644
--- a/crates/openhuman-core/src/inference/host_runtime/mod.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/mod.rs
@@ -30,7 +30,7 @@ mod schemas;
pub mod service;
pub use core::*;
-pub use ops as rpc;
+
pub use ops::*;
pub use schemas::{
all_controller_schemas as all_local_inference_controller_schemas,
diff --git a/crates/openhuman-core/src/inference/mod.rs b/crates/openhuman-core/src/inference/mod.rs
index e1abc33ec8..b9c592d48e 100644
--- a/crates/openhuman-core/src/inference/mod.rs
+++ b/crates/openhuman-core/src/inference/mod.rs
@@ -38,7 +38,7 @@ mod schemas;
pub mod tokenjuice;
pub mod turn_models;
-pub use ops as rpc;
+
pub use schemas::{
all_controller_schemas as all_inference_controller_schemas,
all_registered_controllers as all_inference_registered_controllers, INFERENCE_AGENT_CHAT,
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
index 2c1258e477..2b8c3eccfe 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
@@ -65,7 +65,7 @@ pub(super) fn resolve_cloud_slug<'a>(
// ignoring whatever effective_model we computed here.
if entry.auth_style != AuthStyle::OpenhumanJwt && effective_model.trim().is_empty() {
log::warn!(
- "[nvidia-nim][chat-factory] role={} slug={} resolved to empty model — \
+ "[providers][chat-factory] role={} slug={} resolved to empty model — \
provider string must include a model id (e.g. '{}:<model-id>') or \
set default_model on the cloud_providers entry",
role,
diff --git a/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs b/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs
index 440e323fa0..1f8e8b5bef 100644
--- a/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs
@@ -20,7 +20,7 @@ pub(super) fn handle_inference_openai_oauth_start(
) -> ControllerFuture {
Box::pin(async move {
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_openai_oauth_start(&config).await?)
+ to_json(crate::inference::ops::inference_openai_oauth_start(&config).await?)
})
}
@@ -32,7 +32,7 @@ pub(super) fn handle_inference_openai_oauth_complete(
let config = ctx.load_config().await?;
let payload = deserialize_params::<InferenceOpenAiOAuthCompleteParams>(params)?;
to_json(
- crate::inference::rpc::inference_openai_oauth_complete(
+ crate::inference::ops::inference_openai_oauth_complete(
&config,
payload.callback_url.trim(),
)
@@ -47,7 +47,7 @@ pub(super) fn handle_inference_openai_oauth_import_codex_cli(
) -> ControllerFuture {
Box::pin(async move {
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_openai_oauth_import_codex_cli(&config).await?)
+ to_json(crate::inference::ops::inference_openai_oauth_import_codex_cli(&config).await?)
})
}
@@ -57,7 +57,7 @@ pub(super) fn handle_inference_openai_oauth_status(
) -> ControllerFuture {
Box::pin(async move {
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_openai_oauth_status(&config).await?)
+ to_json(crate::inference::ops::inference_openai_oauth_status(&config).await?)
})
}
@@ -67,6 +67,6 @@ pub(super) fn handle_inference_openai_oauth_disconnect(
) -> ControllerFuture {
Box::pin(async move {
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_openai_oauth_disconnect(&config).await?)
+ to_json(crate::inference::ops::inference_openai_oauth_disconnect(&config).await?)
})
}
diff --git a/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs b/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
index a51107e304..64edee4208 100644
--- a/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
@@ -47,7 +47,7 @@ pub(super) fn handle_inference_summarize(
Box::pin(async move {
let p = deserialize_params::<InferenceSummarizeParams>(params)?;
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_summarize(&config, &p.text, p.max_tokens).await?)
+ to_json(crate::inference::ops::inference_summarize(&config, &p.text, p.max_tokens).await?)
})
}
@@ -59,7 +59,7 @@ pub(super) fn handle_inference_prompt(
let p = deserialize_params::<InferencePromptParams>(params)?;
let config = ctx.load_config().await?;
to_json(
- crate::inference::rpc::inference_prompt(&config, &p.prompt, p.max_tokens, p.no_think)
+ crate::inference::ops::inference_prompt(&config, &p.prompt, p.max_tokens, p.no_think)
.await?,
)
})
@@ -73,7 +73,7 @@ pub(super) fn handle_inference_vision_prompt(
let p = deserialize_params::<InferenceVisionPromptParams>(params)?;
let config = ctx.load_config().await?;
to_json(
- crate::inference::rpc::inference_vision_prompt(
+ crate::inference::ops::inference_vision_prompt(
&config,
&p.prompt,
&p.image_refs,
@@ -92,7 +92,7 @@ pub(super) fn handle_inference_test_provider_model(
let p = deserialize_params::<InferenceTestChatModelParams>(params)?;
let config = ctx.load_config().await?;
to_json(
- crate::inference::rpc::inference_test_provider_model(
+ crate::inference::ops::inference_test_provider_model(
&config,
&p.workload,
&p.provider,
@@ -110,6 +110,6 @@ pub(super) fn handle_inference_analyze_sentiment(
Box::pin(async move {
let p = deserialize_params::<InferenceAnalyzeSentimentParams>(params)?;
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_analyze_sentiment(&config, &p.message).await?)
+ to_json(crate::inference::ops::inference_analyze_sentiment(&config, &p.message).await?)
})
}
diff --git a/crates/openhuman-core/src/inference/schemas/settings_handlers.rs b/crates/openhuman-core/src/inference/schemas/settings_handlers.rs
index 127e93b7e1..3e8e7505f9 100644
--- a/crates/openhuman-core/src/inference/schemas/settings_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/settings_handlers.rs
@@ -110,7 +110,7 @@ pub(super) fn handle_inference_status(
) -> ControllerFuture {
Box::pin(async move {
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_status(&config).await?)
+ to_json(crate::inference::ops::inference_status(&config).await?)
})
}
@@ -119,7 +119,7 @@ pub(super) fn handle_inference_get_client_config(
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(
- async move { to_json(crate::inference::rpc::inference_get_client_config(&ctx).await?) },
+ async move { to_json(crate::inference::ops::inference_get_client_config(&ctx).await?) },
)
}
@@ -257,7 +257,7 @@ pub(super) fn handle_inference_update_model_settings(
memory_provider: update.memory_provider,
embeddings_provider: update.embeddings_provider,
};
- to_json(crate::inference::rpc::inference_update_model_settings(&ctx, patch).await?)
+ to_json(crate::inference::ops::inference_update_model_settings(&ctx, patch).await?)
})
}
@@ -283,7 +283,7 @@ pub(super) fn handle_inference_update_local_settings(
usage_embeddings: update.usage_embeddings,
api_key: update.api_key,
};
- to_json(crate::inference::rpc::inference_update_local_settings(&ctx, patch).await?)
+ to_json(crate::inference::ops::inference_update_local_settings(&ctx, patch).await?)
})
}
@@ -293,7 +293,7 @@ pub(super) fn handle_inference_list_models(
) -> ControllerFuture {
Box::pin(async move {
let request = deserialize_params::<InferenceListModelsParams>(params)?;
- to_json(crate::inference::rpc::inference_list_models(&request.provider_id).await?)
+ to_json(crate::inference::ops::inference_list_models(&request.provider_id).await?)
})
}
@@ -301,7 +301,7 @@ pub(super) fn handle_inference_provider_auth_errors(
_ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
- Box::pin(async move { to_json(crate::inference::rpc::inference_provider_auth_errors().await?) })
+ Box::pin(async move { to_json(crate::inference::ops::inference_provider_auth_errors().await?) })
}
pub(super) fn handle_inference_diagnostics(
@@ -310,7 +310,7 @@ pub(super) fn handle_inference_diagnostics(
) -> ControllerFuture {
Box::pin(async move {
let config = ctx.load_config().await?;
- to_json(crate::inference::rpc::inference_diagnostics(&config).await?)
+ to_json(crate::inference::ops::inference_diagnostics(&config).await?)
})
}
diff --git a/crates/openhuman-core/src/inference/tokenjuice/tools.rs b/crates/openhuman-core/src/inference/tokenjuice/tools.rs
index e757e6e143..c9de658558 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/tools.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/tools.rs
@@ -2,7 +2,7 @@
//!
//! The content router may replace a large tool result with a compacted view and
//! a `⟦tj:<hash>⟧` marker, stashing the original in the CCR store
-//! ([`crate::inference::tokenjuice::cache::store`]). This tool hands the
+//! ([`crate::inference::tokenjuice::store`]). This tool hands the
//! original back on demand — fully or by a byte/line range — so even lossy
//! compaction stays reversible.
//!
diff --git a/crates/openhuman-core/src/platform/doctor/mod.rs b/crates/openhuman-core/src/platform/doctor/mod.rs
index 3bc8afafbe..79810850bf 100644
--- a/crates/openhuman-core/src/platform/doctor/mod.rs
+++ b/crates/openhuman-core/src/platform/doctor/mod.rs
@@ -6,7 +6,7 @@ mod schemas;
pub mod tools;
pub use core::*;
-pub use ops as rpc;
+
pub use ops::*;
pub use schemas::{
all_controller_schemas as all_doctor_controller_schemas,
diff --git a/crates/openhuman-core/src/platform/health/mod.rs b/crates/openhuman-core/src/platform/health/mod.rs
index aa7bc9805b..ec4c3181a9 100644
--- a/crates/openhuman-core/src/platform/health/mod.rs
+++ b/crates/openhuman-core/src/platform/health/mod.rs
@@ -5,7 +5,7 @@ mod schemas;
pub mod tools;
pub use core::*;
-pub use ops as rpc;
+
pub use ops::*;
pub use schemas::{
all_controller_schemas as all_health_controller_schemas,
diff --git a/crates/openhuman-core/src/platform/service/mod.rs b/crates/openhuman-core/src/platform/service/mod.rs
index 19b6cd8308..99afca1c76 100644
--- a/crates/openhuman-core/src/platform/service/mod.rs
+++ b/crates/openhuman-core/src/platform/service/mod.rs
@@ -20,7 +20,7 @@ pub(crate) mod mock;
mod windows;
pub use core::*;
-pub use ops as rpc;
+
pub use ops::*;
pub use restart::apply_startup_restart_delay_from_env;
pub use restart::RestartStatus;
diff --git a/crates/openhuman-core/src/platform/update/mod.rs b/crates/openhuman-core/src/platform/update/mod.rs
index a5986d63fe..d53d6b0524 100644
--- a/crates/openhuman-core/src/platform/update/mod.rs
+++ b/crates/openhuman-core/src/platform/update/mod.rs
@@ -5,7 +5,7 @@ mod schemas;
mod types;
pub use self::core::*;
-pub use ops as rpc;
+
pub use schemas::{
all_controller_schemas as all_update_controller_schemas,
all_registered_controllers as all_update_registered_controllers,
diff --git a/crates/openhuman-core/src/security/credentials/mod.rs b/crates/openhuman-core/src/security/credentials/mod.rs
index 30fe16ae91..24386b0a68 100644
--- a/crates/openhuman-core/src/security/credentials/mod.rs
+++ b/crates/openhuman-core/src/security/credentials/mod.rs
@@ -22,7 +22,7 @@ pub use http_creds::{
HttpCredential, HttpCredentialScheme, HttpCredentialSummary, HttpCredentialsStore,
};
pub use jwt::user_id_from_profile_payload;
-pub use ops as rpc;
+
pub use ops::*;
// Direct-mode (BYO Composio API key) credential helpers.
pub use ops::{
diff --git a/crates/openhuman-core/src/security/encryption/mod.rs b/crates/openhuman-core/src/security/encryption/mod.rs
index f12c1e0dc0..b992914600 100644
--- a/crates/openhuman-core/src/security/encryption/mod.rs
+++ b/crates/openhuman-core/src/security/encryption/mod.rs
@@ -9,7 +9,7 @@ pub mod ops;
mod schemas;
pub use core::*;
-pub use ops as rpc;
+
pub use ops::*;
pub use schemas::{
all_controller_schemas as all_encryption_controller_schemas,
diff --git a/crates/openhuman-core/src/security/mod.rs b/crates/openhuman-core/src/security/mod.rs
index 949a34c14a..2a74a92e47 100644
--- a/crates/openhuman-core/src/security/mod.rs
+++ b/crates/openhuman-core/src/security/mod.rs
@@ -38,7 +38,7 @@ pub use egress::{
emit_external_transfer, enforce_egress, local_only_blocks, local_only_tool_block, DataKind,
EgressDescriptor, EgressReason, IdentificationRisk,
};
-pub use ops as rpc;
+
pub use ops::*;
pub use policy::validate_path_within_root;
#[allow(unused_imports)]
diff --git a/crates/openhuman-core/src/triage/routing.rs b/crates/openhuman-core/src/triage/routing.rs
index facf24341f..58ff120e1d 100644
--- a/crates/openhuman-core/src/triage/routing.rs
+++ b/crates/openhuman-core/src/triage/routing.rs
@@ -12,7 +12,7 @@
use std::sync::Arc;
use crate::config::Config;
-use crate::inference::provider::{self, INFERENCE_BACKEND_ID};
+use crate::inference::provider::{self, factory::INFERENCE_BACKEND_ID};
/// Workload role every triage arm runs under. Triage classification is a
/// short chat-shaped call, so it follows the user's `chat` route.