Skip to content

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

test(cli): compare model overrides against the workspace baseline

Steven Enamakele0c1f5d16649
diff --git a/crates/openhuman-cli/Cargo.toml b/crates/openhuman-cli/Cargo.toml
index d043ec6b8b..a33c519feb 100644
--- a/crates/openhuman-cli/Cargo.toml
+++ b/crates/openhuman-cli/Cargo.toml
@@ -428,7 +428,6 @@ tokio = { version = "1", features = ["full"] }
uuid = { version = "1", features = ["v4"] }
[dev-dependencies]
-tinystoragedrivers-testkit = { path = "../../vendor/tinystoragedrivers/crates/tinystoragedrivers-testkit" }
# Root tests and examples reach into the core, embed and tinyhumans directly.
# Dev-only, so none of them is an edge of the shipped binary. Same spelling as
# the library crates' own manifests (`default-features = false`; the gates come
diff --git a/crates/openhuman-core/src/profiles/host_tests.rs b/crates/openhuman-core/src/profiles/host_tests.rs
index 4c191ad67f..dbb33098b5 100644
--- a/crates/openhuman-core/src/profiles/host_tests.rs
+++ b/crates/openhuman-core/src/profiles/host_tests.rs
@@ -460,6 +460,10 @@ async fn a_reprovisioned_profile_does_not_inherit_the_old_credential() {
async fn a_clean_reopen_does_not_recover_but_a_takeover_does() {
let tmp = tempfile::tempdir().unwrap();
let host = host(&tmp, 4, 0);
+ let previous = crate::storage::install(Arc::clone(
+ host.backend.as_ref().expect("test host has shared storage"),
+ ));
+ let _restore_storage = RestoreInstalledStorage(previous);
let id = profile(&format!("recover-{}", uuid::Uuid::new_v4()));
host.provision(&id).await.unwrap();
let workspace = host.layout_of(&id).workspace_dir;
diff --git a/tests/cli_model_overrides_e2e.rs b/tests/cli_model_overrides_e2e.rs
index 733346d4af..41356cadaa 100644
--- a/tests/cli_model_overrides_e2e.rs
+++ b/tests/cli_model_overrides_e2e.rs
@@ -7,6 +7,19 @@ use serde_json::Value;
#[test]
fn cli_model_and_provider_flags_override_the_loaded_session_without_persisting() {
let workspace = tempfile::tempdir().expect("temporary OpenHuman workspace");
+ let baseline = Command::new(env!("CARGO_BIN_EXE_openhuman-core"))
+ .args(["inference", "get_client_config"])
+ .env("OPENHUMAN_WORKSPACE", workspace.path())
+ .output()
+ .expect("read the workspace's baseline inference config");
+ assert!(
+ baseline.status.success(),
+ "baseline CLI failed: {}",
+ String::from_utf8_lossy(&baseline.stderr)
+ );
+ let baseline: Value = serde_json::from_slice(&baseline.stdout).expect("baseline JSON response");
+ let baseline_result = baseline.get("result").expect("baseline RPC result");
+
let output = Command::new(env!("CARGO_BIN_EXE_openhuman-core"))
.args([
"--provider",
@@ -40,9 +53,9 @@ fn cli_model_and_provider_flags_override_the_loaded_session_without_persisting()
);
}
assert_eq!(
- result.get("default_model").and_then(Value::as_str),
- Some("openrouter/deepseek/deepseek-v4-flash"),
- "a local route override must not replace the managed default model"
+ result.get("default_model"),
+ baseline_result.get("default_model"),
+ "a local route override must not replace the workspace's default model"
);
let persisted =