Skip to content

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

fix(core): build the lib tests with --no-default-features

M3gA-Mind29de488506ca
diff --git a/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs b/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
index d08261f7e2..7571d0018e 100644
--- a/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
+++ b/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
@@ -230,6 +230,7 @@ fn committed_rows_mentioning_nudge(history: &[TranscriptEntry]) -> Vec<String> {
.collect()
}
+#[cfg(feature = "legacy-import")]
/// Every persisted file under the workspace, as (lossy) text. A session
/// store database is also read row by row, because TinyAgents keeps transcript
/// entries zstd-compressed and a byte search of the file would
@@ -250,6 +251,7 @@ fn persisted_text(root: &std::path::Path) -> Vec<(std::path::PathBuf, String)> {
.collect()
}
+#[cfg(feature = "legacy-import")]
/// The document bodies of the storage database at `path`, decompressed.
fn database_rows_text(path: &std::path::Path) -> String {
use crate::storage::rusqlite::{types::Value, Connection, OpenFlags};
@@ -281,6 +283,7 @@ fn database_rows_text(path: &std::path::Path) -> String {
out
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn a_failed_nudged_request_does_not_persist_the_nudge() {
// When the nudged request itself fails, the driver persists a display-only
diff --git a/crates/openhuman-core/src/agent/session_host/mod.rs b/crates/openhuman-core/src/agent/session_host/mod.rs
index 86d8422bee..0158dbae93 100644
--- a/crates/openhuman-core/src/agent/session_host/mod.rs
+++ b/crates/openhuman-core/src/agent/session_host/mod.rs
@@ -83,10 +83,10 @@ mod runtime_adapter_tests;
mod runtime_adapter_trace_tests;
#[cfg(test)]
mod runtime_adapter_usage_tests;
-#[cfg(test)]
+#[cfg(all(test, feature = "legacy-import"))]
mod transcript_compat_tests;
-#[cfg(test)]
+#[cfg(all(test, feature = "legacy-import"))]
#[path = "transcript_resume_stable_tests.rs"]
mod transcript_resume_stable_tests;
-#[cfg(test)]
+#[cfg(all(test, feature = "legacy-import"))]
mod typed_transcript_compat_tests;
diff --git a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
index 28f14d85ce..b981e6bd80 100644
--- a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
@@ -265,6 +265,7 @@ async fn started_agent_scheduler_releases_its_context_after_stop_is_confirmed()
.expect("the finite StopScheduler owner releases its context after confirmation");
}
+#[cfg(feature = "legacy-import")]
/// Upgrade regression: a job whose retry budget and single-flight setting lived
/// in the old `cron_job_policies` side table keeps firing after the upgrade,
/// with that policy now on the job itself.
diff --git a/crates/openhuman-core/src/doctor/connectivity_tests.rs b/crates/openhuman-core/src/doctor/connectivity_tests.rs
index 00894d9557..f56f47da5a 100644
--- a/crates/openhuman-core/src/doctor/connectivity_tests.rs
+++ b/crates/openhuman-core/src/doctor/connectivity_tests.rs
@@ -212,6 +212,7 @@ async fn storage_connect_check_reports_corrupt_sqlite_without_changing_it() {
assert_eq!(before, snapshot_test_tree(temp.path()));
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn storage_layout_check_warns_when_a_migration_is_pending() {
let temp = tempfile::tempdir().expect("temp directory");
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod.rs b/crates/openhuman-core/src/inference/tokenjuice/mod.rs
index c16b5e73fa..4fccf1c334 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod.rs
@@ -508,7 +508,7 @@ mod tests;
#[path = "repl_tools_tests.rs"]
mod repl_tool_tests;
-#[cfg(test)]
+#[cfg(all(test, feature = "modules"))]
#[path = "module_stub_tests.rs"]
pub(crate) mod module_stub;
diff --git a/crates/openhuman-core/src/memory/import_tests.rs b/crates/openhuman-core/src/memory/import_tests.rs
index a8036277ad..ae2977e900 100644
--- a/crates/openhuman-core/src/memory/import_tests.rs
+++ b/crates/openhuman-core/src/memory/import_tests.rs
@@ -325,6 +325,7 @@ CREATE TABLE user_profile (facet_id TEXT PRIMARY KEY, facet_type TEXT NOT NULL,
class TEXT, cue_families_json TEXT, UNIQUE(facet_type, key));
"#;
+#[cfg(feature = "legacy-import")]
fn legacy_document(config: &Config, id: &str, title: &str, body: &str) {
let db = config.workspace_dir.join("memory/memory.db");
std::fs::create_dir_all(db.parent().unwrap()).unwrap();
@@ -372,6 +373,7 @@ async fn assert_reference_contains(
);
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn a_real_legacy_document_imports_through_the_host_adapter() {
let tmp = tempfile::tempdir().unwrap();
@@ -402,6 +404,7 @@ async fn a_real_legacy_document_imports_through_the_host_adapter() {
assert_reference_contains(&engine, "real legacy body").await;
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn an_interrupted_import_resumes_through_the_host_adapter() {
let tmp = tempfile::tempdir().unwrap();
@@ -441,6 +444,7 @@ async fn an_interrupted_import_resumes_through_the_host_adapter() {
assert_reference_contains(&engine, "resumed legacy body").await;
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn retry_failed_reimports_a_real_legacy_row_through_the_host_adapter() {
use tinymemory_integrations::import::FailedItem;
@@ -479,6 +483,7 @@ async fn retry_failed_reimports_a_real_legacy_row_through_the_host_adapter() {
assert_reference_contains(&engine, "retried legacy body").await;
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn an_interrupted_retry_resumes_its_real_legacy_row() {
use tinymemory_integrations::import::FailedItem;
@@ -524,6 +529,7 @@ async fn an_interrupted_retry_resumes_its_real_legacy_row() {
assert_reference_contains(&engine, "resumed retry body").await;
}
+#[cfg(feature = "legacy-import")]
#[tokio::test]
async fn peer_slot_contention_preserves_interrupted_import_for_later_resume() {
#[derive(Clone, Copy)]
diff --git a/crates/openhuman-core/src/modules/mod.rs b/crates/openhuman-core/src/modules/mod.rs
index dfd4987eac..899fd8758a 100644
--- a/crates/openhuman-core/src/modules/mod.rs
+++ b/crates/openhuman-core/src/modules/mod.rs
@@ -232,7 +232,7 @@ trait Settled {
fn settled(&self) -> bool;
}
-#[cfg(feature = "modules")]
+#[cfg(all(feature = "modules", feature = "legacy-import"))]
macro_rules! settled_outcome {
($($module:ident),*) => {$(
impl Settled for $module::Outcome {
@@ -243,19 +243,19 @@ macro_rules! settled_outcome {
)*};
}
-#[cfg(feature = "modules")]
+#[cfg(all(feature = "modules", feature = "legacy-import"))]
settled_outcome!(
storage_import_tinyconnectors,
storage_import_tinybox,
storage_import_tinyjuice
);
-#[cfg(feature = "modules")]
+#[cfg(all(feature = "modules", feature = "legacy-import"))]
impl Settled for storage_import_tinyjuice_savings::Outcome {
fn settled(&self) -> bool {
matches!(self, Self::AlreadyDone | Self::Imported { .. })
}
}
-#[cfg(all(feature = "modules", feature = "web3"))]
+#[cfg(all(feature = "modules", feature = "web3", feature = "legacy-import"))]
settled_outcome!(storage_import_tinywallet);
/// The (importer, module scope, directory) triples this process already
diff --git a/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs b/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs
index ddccdabcb3..b0dbd0daa8 100644
--- a/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs
+++ b/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs
@@ -83,6 +83,14 @@ impl EncryptedFileBackend {
pub fn new(_workspace_dir: &Path) -> Self {
Self
}
+
+ /// Fails closed like every other operation of this adapter.
+ pub fn get_profile_read_only(
+ &self,
+ _namespaced_key: &str,
+ ) -> Result<Option<String>, SecretStorageError> {
+ Err(unavailable())
+ }
}
impl SecretBackend for EncryptedFileBackend {
diff --git a/crates/openhuman-core/src/storage/layout/archive.rs b/crates/openhuman-core/src/storage/layout/archive.rs
index 209139a74c..13741bdbac 100644
--- a/crates/openhuman-core/src/storage/layout/archive.rs
+++ b/crates/openhuman-core/src/storage/layout/archive.rs
@@ -377,6 +377,6 @@ pub fn restore(archive: &Path, profile_dir: &Path) -> Result<Manifest, LayoutErr
Ok(manifest)
}
-#[cfg(test)]
+#[cfg(all(test, feature = "legacy-import"))]
#[path = "archive_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/threads/transcript_host_tests.rs b/crates/openhuman-core/src/threads/transcript_host_tests.rs
index 1ed3b76edd..3a550960b9 100644
--- a/crates/openhuman-core/src/threads/transcript_host_tests.rs
+++ b/crates/openhuman-core/src/threads/transcript_host_tests.rs
@@ -296,6 +296,7 @@ fn text_dialect_tool_turn_projects_calls_on_their_issuing_row_as_settled() {
);
}
+#[cfg(feature = "legacy-import")]
/// Transcripts already written while the codec filed a turn's calls on its
/// final row (calls recorded *after* their own results) still project each call
/// once, settled, with its real name.
diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs
index 48240f7412..c531e2d13d 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs
@@ -6,8 +6,9 @@
use super::*;
use crate::modules::tinybox::host_runtime::{host_shell_flavor, ShellFlavor};
+use crate::tools::system::shell_support::python_env_defaults;
#[cfg(feature = "modules")]
-use crate::tools::system::shell_support::{python_env_defaults, PYTHON_ENV_DEFAULTS};
+use crate::tools::system::shell_support::PYTHON_ENV_DEFAULTS;
use std::collections::HashMap;
use std::ffi::OsString;