Skip to content

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

refactor(core): clean up imports and module structure

Steven Enamakel776a6a76384c
diff --git a/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs b/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs
index 92cb418ed7..eda804b12c 100644
--- a/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs
+++ b/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs
@@ -1,4 +1,3 @@
-use super::*;
use crate::channels::routes::tests::runtime_context;
use crate::core::runtime::{ContextOverlay, CoreContext, DispatchCtx, DomainSet};
use std::collections::HashMap;
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
index 7a3d963bac..3159148941 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
@@ -13,7 +13,6 @@ use crate::util::truncate_with_ellipsis;
use std::sync::Arc;
use std::time::Instant;
use tinyagents_harness::progress::AgentProgress;
-use tinychannels_bus as traits;
use tokio_util::sync::CancellationToken;
use tokio_util::task::AbortOnDropHandle;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/mod.rs b/crates/openhuman-core/src/flows/tinyflows/caps/mod.rs
index 49a8b236f3..4317362e36 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/mod.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/mod.rs
@@ -28,7 +28,6 @@ pub(crate) use prompt::*;
// The pure prompt/reply helpers live upstream, beside the agent request builder.
pub(crate) use resolver::*;
pub(crate) use tier::*;
-pub(crate) use tinyflows::caps::mock_schema_aware::*;
pub(crate) use tinyflows::nodes::integration::agent_prompt::{
build_agent_result, build_harness_run_prompt, clamp_run_timeout_secs, extract_structured_json,
prepend_system_message, resolve_node_model, resolve_run_timeout_secs,
diff --git a/crates/openhuman-core/src/modules/tinyflows.rs b/crates/openhuman-core/src/modules/tinyflows.rs
index fdafb4239f..f702eabeab 100644
--- a/crates/openhuman-core/src/modules/tinyflows.rs
+++ b/crates/openhuman-core/src/modules/tinyflows.rs
@@ -42,7 +42,7 @@ pub(crate) fn disabled_message() -> String {
#[cfg(feature = "modules")]
mod imp {
- use super::{disabled_message, HOST_BUS_NAME, MODULE_ID};
+ use super::{disabled_message, HOST_BUS_NAME};
use crate::config::Config;
#[cfg(not(test))]
use crate::modules::ops;
@@ -73,7 +73,7 @@ mod imp {
}
#[cfg(not(test))]
{
- ops::ensure_loaded(config, MODULE_ID).await
+ ops::ensure_loaded(config, super::MODULE_ID).await
}
}
diff --git a/crates/openhuman-core/src/web_chat/turn_activity.rs b/crates/openhuman-core/src/web_chat/turn_activity.rs
index c76ef87859..a9fa6dca2c 100644
--- a/crates/openhuman-core/src/web_chat/turn_activity.rs
+++ b/crates/openhuman-core/src/web_chat/turn_activity.rs
@@ -15,8 +15,7 @@ use std::sync::{Arc, Mutex};
use tinyagents_harness::progress::AgentProgress;
pub(crate) use crate::agent::turn_policy::{
- configured_idle_window, parse_idle_window, DEFAULT_IDLE_SECS as DEFAULT_TURN_IDLE_SECS,
- IDLE_ENV as TURN_IDLE_ENV,
+ configured_idle_window, parse_idle_window,
};
#[derive(Debug, Default)]
diff --git a/crates/openhuman-core/src/web_chat/turn_host.rs b/crates/openhuman-core/src/web_chat/turn_host.rs
index 99cd574f02..b5e449e629 100644
--- a/crates/openhuman-core/src/web_chat/turn_host.rs
+++ b/crates/openhuman-core/src/web_chat/turn_host.rs
@@ -37,7 +37,7 @@ use super::web_errors::{
inference_budget_exceeded_user_message, is_inference_budget_exceeded_error,
};
use crate::agent::queued_turn::QueuedPayload;
-use crate::agent::turn_origin::{with_origin, AgentTurnOrigin};
+use crate::agent::turn_origin::AgentTurnOrigin;
use crate::core::events::DomainEvent;
use crate::core::runtime::DispatchCtx;
use tinyagents_harness::progress::AgentProgress;
diff --git a/crates/openhuman-core/src/web_chat/types.rs b/crates/openhuman-core/src/web_chat/types.rs
index d557bc7b18..40629cef35 100644
--- a/crates/openhuman-core/src/web_chat/types.rs
+++ b/crates/openhuman-core/src/web_chat/types.rs
@@ -2,7 +2,7 @@
//! `SessionEntry`/`SessionCacheFingerprint`, the turn result
//! (`WebChatTaskResult`), and the `channel.web_*` request param structs.
-use serde::{Deserialize, Serialize};
+use serde::Deserialize;
use crate::agent::OpenHumanSessionHost;
diff --git a/crates/openhuman-core/src/web_chat/types_tests.rs b/crates/openhuman-core/src/web_chat/types_tests.rs
index 4563e55b7b..e69de29bb2 100644
--- a/crates/openhuman-core/src/web_chat/types_tests.rs
+++ b/crates/openhuman-core/src/web_chat/types_tests.rs
@@ -1 +0,0 @@
-use super::*;