The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(tests): remove deprecated e2e tests
Steven Enamakel97aab6d1c185
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rsindex a97c88f181..ddb327a840 100644--- a/tests/json_rpc_e2e.rs+++ b/tests/json_rpc_e2e.rs@@ -3944,110 +3944,6 @@ async fn json_rpc_run_ledger_lifecycle() {rpc_join.abort();}-#[tokio::test]-async fn json_rpc_agent_work_list_groups_runs_by_bucket() {- let _env_lock = json_rpc_e2e_env_lock_async().await;- let tmp = tempdir().expect("tempdir");- let home = tmp.path();- let openhuman_home = home.join(".openhuman");-- let _home_guard = EnvVarGuard::set_to_path("HOME", home);- let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");- let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");- let _vite_backend_url_guard = EnvVarGuard::unset("VITE_BACKEND_URL");- let _api_url_guard = EnvVarGuard::unset("OPENHUMAN_API_URL");-- let (api_addr, api_join) = serve_on_ephemeral(mock_upstream_router()).await;- let api_origin = format!("http://{api_addr}");- write_min_config(openhuman_home.as_path(), &api_origin);-- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;- let rpc_base = format!("http://{rpc_addr}");-- let config = openhuman_core::config::Config::load_or_init()- .await- .expect("load config");-- use tinyagents_session::run_ledger::{AgentRunKind, AgentRunStatus, AgentRunUpsert};- let seed = |id: &str, status: AgentRunStatus| AgentRunUpsert {- id: id.to_string(),- kind: AgentRunKind::Subagent,- parent_run_id: None,- parent_thread_id: Some("thread-work-1".to_string()),- agent_id: Some("task_manager_agent".to_string()),- status,- prompt_ref: None,- worker_thread_id: None,- checkpoint_path: None,- checkpoint: None,- summary: None,- error: None,- metadata: json!({ "source": "json_rpc_e2e" }),- started_at: None,- completed_at: None,- };- // Two awaiting-user (needs_input), one running (working), one completed.- openhuman_core::storage::sessions::with_ledger(&config.workspace_dir, |ledger| {- let ledger_arg_0 = seed("work-a", AgentRunStatus::AwaitingUser);- async move { ledger.upsert_agent_run(ledger_arg_0).await }- })- .expect("seed a");- openhuman_core::storage::sessions::with_ledger(&config.workspace_dir, |ledger| {- let ledger_arg_0 = seed("work-b", AgentRunStatus::AwaitingUser);- async move { ledger.upsert_agent_run(ledger_arg_0).await }- })- .expect("seed b");- openhuman_core::storage::sessions::with_ledger(&config.workspace_dir, |ledger| {- let ledger_arg_0 = seed("work-c", AgentRunStatus::Running);- async move { ledger.upsert_agent_run(ledger_arg_0).await }- })- .expect("seed c");- openhuman_core::storage::sessions::with_ledger(&config.workspace_dir, |ledger| {- let ledger_arg_0 = seed("work-d", AgentRunStatus::Completed);- async move { ledger.upsert_agent_run(ledger_arg_0).await }- })- .expect("seed d");-- let list = post_json_rpc(&rpc_base, 9131, "openhuman.agent_work_list", json!({})).await;- let outer = assert_no_jsonrpc_error(&list, "agent_work_list");-- assert_eq!(- outer.get("total").and_then(serde_json::Value::as_u64),- Some(4)- );-- let groups = outer- .get("groups")- .and_then(serde_json::Value::as_array)- .expect("groups array");- // Always five buckets, in display order.- let buckets: Vec<&str> = groups- .iter()- .filter_map(|g| g.get("bucket").and_then(serde_json::Value::as_str))- .collect();- assert_eq!(- buckets,- vec!["needs_input", "working", "completed", "failed", "stopped"]- );-- let count_of = |bucket: &str| -> u64 {- groups- .iter()- .find(|g| g.get("bucket").and_then(serde_json::Value::as_str) == Some(bucket))- .and_then(|g| g.get("count"))- .and_then(serde_json::Value::as_u64)- .unwrap_or(0)- };- assert_eq!(count_of("needs_input"), 2);- assert_eq!(count_of("working"), 1);- assert_eq!(count_of("completed"), 1);- assert_eq!(count_of("failed"), 0);- assert_eq!(count_of("stopped"), 0);-- api_join.abort();- rpc_join.abort();-}-#[tokio::test]async fn retired_agent_work_methods_are_unknown_over_http() {let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;diff --git a/tests/raw_coverage/agent_orchestration_e2e.rs b/tests/raw_coverage/agent_orchestration_e2e.rsindex 4b9ca11cb6..08d683d52a 100644--- a/tests/raw_coverage/agent_orchestration_e2e.rs+++ b/tests/raw_coverage/agent_orchestration_e2e.rs@@ -224,140 +224,3 @@ fn str_at<'a>(value: &'a Value, pointer: &str) -> &'a str {.unwrap_or_else(|| panic!("expected a string at {pointer} in {value}"))}-// ── agent_work_control ──────────────────────────────────────────────────────--/// `agent_work_control` is the command center's only write. Its guards run in a-/// deliberate order — the message requirement is checked BEFORE the run is-/// looked up — so a `continue` with no message is rejected on its own terms-/// rather than as a missing run.-#[tokio::test]-async fn agent_work_control_validates_verb_and_message_before_touching_the_ledger() {- let _lock = env_lock_async().await;- let h = setup().await;-- let unknown_verb = h- .err(- 3201,- "openhuman.agent_work_control",- json!({ "runId": "run-1", "action": "detonate" }),- )- .await;- assert!(- unknown_verb.contains("detonate"),- "an unknown verb is quoted back: {unknown_verb}"- );-- // `continue` and `follow_up` both require a message. The run does not- // exist, so a "run not found" here would prove the guard ran too late.- for (id, action) in [(3202, "continue"), (3203, "follow_up")] {- let no_message = h- .err(- id,- "openhuman.agent_work_control",- json!({ "runId": "run-does-not-exist", "action": action }),- )- .await;- assert!(- no_message.to_lowercase().contains("message"),- "{action} without a message is rejected for the message, not the run: {no_message}"- );- assert!(- !no_message.contains("run-does-not-exist"),- "the message guard runs before the ledger lookup: {no_message}"- );-- // A whitespace-only message is not a message.- let blank_message = h- .err(- id + 10,- "openhuman.agent_work_control",- json!({ "runId": "run-does-not-exist", "action": action, "message": " " }),- )- .await;- assert!(- blank_message.to_lowercase().contains("message"),- "{action} treats a blank message as absent: {blank_message}"- );- }-- // `stop` needs no message, so it reaches the ledger and fails there.- let unknown_run = h- .err(- 3204,- "openhuman.agent_work_control",- json!({ "runId": "run-does-not-exist", "action": "stop" }),- )- .await;- assert!(- unknown_run.contains("run-does-not-exist"),- "a verb needing no message reaches the lookup and names the run: {unknown_run}"- );-- for (id, key) in [(3205, "runId"), (3206, "action")] {- let params = if key == "runId" {- json!({ "action": "stop" })- } else {- json!({ "runId": "run-1" })- };- let missing = h.err(id, "openhuman.agent_work_control", params).await;- assert!(- missing.contains(key),- "the required `{key}` param is named: {missing}"- );- }-- // The read side agrees there is nothing to control.- let view = h.ok(3207, "openhuman.agent_work_list", json!({})).await;- assert_eq!(- view.get("total").and_then(Value::as_u64),- Some(0),- "a fresh workspace has no background agent runs: {view}"- );-- h.join.abort();-}--// ── subagent: cancel / steer ────────────────────────────────────────────────--/// The background-tasks drawer's Cancel and steer controls. Both answer-/// **structurally** for a task that is not running rather than erroring — the-/// drawer's row may be stale, and a stale row must not raise. `steer` goes-/// further and says *why* it did nothing.-#[tokio::test]-async fn subagent_steer_honours_and_defaults_the_queue_mode() {- let _lock = env_lock_async().await;- let h = setup().await;-- let collect = h- .ok(- 3504,- "openhuman.subagent_steer",- json!({- "taskId": "sub-not-running",- "message": "note this for later",- "mode": "collect",- }),- )- .await;- assert_eq!(- collect.get("mode").and_then(Value::as_str),- Some("collect"),- "an explicit queue mode is honoured and echoed: {collect}"- );-- // An unrecognised mode falls back to steer rather than erroring.- let bogus_mode = h- .ok(- 3505,- "openhuman.subagent_steer",- json!({ "taskId": "sub-not-running", "message": "hi", "mode": "teleport" }),- )- .await;- assert_eq!(- bogus_mode.get("mode").and_then(Value::as_str),- Some("steer"),- "an unknown mode degrades to the default: {bogus_mode}"- );-- h.join.abort();-}