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
fix(ci): repair the tests and lints that keep main red
M3gA-Mind8cd32e890bc9
diff --git a/app/src/pages/__tests__/Conversations.render.test.tsx b/app/src/pages/__tests__/Conversations.render.test.tsxindex 91502c53b7..f798bb79fc 100644--- a/app/src/pages/__tests__/Conversations.render.test.tsx+++ b/app/src/pages/__tests__/Conversations.render.test.tsx@@ -1180,7 +1180,7 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {return { store: store!, thread };}- it('preserves the partial reply marked stopped when Stop is clicked mid-stream (#4862)', async () => {+ it('requests the cancel on Stop and leaves saving the partial to the confirmed cancel (#4862)', async () => {const { thread } = await renderStreamingConversation({ streamingContent: 'half a thought' });const stopButton = await screen.findByRole('button', { name: 'Stop generating' });@@ -1189,18 +1189,15 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {});expect(chatCancel).toHaveBeenCalledWith(thread.id);- // The partial stream is persisted as its own agent message flagged stopped- // so it survives the cancel instead of vanishing with the live preview.- await waitFor(() => {- expect(threadApi.appendMessage).toHaveBeenCalledWith(- thread.id,- expect.objectContaining({- content: 'half a thought',- sender: 'agent',- extraMetadata: expect.objectContaining({ stopped: true }),- })- );+ // The stopped partial is saved when the core confirms the cancel+ // (`chat_cancelled` → ChatRuntimeProvider's `onCancelled`, covered in+ // ChatRuntimeProvider.test.tsx: "persists the live partial as a stopped+ // reply"), not optimistically here. Saving on click raced the core's own+ // save and left a stopped bubble behind when the cancel did not land.+ await act(async () => {+ await Promise.resolve();});+ expect(threadApi.appendMessage).not.toHaveBeenCalled();});it('does not persist a stopped message when nothing has streamed yet (#4862)', async () => {@@ -1262,7 +1259,7 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {expect(threadApi.appendMessage).not.toHaveBeenCalled();});- it('persists the stopped reply only once across repeated Stop clicks (#4862)', async () => {+ it('never saves a partial locally across repeated Stop clicks (#4862)', async () => {const { thread } = await renderStreamingConversation({ streamingContent: 'half a thought' });const stopButton = await screen.findByRole('button', { name: 'Stop generating' });@@ -1273,14 +1270,13 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {});expect(chatCancel).toHaveBeenCalledWith(thread.id);- // The one-shot requestId guard keeps the partial from being appended twice.- await waitFor(() => {- expect(threadApi.appendMessage).toHaveBeenCalledTimes(1);+ // One save happens later, from the confirmed cancel, deduped per request+ // (ChatRuntimeProvider.test.tsx: "does not double-persist a partial").+ // Repeated clicks must not add a local save of their own.+ await act(async () => {+ await Promise.resolve();});- expect(threadApi.appendMessage).toHaveBeenCalledWith(- thread.id,- expect.objectContaining({ extraMetadata: expect.objectContaining({ stopped: true }) })- );+ expect(threadApi.appendMessage).not.toHaveBeenCalled();});it('interrupts the stream and restores the last prompt into the composer on ESC (#4862)', async () => {diff --git a/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs b/crates/openhuman-core/src/agent/agent_turn_loop_tests.rsindex 0dbc457934..fb6f9fca01 100644--- a/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs+++ b/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs@@ -414,13 +414,17 @@ async fn turn_errors_on_empty_text_response() {// A completion with no text *and* no tool calls is never a valid final// answer. The old behaviour returned `Ok("")`, which rendered as a blank// reply and silently wedged the thread; now it surfaces as a visible- // error the user can retry on (bug-report-2026-05-26 A1).- let provider = Arc::new(ScriptedProvider::new(vec![ChatResponse {+ // error the user can retry on (bug-report-2026-05-26 A1). The harness+ // retries an empty completion once (43660e6ef), so both attempts are+ // scripted empty — a single one leaves the retry to the provider's+ // default "done" reply and tests the retry instead of the error.+ let empty = || ChatResponse {text: Some(String::new()),tool_calls: vec![],usage: None,reasoning_content: None,- }]));+ };+ let provider = Arc::new(ScriptedProvider::new(vec![empty(), empty()]));let (mut agent, _tmp) = build_agent_with(provider, vec![], Box::new(NativeDialect));@@ -436,12 +440,14 @@ async fn turn_errors_on_empty_text_response() {#[tokio::test]async fn turn_errors_on_none_text_response() {- let provider = Arc::new(ScriptedProvider::new(vec![ChatResponse {+ // Both attempts: the harness retries an empty completion once.+ let none = || ChatResponse {text: None,tool_calls: vec![],usage: None,reasoning_content: None,- }]));+ };+ let provider = Arc::new(ScriptedProvider::new(vec![none(), none()]));let (mut agent, _tmp) = build_agent_with(provider, vec![], Box::new(NativeDialect));diff --git a/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rsindex 0bb0154c3b..db9e997adc 100644--- a/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs@@ -213,6 +213,9 @@ pub(super) fn names_presented_as_callable<'a>(/// defect waiting on a prompt or belt fix; none may be added./// * **Collision** — the backticked word is also a tool name but is used as/// something else (a node kind, an argument, an example). No fix is owed.+/// * **Deferred** — a `ToolExposure::Deferred` tool the prompt names together+/// with its route, `tool_search`, which makes it callable by name afterwards.+/// It is off the belt by design, so no fix is owed.const KNOWN_UNCALLABLE: &[(&str, &str, &str)] = &[// Real.(@@ -272,6 +275,12 @@ const KNOWN_UNCALLABLE: &[(&str, &str, &str)] = &[),("flow_discovery", "http_request", "a flow node kind"),("flow_discovery", "schedule", "a flow trigger field"),+ // Deferred.+ (+ "orchestrator",+ "desktop_goal",+ "`ToolExposure::Deferred`; the prompt routes it through `tool_search`",+ ),];/// A prompt must never teach a call the agent cannot make.diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rsindex ec7aea370e..cfcdac3689 100644--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs@@ -519,7 +519,11 @@ async fn typed_mode_blocks_unallowed_tool_calls() {.await.expect("runner should succeed");- assert!(outcome.output.contains("oops"));+ assert!(+ outcome.output.contains("oops"),+ "the recovered iteration's reply must be the output, got: {:?}",+ outcome.output+ );let captured = provider.captured.lock();let second_call_messages = &captured[1].messages;let tool_msg = second_call_messagesdiff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rsindex 736e3fdce3..e5e4b700b8 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs@@ -244,6 +244,14 @@ pub(super) fn recovery_policy(if body_level_failure {return Some(("validation", 1));}+ // An unknown-tool answer is a wrong call the model can correct, and it+ // echoes the attempted name and every valid tool name. Keyword sniffing+ // below would read those names as the failure — `forbidden_tool` or a+ // name carrying `unauthorized` became `authentication`, a zero-retry+ // class, and halted the run on its first wrong guess.+ if error.trim_start().starts_with("unknown tool `") {+ return Some(("validation", 1));+ }// A tool-owned JSON error contract is less ambiguous than rendered prose.// Read only explicit status/code fields; arbitrary response data is not a// failure signal (this function is called only for `is_error` results).diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rsindex d9b26582d0..4266665a40 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs@@ -222,3 +222,26 @@ async fn legitimate_wait_polling_does_not_consume_transient_budget() {}assert_eq!(drain_pause_count(&handle), 0);}++/// An unknown-tool answer echoes the attempted name and every valid tool name.+/// None of those names is the failure: a guess named `forbidden_tool`, or a+/// belt with a tool whose name carries `unauthorized`, used to classify as+/// `authentication` (zero retries) and halt the run on the first wrong guess.+#[test]+fn an_unknown_tool_is_a_correctable_call_not_a_blocker() {+ for error in [+ "unknown tool `forbidden_tool` (arguments: {}); valid tools: [file_read]",+ "unknown tool `ranges` (arguments: {}); valid tools: [GITHUB_LIST_UNAUTHORIZED_USERS, file_write]",+ ] {+ assert_eq!(+ super::super::repeated_failure::recovery_policy("forbidden_tool", error, false),+ Some(("validation", 1)),+ "{error}"+ );+ }+ // A genuine credential failure is still one.+ assert_eq!(+ super::super::repeated_failure::recovery_policy("gmail_send", "401 Unauthorized", false),+ Some(("authentication", 0))+ );+}diff --git a/crates/openhuman-core/src/api/product_tests.rs b/crates/openhuman-core/src/api/product_tests.rsindex d495523c96..be1b0fe0d7 100644--- a/crates/openhuman-core/src/api/product_tests.rs+++ b/crates/openhuman-core/src/api/product_tests.rs@@ -45,7 +45,7 @@ fn new_drops_header_unsafe_characters() {"opencompanyx-admin1");assert_eq!(- ProductIdentity::new("med ulla").unwrap().as_str(),+ ProductIdentity::new("open company").unwrap().as_str(),"opencompany");}diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rsindex ca6363854d..e481f36557 100644--- a/crates/openhuman-core/src/core/all.rs+++ b/crates/openhuman-core/src/core/all.rs@@ -139,7 +139,7 @@ pub enum DomainGroup {impl DomainGroup {/// Number of variants. Kept in sync by `domain_group_all_lists_every_variant`.- pub const COUNT: usize = 21;+ pub const COUNT: usize = 20;/// Every variant, for exhaustive iteration in drift guards.///diff --git a/crates/openhuman-core/src/security/credentials/ops/gated_services.rs b/crates/openhuman-core/src/security/credentials/ops/gated_services.rsindex 713810d7cf..dbf0bf4cbd 100644--- a/crates/openhuman-core/src/security/credentials/ops/gated_services.rs+++ b/crates/openhuman-core/src/security/credentials/ops/gated_services.rs@@ -80,7 +80,8 @@ pub async fn start_credential_gated_services(config: &Config) {// its first agent build warms the correctly scoped cache instead.if !is_embedder_host() {let skills_workspace = config.workspace_dir.clone();- let _ = tokio::task::spawn_blocking(move || {+ // Detached on purpose: the warm-up must not delay startup.+ tokio::task::spawn_blocking(move || {let count = crate::skills::load_workflow_metadata(&skills_workspace).len();log::debug!("[services] skill metadata cache warmed entries={count}");});diff --git a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rsindex 93ec5e6c4e..045cb9a517 100644--- a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs+++ b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs@@ -56,7 +56,13 @@ fn all_tools_includes_browser_when_enabled() {&cfg,);let names: Vec<&str> = tools.iter().map(|t| t.name()).collect();- assert!(names.contains(&"browser_open"));+ // The browser tools are the `modules` gate's (tools/ops.rs): present when+ // it is compiled in, absent in a gates-off build.+ assert_eq!(+ names.contains(&"browser_open"),+ cfg!(feature = "modules"),+ "browser_open follows the `modules` gate"+ );assert!(names.contains(&"pushover"));assert!(names.contains(&"proxy_config"));}