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(agent): take the bus lock before the sweep test builds a core\n\nCI's coverage lane went red on `agent::triage::evaluator` tests failing\nwith "ScriptedModel: response queue is exhausted" — in tests this branch\ndoes not touch. It was mine.\n\n`a_build_only_runtime_is_swept_before_it_can_be_invoked` calls\n`CoreBuilder::build()`, and `CoreContext::init` re-registers the native bus\nhandlers as part of that. Running in parallel with a test holding a\n`mock_agent_run_turn` stub, the build reinstalls the *real* `agent.run_turn`\nhandler over the stub; the triage test then reaches a real harness and hits\nits deliberately-empty `ScriptedModel`, which is the exhaustion message.\n\nThe test already took `TEST_ENV_LOCK` for `OPENHUMAN_WORKSPACE`. That is a\ndifferent lock. `bus_testing::BUS_HANDLER_LOCK` is the one that covers bus\nregistration — its own docs say "any test that touches global native-bus\nregistration state should acquire this lock first", and building a core is\nexactly that. Take both.\n\nReproduced and verified rather than assumed: 3/3 red before, 3/3 green\nafter, against `cargo test --lib -- 'core::runtime' 'openhuman::agent'`,\nthe coverage lane's own filter. Clean `main` is 3/3 green on the same\nfilter, which is what ruled out a pre-existing flake.\n
yh928792aafebdb4a
diff --git a/src/openhuman/agent/tinyagents/reaper_tests.rs b/src/openhuman/agent/tinyagents/reaper_tests.rsindex 2801ce66f9..0aacc3f2c3 100644--- a/src/openhuman/agent/tinyagents/reaper_tests.rs+++ b/src/openhuman/agent/tinyagents/reaper_tests.rs@@ -105,8 +105,17 @@ async fn a_build_only_runtime_is_swept_before_it_can_be_invoked() {// Point the runtime at this workspace, then build it with no transport// and no services — the shape `examples/embed_headless.rs` documents.- // `OPENHUMAN_WORKSPACE` is process-global; take the same lock the other- // env-mutating tests do so a parallel test cannot read ours.+ //+ // Two process-global locks, because `build()` touches two kinds of global+ // state. `TEST_ENV_LOCK` covers `OPENHUMAN_WORKSPACE`, which is read from+ // the environment. `BUS_HANDLER_LOCK` covers the native-bus registrations+ // `CoreContext::init` performs: without it this build re-registers the real+ // `agent.run_turn` handler over a `mock_agent_run_turn` stub another test is+ // relying on, and that test then reaches a real harness it never scripted.+ // `bus_testing` states the rule — "any test that touches global native-bus+ // registration state should acquire this lock first" — and building a core+ // is exactly that.+ let _bus = crate::core::bus_testing::BUS_HANDLER_LOCK.lock().await;let _env = crate::openhuman::config::TEST_ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());