feat(harness_init): eager first-run setup with init overlay; pin managed Python to 3.13 (#4021)

This commit is contained in:
Steven Enamakel
2026-06-23 17:32:29 -07:00
committed by GitHub
parent 39fd83e866
commit fb720fd305
40 changed files with 1728 additions and 4 deletions
+45
View File
@@ -1111,6 +1111,51 @@ async fn json_rpc_monitor_list_and_read_surface() {
rpc_join.abort();
}
#[tokio::test]
async fn json_rpc_harness_init_status_returns_snapshot_envelope() {
let _env_lock = json_rpc_e2e_env_lock();
let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
let rpc_base = format!("http://{rpc_addr}");
// status is read-only — no provisioning is triggered, so it is safe in CI
// (we deliberately do NOT call `openhuman.harness_init_run`, which would
// attempt real Python/Node/spaCy downloads).
let resp = post_json_rpc(
&rpc_base,
4471_1,
"openhuman.harness_init_status",
json!({}),
)
.await;
let result = assert_no_jsonrpc_error(&resp, "harness_init_status");
let snapshot = result
.get("snapshot")
.expect("harness_init_status should return a snapshot object");
let overall = snapshot
.get("overall")
.and_then(Value::as_str)
.expect("snapshot.overall should be a string");
assert!(
["idle", "running", "done", "failed"].contains(&overall),
"overall should be a known lifecycle state, got {overall}"
);
let steps = snapshot
.get("steps")
.and_then(Value::as_array)
.expect("snapshot.steps should be an array");
let ids: Vec<&str> = steps
.iter()
.filter_map(|s| s.get("id").and_then(Value::as_str))
.collect();
assert!(
ids.contains(&"python_runtime") && ids.contains(&"spacy") && ids.contains(&"node_runtime"),
"snapshot should list the registered steps, got {ids:?}"
);
rpc_join.abort();
}
#[tokio::test]
async fn json_rpc_agent_registry_manages_defaults_and_custom_agents() {
let _env_lock = json_rpc_e2e_env_lock();