Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/openhuman/channels/providers/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ pub(crate) use web_errors::classify_inference_error;
#[allow(unused_imports)]
pub(crate) use web_errors::{
extract_provider_error_detail, extract_provider_name, generic_inference_error_user_message,
is_action_budget_exhausted, is_fallback_chain_exhausted, is_non_retryable_rate_limit_text,
parse_retry_after_secs_from_str, retry_after_hint, with_provider_detail, ClassifiedError,
inference_budget_exceeded_user_message, is_action_budget_exhausted,
is_fallback_chain_exhausted, is_inference_budget_exceeded_error,
is_non_retryable_rate_limit_text, parse_retry_after_secs_from_str, retry_after_hint,
with_provider_detail, ClassifiedError,
};

// Public API — event bus
Expand Down Expand Up @@ -50,6 +52,20 @@ pub(crate) use ops::{event_session_id_for, key_for};
pub(crate) use progress_bridge::spawn_progress_bridge;

// Schema field helpers re-exported for tests
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use schemas::{
json_output, optional_bool, optional_f64, optional_string, optional_u64, required_string,
};
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use session::{
compose_system_prompt_suffix, locale_reply_directive, normalize_model_override,
provider_role_for_model_override,
};
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use types::WebChatParams;

// Test helpers (debug/test builds only)
#[cfg(any(test, debug_assertions))]
Expand Down
4 changes: 4 additions & 0 deletions src/openhuman/config/schema/load/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ pub(crate) use super::Config;
#[cfg(test)]
pub(crate) use dirs::ACTIVE_USER_STATE_FILE;
#[cfg(test)]
pub(crate) use dirs::{ACTION_DIR_ENV_VAR, MEMORY_SYNC_INTERVAL_SECS_ENV_VAR};
#[cfg(test)]
pub(crate) use env::EnvLookup;
#[cfg(test)]
pub(crate) use env::ProcessEnvWithoutWorkspace;
#[cfg(test)]
pub(crate) use impl_load::parse_config_with_recovery;
Expand Down
2 changes: 2 additions & 0 deletions src/openhuman/config/schemas/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ use helpers::{
DEFAULT_ONBOARDING_FLAG_NAME,
};
#[cfg(test)]
use schema_defs::schemas;
#[cfg(test)]
use serde_json::{Map, Value};

#[cfg(test)]
Expand Down
5 changes: 5 additions & 0 deletions src/openhuman/inference/local/service/ollama_admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ mod util;
// Re-export free functions that form the public/crate API of this module.
pub(crate) use util::test_ollama_connection;

// Test-facing re-export: `ollama_admin_tests.rs` resolves `super::…` against
// this module. Dropped during the sub-module split; restored so libtest compiles.
#[cfg(test)]
pub(crate) use util::interrupted_pull_settle_window_secs;

#[cfg(test)]
#[path = "../ollama_admin_tests.rs"]
mod tests;
5 changes: 5 additions & 0 deletions src/openhuman/inference/provider/reliable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
use super::traits::{
ChatMessage, ChatRequest, ChatResponse, StreamChunk, StreamOptions, StreamResult,
};
// Test-facing: `reliable_tests.rs` (included via `use super::*`) constructs
// `StreamError::Provider(..)` directly. Prod code uses the fully-qualified
// path, so gate this to test builds to avoid an unused-import warning.
#[cfg(test)]
use super::traits::StreamError;
use super::Provider;
use crate::openhuman::inference::provider::record_resolved_provider_route;
use async_trait::async_trait;
Expand Down
2 changes: 2 additions & 0 deletions src/openhuman/mcp_server/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub use params::{build_rpc_params, slug_from};
#[cfg(test)]
pub use serde_json::{json, Value};
#[cfg(test)]
pub use specs::list_tools_result_for_config;
#[cfg(test)]
pub use types::{DEFAULT_LIMIT, MAX_LIMIT, TREE_TAG_MAX_TAGS, TREE_TAG_MAX_TAG_LENGTH};

#[cfg(test)]
Expand Down
4 changes: 4 additions & 0 deletions src/openhuman/memory/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ use anyhow::Result;
use async_trait::async_trait;

use crate::openhuman::config::Config;
// Test-facing: the inline `mod tests` (via `use super::*`) asserts against the
// managed summarization model constant. Restored after the module refactor.
#[cfg(test)]
use crate::openhuman::config::DEFAULT_CLOUD_LLM_MODEL;
use crate::openhuman::inference::provider::{
create_chat_model_with_model_id, provider_for_role, UsageInfo,
};
Expand Down
2 changes: 2 additions & 0 deletions src/openhuman/memory/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pub use registry::{all_controller_schemas, all_registered_controllers};

// Re-export the NAMESPACE constant so schema_tests.rs can reference it via
// `super::NAMESPACE` the same way the original flat module did.
#[cfg(test)]
pub(crate) use definitions::NAMESPACE;

#[cfg(test)]
#[path = "../schema_tests.rs"]
Expand Down
4 changes: 4 additions & 0 deletions src/openhuman/memory/tree_source/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ use chrono::{DateTime, Utc};
use crate::openhuman::config::Config;
use crate::openhuman::memory_store::content::raw::raw_source_dir;
use crate::openhuman::memory_store::trees::types::Tree;
// Test-facing: the inline `mod tests` builds sample `Tree`s using these enums.
// Restored after the tree_source refactor dropped the imports.
#[cfg(test)]
use crate::openhuman::memory_store::trees::types::{TreeKind, TreeStatus};

/// Filename of the per-source registry mirror inside `raw/<source_slug>/`.
pub const SOURCE_FILE_NAME: &str = "_source.md";
Expand Down
4 changes: 4 additions & 0 deletions src/openhuman/sandbox/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ use super::types::{
SandboxBackendHandle, SandboxBackendKind, SandboxExecRequest, SandboxExecResult, SandboxPolicy,
SandboxStatus,
};
// Test-facing: the inline `mod tests` builds `DockerOverrides` values. Prod code
// here doesn't reference the type, so gate to test builds. Restored post-refactor.
#[cfg(test)]
use super::types::DockerOverrides;
use std::process::Stdio;
use tokio::process::Command;

Expand Down
Loading