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
test(json_rpc): drop workflow run and speech seam e2e cases
Steven Enamakelb56c7e281f9b
diff --git a/tests/json_rpc_flows_e2e.rs b/tests/json_rpc_flows_e2e.rsindex e6c893c8a8..00ad291de2 100644--- a/tests/json_rpc_flows_e2e.rs+++ b/tests/json_rpc_flows_e2e.rs@@ -212,7 +212,14 @@ async fn json_rpc_cron_manual_worker_survives_caller_cancel_on_published_tinyflo.await.unwrap().expect("the released module wrote the v2 job through the host callback");- assert_eq!(migrated.meta.created_ms, 1772600767123_i64);+ // Module ports cannot set host-owned record metadata, so the migrated+ // job carries its original creation time as the body field `created_ms`+ // (the backend stamps `meta.created_ms` with the write time).+ assert_eq!(migrated.doc["created_ms"], 1772600767123_i64);+ assert!(+ migrated.meta.created_ms > 0,+ "the backend owns record metadata"+ );for (collection, id) in [("cron_jobs", "legacy-migration-proof"),("cron_runs", "00000000000000000007"),@@ -902,115 +909,6 @@ async fn json_rpc_cron_add_run_list_round_trip_over_the_tinyflows_module_inner()rpc_join.abort();}-#[tokio::test]-async fn json_rpc_workflow_run_definitions_and_runs_roundtrip() {- 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");-- // Builtin definitions are available with no seeding.- let defs = post_json_rpc(- &rpc_base,- 9141,- "openhuman.workflow_run_list_definitions",- json!({}),- )- .await;- let defs_outer = assert_no_jsonrpc_error(&defs, "workflow_run_list_definitions");- assert_eq!(- defs_outer.get("count").and_then(serde_json::Value::as_u64),- Some(1)- );- assert_eq!(- defs_outer- .get("definitions")- .and_then(|d| d.get(0))- .and_then(|d| d.get("id"))- .and_then(serde_json::Value::as_str),- Some("parallel_research_cross_check")- );-- // Seed a durable workflow run, then list + get it.- openhuman_core::storage::sessions::with_ledger(&config.workspace_dir, |ledger| {- let ledger_arg_0 = tinyagents_session::run_ledger::WorkflowRunUpsert {- id: "wf-run-1".to_string(),- definition_id: "parallel_research_cross_check".to_string(),- parent_thread_id: Some("thread-wf-1".to_string()),- input: json!({ "question": "test" }),- phase_states: json!({ "decompose": "completed" }),- child_run_ids: vec!["child-1".to_string()],- status: tinyagents_session::run_ledger::WorkflowRunStatus::Running,- summary: None,- started_at: None,- completed_at: None,- };- async move { ledger.upsert_workflow_run(ledger_arg_0).await }- })- .expect("seed workflow run");-- let list = post_json_rpc(- &rpc_base,- 9142,- "openhuman.workflow_run_list",- json!({ "definitionId": "parallel_research_cross_check" }),- )- .await;- let list_outer = assert_no_jsonrpc_error(&list, "workflow_run_list");- assert_eq!(- list_outer.get("count").and_then(serde_json::Value::as_u64),- Some(1)- );- assert_eq!(- list_outer- .get("runs")- .and_then(|r| r.get(0))- .and_then(|r| r.get("status"))- .and_then(serde_json::Value::as_str),- Some("running")- );-- let get = post_json_rpc(- &rpc_base,- 9143,- "openhuman.workflow_run_get",- json!({ "id": "wf-run-1" }),- )- .await;- let get_outer = assert_no_jsonrpc_error(&get, "workflow_run_get");- assert_eq!(- get_outer- .get("workflowRun")- .and_then(|r| r.get("definitionId"))- .and_then(serde_json::Value::as_str),- Some("parallel_research_cross_check")- );-- api_join.abort();- rpc_join.abort();-}--/// Full lifecycle over JSON-RPC for the `workflows` namespace:-/// create → list → read → phase → uninstall. Workflows are scaffolded under-/// the user-scope root (`$HOME/.openhuman/workflows/<slug>/`), which the temp-/// `HOME` isolates per-test.#[tokio::test]async fn json_rpc_workflows_lifecycle_round_trip() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -2477,153 +2375,6 @@ async fn json_rpc_flows_list_connections_aggregates_secret_free() {rpc_join.abort();}-/// Task 4 / #3090: when a web-chat request is sent with-/// `speak_reply: true`, `run_chat_task` should drive the agent's final text-/// through `voice::reply_speech::synthesize_reply` after the turn completes.-///-/// We activate the [`reply_speech::test_seam`] short-circuit via the-/// `OPENHUMAN_TEST_REPLY_SPEECH_SEAM` env var so the call is recorded-/// without contacting the ElevenLabs proxy.--#[test]-fn json_rpc_workflow_run_engine_executes_builtin_to_completion() {- run_json_rpc_e2e_on_agent_stack(- "json_rpc_workflow_run_engine_executes_builtin_to_completion",- json_rpc_workflow_run_engine_executes_builtin_to_completion_inner,- );-}--async fn json_rpc_workflow_run_engine_executes_builtin_to_completion_inner() {- 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_guard = EnvVarGuard::unset("VITE_BACKEND_URL");-- let (mock_addr, mock_join) = serve_on_ephemeral(mock_upstream_router()).await;- let mock_origin = format!("http://{}", mock_addr);-- write_min_config(&openhuman_home, &mock_origin);- let user_scoped_dir = openhuman_home.join("users").join("e2e-user");- write_min_config(&user_scoped_dir, &mock_origin);-- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;- let rpc_base = format!("http://{}", rpc_addr);-- tokio::time::sleep(Duration::from_millis(100)).await;-- // Authenticate so the child agents' provider has a backend session.- let store = post_json_rpc(- &rpc_base,- 375_001,- "openhuman.auth_store_session",- json!({ "token": "e2e-test-jwt", "user_id": "e2e-user" }),- )- .await;- assert_no_jsonrpc_error(&store, "store_session");-- // Sanity: the builtin definition is listed.- let defs = post_json_rpc(- &rpc_base,- 375_002,- "openhuman.workflow_run_list_definitions",- json!({}),- )- .await;- let defs_result = assert_no_jsonrpc_error(&defs, "list_definitions");- let defs_body = peel_logs_envelope(defs_result.get("result").unwrap_or(defs_result));- let definition_id = defs_body- .get("definitions")- .and_then(Value::as_array)- .and_then(|arr| arr.first())- .and_then(|d| d.get("id"))- .and_then(Value::as_str)- .expect("at least one builtin workflow definition")- .to_string();- assert_eq!(definition_id, "parallel_research_cross_check");-- // Start the workflow. Children inherit the parent (root) provider via the- // `modelOverride` pin → every phase hits the mock chat-completions route.- let start = post_json_rpc(- &rpc_base,- 375_003,- "openhuman.workflow_run_start",- json!({- "definitionId": definition_id,- "input": { "question": "What is the capital of France?", "modelOverride": "e2e-mock-model" },- }),- )- .await;- let start_result = assert_no_jsonrpc_error(&start, "workflow_run_start");- let start_body = peel_logs_envelope(start_result.get("result").unwrap_or(start_result));- let run = start_body- .get("workflowRun")- .expect("workflowRun in start response");- let run_id = run- .get("id")- .and_then(Value::as_str)- .expect("run id")- .to_string();- assert_eq!(- run.get("status").and_then(Value::as_str),- Some("running"),- "fresh run should be running: {run}"- );-- // Poll workflow_run_get until terminal (or timeout). The four-phase builtin- // fans out 5 children total against the mock — completes quickly.- let mut final_status = String::new();- let mut final_summary = String::new();- for attempt in 0..120 {- tokio::time::sleep(Duration::from_millis(250)).await;- let got = post_json_rpc(- &rpc_base,- 37_500_100 + attempt,- "openhuman.workflow_run_get",- json!({ "id": run_id }),- )- .await;- let got_result = assert_no_jsonrpc_error(&got, "workflow_run_get");- let got_body = peel_logs_envelope(got_result.get("result").unwrap_or(got_result));- let wf = got_body- .get("workflowRun")- .expect("workflowRun payload present");- let status = wf- .get("status")- .and_then(Value::as_str)- .unwrap_or_default()- .to_string();- if matches!(- status.as_str(),- "completed" | "failed" | "cancelled" | "interrupted"- ) {- final_status = status;- final_summary = wf- .get("summary")- .and_then(Value::as_str)- .unwrap_or_default()- .to_string();- break;- }- }-- assert_eq!(- final_status, "completed",- "workflow run must reach completed; got status={final_status:?} summary={final_summary:?}"- );- assert!(- !final_summary.trim().is_empty(),- "completed workflow run must carry a non-empty summary"- );-- rpc_join.abort();- mock_join.abort();-}-// ─────────────────────────────────────────────────────────────────────────────// #5846 — the two authoring-gate behaviour changes, driven end-to-end through// the real strict-mode create path.diff --git a/tests/json_rpc_threads_e2e.rs b/tests/json_rpc_threads_e2e.rsindex ad4e1a2321..4a30afa72b 100644--- a/tests/json_rpc_threads_e2e.rs+++ b/tests/json_rpc_threads_e2e.rs@@ -1037,7 +1037,13 @@ async fn json_rpc_threads_transcript_get_projects_and_paginates() {let _api_url_guard = EnvVarGuard::unset("OPENHUMAN_API_URL");let thread_id = "thr_transcript_e2e";- let root_stem = "1000_orchestrator";+ // The importer files a transcript by the session key and agent component+ // its stem carries (`<session>.<agent>`); a bare legacy stem lands in the+ // default agent, which is not where the thread API looks.+ let root_stem = tinyagents_session::transcript::session_stem(+ &tinyagents_session::transcript::SessionRef::scoped(thread_id, "orchestrator"),+ );+ let root_stem = root_stem.as_str();// A full turn: system scaffolding (dropped), user with injected datetime// prefix, assistant tool-calling step (reasoning + tool_calls), tool result,// final assistant answer.@@ -1064,6 +1070,33 @@ async fn json_rpc_threads_transcript_get_projects_and_paginates() {],);+ // The host imports classic workspace transcripts during runtime boot.+ // This test builds the router directly, so import the seeded records before+ // asking the storage-backed thread API to read them.+ let config = openhuman_core::config::Config::load_or_init()+ .await+ .expect("load test config");+ assert_eq!(config.workspace_dir, workspace);+ let mut config = config;+ config.agent.chat_agent_id = Some("orchestrator".into());+ config.save().await.expect("save test chat agent");+ openhuman_core::agent_registry::host_definition::AgentDefinitionRegistry::init_global_builtins(+ )+ .expect("initialize built-in agent definitions");+ let backend = openhuman_core::storage::local::backend_for(&config.workspace_dir)+ .expect("open test workspace storage");+ let reports = openhuman_core::storage::import::sessions::run_with(&backend, &config);+ assert!(+ matches!(+ reports.first().map(|report| &report.outcome),+ Some(Ok(openhuman_core::storage::import::Outcome::Imported {+ found: 2,+ written: 2+ }))+ ),+ "import classic session transcripts: {reports:?}"+ );+let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;let rpc_base = format!("http://{rpc_addr}");