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: clear CI static and integration failures
Steven Enamakelefccdd214755
diff --git a/app/test/playwright/specs/chat-composer-primary-slot.spec.ts b/app/test/playwright/specs/chat-composer-primary-slot.spec.tsindex 6b882f5228..566946f570 100644--- a/app/test/playwright/specs/chat-composer-primary-slot.spec.ts+++ b/app/test/playwright/specs/chat-composer-primary-slot.spec.ts@@ -196,7 +196,9 @@ test.describe('Chat composer primary slot', () => {await expect(sendButton(page)).toHaveCount(0);});- test('Stop ends the turn and restores the send action for the retained draft', async ({ page }) => {+ test('Stop ends the turn and restores the send action for the retained draft', async ({+ page,+ }) => {await openChat(page);await beginStreamingTurn(page, 'Count slowly for me');diff --git a/app/test/playwright/specs/chat-harness-subagent.spec.ts b/app/test/playwright/specs/chat-harness-subagent.spec.tsindex b123bf6d3c..829f5006ee 100644--- a/app/test/playwright/specs/chat-harness-subagent.spec.ts+++ b/app/test/playwright/specs/chat-harness-subagent.spec.ts@@ -304,7 +304,10 @@ function formatDiagnostics(snapshot: DiagnosticsSnapshot): string {}test.describe('Chat Harness - Subagent', () => {- test.skip(true, 'background delivery is system-authored and cannot be deterministically keyword-scripted');+ test.skip(+ true,+ 'background delivery is system-authored and cannot be deterministically keyword-scripted'+ );// On any test failure, attach the harness state (mock request log, matched// keywords, selected thread, chat-runtime phase + tool timeline + lastdiff --git a/app/test/playwright/specs/chat-user-message-edit-affordance.spec.ts b/app/test/playwright/specs/chat-user-message-edit-affordance.spec.tsindex 8dc3db70d3..d7d05c745a 100644--- a/app/test/playwright/specs/chat-user-message-edit-affordance.spec.ts+++ b/app/test/playwright/specs/chat-user-message-edit-affordance.spec.ts@@ -147,7 +147,9 @@ test.describe('User-message action bar — capability-gated affordances (#5897)'await expect(page.getByRole('button', { name: 'Copy response' })).toBeVisible();});- test.skip('no branch picker is offered while the runtime cannot switch branches', async ({ page }) => {+ test.skip('no branch picker is offered while the runtime cannot switch branches', async ({+ page,+ }) => {const input = await openChat(page);await sendOneTurn(page, input, 'branch check');diff --git a/app/test/playwright/specs/crypto-payment-flow.spec.ts b/app/test/playwright/specs/crypto-payment-flow.spec.tsindex 21fe5b5a86..54f6d095e2 100644--- a/app/test/playwright/specs/crypto-payment-flow.spec.ts+++ b/app/test/playwright/specs/crypto-payment-flow.spec.ts@@ -3,7 +3,10 @@ import { expect, test } from '@playwright/test';import { bootAuthenticatedPage, waitForAppReady } from '../helpers/core-rpc';test.describe('Crypto Payment Flow', () => {- test.skip(true, 'billing is now an account-settings affordance; crypto payment redirect surface was retired');+ test.skip(+ true,+ 'billing is now an account-settings affordance; crypto payment redirect surface was retired'+ );test.beforeEach(async ({ page }, testInfo) => {const slug = testInfo.title.toLowerCase().replace(/[^a-z0-9]+/g, '-');await bootAuthenticatedPage(page, `pw-crypto-payment-${slug}`);diff --git a/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts b/app/test/playwright/specs/harness-cron-prompt-flow.spec.tsindex 142de7334e..1fa5a66227 100644--- a/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts+++ b/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts@@ -109,7 +109,10 @@ async function sendMessage(page: Page, prompt: string): Promise<void> {}test.describe('Harness - Cron prompt-flow', () => {- test.skip(true, 'cron prompt flows now hand off to the scheduling specialist and are not deterministic here');+ test.skip(+ true,+ 'cron prompt flows now hand off to the scheduling specialist and are not deterministic here'+ );test.beforeEach(async ({ page }) => {await resetMock();await openChat(page);diff --git a/app/test/playwright/specs/harness-search-tool-flow.spec.ts b/app/test/playwright/specs/harness-search-tool-flow.spec.tsindex 1a09e521e6..34dcb7ad3a 100644--- a/app/test/playwright/specs/harness-search-tool-flow.spec.ts+++ b/app/test/playwright/specs/harness-search-tool-flow.spec.ts@@ -142,7 +142,10 @@ async function toolTimelineIncludes(}test.describe('Harness - Search tool-flow', () => {- test.skip(true, 'file_read prompt flow is sandbox-fixture dependent; filesystem coverage is authoritative');+ test.skip(+ true,+ 'file_read prompt flow is sandbox-fixture dependent; filesystem coverage is authoritative'+ );test.beforeEach(async ({ page }) => {await resetMock();await openChat(page);diff --git a/app/test/playwright/specs/navigation-settings-panels.spec.ts b/app/test/playwright/specs/navigation-settings-panels.spec.tsindex b538e5a361..f71351c9d2 100644--- a/app/test/playwright/specs/navigation-settings-panels.spec.ts+++ b/app/test/playwright/specs/navigation-settings-panels.spec.ts@@ -12,10 +12,7 @@ const panels: PanelCheck[] = [{ hash: '/settings/memory-data', markers: ['Memory', 'Data', 'Storage'] },{ hash: '/settings/notifications-hub', markers: ['Notifications'] },{ hash: '/settings/developer-options', markers: ['Developer', 'Debug', 'Advanced'] },- {- hash: '/settings/account',- markers: ['Account', 'Billing'],- },+ { hash: '/settings/account', markers: ['Account', 'Billing'] },{ hash: '/settings/appearance', markers: ['Appearance', 'Theme', 'Color'] },{ hash: '/settings/tools', markers: ['Tools', 'Enable', 'Disable'] },];diff --git a/app/test/playwright/specs/settings-account-preferences.spec.ts b/app/test/playwright/specs/settings-account-preferences.spec.tsindex 0cba8a253f..1809ff6706 100644--- a/app/test/playwright/specs/settings-account-preferences.spec.ts+++ b/app/test/playwright/specs/settings-account-preferences.spec.ts@@ -147,7 +147,10 @@ test.describe('Settings - Account Preferences', () => {});test('opens the billing route and settles the redirect status copy', async ({ page }) => {- test.skip(true, 'billing is exposed as an account-settings button; the retired nested route is covered by card-payment-flow');+ test.skip(+ true,+ 'billing is exposed as an account-settings button; the retired nested route is covered by card-payment-flow'+ );await gotoSettingsRoute(page, '/settings/account');await expect(page.getByRole('heading', { name: 'Billing', exact: true })).toBeVisible();diff --git a/app/test/playwright/specs/user-journey-settings-round-trip.spec.ts b/app/test/playwright/specs/user-journey-settings-round-trip.spec.tsindex 6ed074b047..c5ca954964 100644--- a/app/test/playwright/specs/user-journey-settings-round-trip.spec.ts+++ b/app/test/playwright/specs/user-journey-settings-round-trip.spec.ts@@ -13,10 +13,7 @@ const panels: PanelCheck[] = [{ hash: '/settings', markers: ['Settings', 'Appearance', 'Notifications'] },{ hash: '/settings/memory-data', markers: ['Memory', 'Data', 'Storage'] },{ hash: '/settings/developer-options', markers: ['Developer', 'Debug', 'Advanced'] },- {- hash: '/settings/account',- markers: ['Account', 'Billing'],- },+ { hash: '/settings/account', markers: ['Account', 'Billing'] },// Home folded into the unified chat surface — /home redirects to /chat.{ hash: '/home', markers: [] },// /chat is the Assistant surface (thread list + agent chat header).diff --git a/crates/openhuman-app/src/lib.rs b/crates/openhuman-app/src/lib.rsindex aeccc6f472..86d83e8de5 100644--- a/crates/openhuman-app/src/lib.rs+++ b/crates/openhuman-app/src/lib.rs@@ -3285,12 +3285,10 @@ pub fn run() {window_state::install_dpi_guard(&window);// Windows starts at a compact near-square size. Other desktop// targets keep their existing work-area first-launch layout.- if !window_state::restore_main(&window) {- if cfg!(windows) {- window_state::center_main(&window);- } else if !window_state::maximize_to_work_area(&window) {- window_state::center_main(&window);- }+ if !window_state::restore_main(&window)+ && (cfg!(windows) || !window_state::maximize_to_work_area(&window))+ {+ window_state::center_main(&window);}if !daemon_mode {if let Err(err) = window.show() {diff --git a/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs b/crates/openhuman-core/src/agent/progress_tracing/langfuse.rsindex d3778afb63..501a3288db 100644--- a/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs+++ b/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs@@ -27,10 +27,10 @@ mod journal_export;mod span_export;pub(crate) use environment::{environment_for_base, ingestion_url, skip_push};+pub(crate) use journal_export::journal_push_ready;#[cfg(test)]pub(crate) use journal_export::push_observations;pub(crate) use journal_export::root_subagent_observations;-pub(crate) use journal_export::journal_push_ready;#[cfg(test)]pub(crate) use span_export::push_spans;diff --git a/crates/openhuman-core/src/agent/progress_tracing/serialize.rs b/crates/openhuman-core/src/agent/progress_tracing/serialize.rsindex 5e266c5c8c..adecb827d3 100644--- a/crates/openhuman-core/src/agent/progress_tracing/serialize.rs+++ b/crates/openhuman-core/src/agent/progress_tracing/serialize.rs@@ -38,7 +38,10 @@ pub(super) fn capture_model_content(value: &serde_json::Value) -> serde_json::Va*content = serde_json::Value::String(format!("{}…[message content truncated]",truncate_chars(- &content.as_str().map(str::to_owned).unwrap_or_else(|| content.to_string()),+ &content+ .as_str()+ .map(str::to_owned)+ .unwrap_or_else(|| content.to_string()),MAX_MODEL_CONTENT_CHARS / 2)));@@ -68,7 +71,10 @@ pub(super) fn capture_model_content(value: &serde_json::Value) -> serde_json::Valet mut kept = fields.clone();if let Some(content) = kept.get_mut("content") {*content = serde_json::Value::String(truncate_chars(- &content.as_str().map(str::to_owned).unwrap_or_else(|| content.to_string()),+ &content+ .as_str()+ .map(str::to_owned)+ .unwrap_or_else(|| content.to_string()),MAX_MODEL_CONTENT_CHARS / 2,));if serde_json::Value::Object(kept.clone())diff --git a/crates/openhuman-core/src/config/schema/load/secrets.rs b/crates/openhuman-core/src/config/schema/load/secrets.rsindex dabb975fc3..85edfbdba6 100644--- a/crates/openhuman-core/src/config/schema/load/secrets.rs+++ b/crates/openhuman-core/src/config/schema/load/secrets.rs@@ -314,25 +314,5 @@ pub(super) fn encrypt_config_secrets(config: &mut Config) -> Result<()> {}#[cfg(test)]-mod tests {- use super::*;-- #[test]- fn gemini_key_round_trips_with_encryption_enabled() {- let dir = tempfile::tempdir().unwrap();- let mut config = Config::default();- config.config_path = dir.path().join("config.toml");- config.secrets.encrypt = true;- config.search.gemini.api_key = Some("gemini-sentinel".into());-- encrypt_config_secrets(&mut config).unwrap();- let ciphertext = config.search.gemini.api_key.as_deref().unwrap();- assert!(ciphertext.starts_with("enc2:"));- assert!(!ciphertext.contains("gemini-sentinel"));- assert!(!decrypt_config_secrets(&mut config, dir.path()).unwrap());- assert_eq!(- config.search.gemini.api_key.as_deref(),- Some("gemini-sentinel")- );- }-}+#[path = "secrets_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/config/schema/load/secrets_tests.rs b/crates/openhuman-core/src/config/schema/load/secrets_tests.rsnew file mode 100644index 0000000000..8fd4b9f600--- /dev/null+++ b/crates/openhuman-core/src/config/schema/load/secrets_tests.rs@@ -0,0 +1,20 @@+use super::*;++#[test]+fn gemini_key_round_trips_with_encryption_enabled() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = Config::default();+ config.config_path = dir.path().join("config.toml");+ config.secrets.encrypt = true;+ config.search.gemini.api_key = Some("gemini-sentinel".into());++ encrypt_config_secrets(&mut config).unwrap();+ let ciphertext = config.search.gemini.api_key.as_deref().unwrap();+ assert!(ciphertext.starts_with("enc2:"));+ assert!(!ciphertext.contains("gemini-sentinel"));+ assert!(!decrypt_config_secrets(&mut config, dir.path()).unwrap());+ assert_eq!(+ config.search.gemini.api_key.as_deref(),+ Some("gemini-sentinel")+ );+}diff --git a/crates/openhuman-core/src/config/schema/mod.rs b/crates/openhuman-core/src/config/schema/mod.rsindex 6bd0806f5c..399f4ec212 100644--- a/crates/openhuman-core/src/config/schema/mod.rs+++ b/crates/openhuman-core/src/config/schema/mod.rs@@ -123,10 +123,10 @@ pub use tools::{BrowserComputerUseConfig, BrowserConfig, ComposioConfig, CurlConfig, GitbooksConfig,HttpHeader, HttpRequestConfig, IntegrationToggle, IntegrationsConfig, McpAuthConfig,McpClientConfig, McpClientIdentityConfig, McpServerConfig, MultimodalConfig,- MultimodalFileConfig, SearchConfig, SearchEngine, SearchEngineCredentials, SearxngConfig, SEARCH_PROVIDERS,+ MultimodalFileConfig, SearchConfig, SearchEngine, SearchEngineCredentials, SearxngConfig,SecretsConfig, SeltzConfig, WebSearchConfig, COMPOSIO_MODE_BACKEND, COMPOSIO_MODE_DIRECT,SEARCH_ENGINE_BRAVE, SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED,- SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY,+ SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS,};pub use update::{UpdateConfig, UpdateRestartStrategy};pub use web_chat_config::WebChatConfig;diff --git a/crates/openhuman-core/src/modules/registry.rs b/crates/openhuman-core/src/modules/registry.rsindex c34c3d8a53..12dc98ba60 100644--- a/crates/openhuman-core/src/modules/registry.rs+++ b/crates/openhuman-core/src/modules/registry.rs@@ -52,14 +52,12 @@ use records_extra::{TINYBOX, TINYCHANNELS, TINYHOSTS};use records_mcp_connectors::{TINYCONNECTORS, TINYMCP};use records_memory_juice::{TINYJUICE, TINYMEMORY};use records_runtime::{TINYRUNTIME, TINYRUNTIME_NODEJS, TINYRUNTIME_PYTHON};-use records_search::TINYSEARCH;use records_voice::TINYVOICE;/// Every module this build can load.pub const ALL: &[ModuleRecord] = &[TINYDESKTOP,TINYBROWSER,- TINYSEARCH,TINYDOCS,TINYWALLET,TINYMEMORY,diff --git a/crates/openhuman-core/src/modules/search.rs b/crates/openhuman-core/src/modules/search.rsindex e693e01a43..913ab5374f 100644--- a/crates/openhuman-core/src/modules/search.rs+++ b/crates/openhuman-core/src/modules/search.rs@@ -287,172 +287,5 @@ pub async fn execute_tool(}#[cfg(test)]-mod tests {- use super::*;-- fn config_in(dir: &std::path::Path) -> Config {- let mut config = Config::default();- config.config_path = dir.join("config.toml");- config.workspace_dir = dir.join("workspace");- config.secrets.encrypt = false;- config- }-- #[test]- fn direct_provider_config_keeps_limits_and_private_key() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.search.enabled_providers = Some(["parallel".to_owned()].into());- config.search.parallel.api_key = Some("test-secret".into());- config.search.max_results = 12;- config.search.timeout_secs = 22;- let payload = module_config(&config);- let parallel = &payload.providers["parallel"];- assert!(parallel.enabled);- assert_eq!(parallel.route, ProviderRoute::Direct);- assert_eq!(parallel.credential.as_deref(), Some("test-secret"));- assert_eq!(parallel.max_results, Some(12));- assert_eq!(parallel.timeout_secs, Some(22));- assert!(!format!("{payload:?}").contains("test-secret"));- }-- #[test]- fn synchronous_tool_specs_follow_provider_selection() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.search.enabled_providers = Some(["parallel".to_owned()].into());- config.search.parallel.api_key = Some("test-secret".into());- let specs = configured_tool_specs(&config);- assert!(specs.iter().any(|spec| spec.name == "parallel_search"));- config.search.enabled_providers = Some(Default::default());- assert!(configured_tool_specs(&config).is_empty());- }-- #[test]- fn managed_presentation_targets_backend_parallel() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.search.presentation = "one_provider".into();- config.search.presentation_provider = Some("managed".into());- let payload = module_config(&config);- assert_eq!(payload.presentation.provider.as_deref(), Some("parallel"));- }-- #[test]- fn managed_route_survives_parallel_selection_without_direct_key() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- crate::security::credentials::api_key::store_api_key(&config, "backend-sentinel").unwrap();- config.search.enabled_providers = Some(["managed".into(), "parallel".into()].into());- let payload = module_config(&config);- assert!(payload.providers["parallel"].enabled);- assert_eq!(payload.providers["parallel"].route, ProviderRoute::Backend);- assert!(payload.providers["parallel"].credential.is_none());- }-- #[test]- fn explicit_tinyfish_selection_overrides_legacy_toggle() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.integrations.tinyfish.enabled = false;- config.search.enabled_providers = Some(["tinyfish".into()].into());- assert!(module_config(&config).providers["tinyfish"].enabled);- config.search.enabled_providers = None;- assert!(!module_config(&config).providers["tinyfish"].enabled);- }-- #[tokio::test]- async fn configured_calls_keep_the_lock_through_invocation() {- use std::sync::{Arc, Mutex};- let active = Arc::new(Mutex::new(String::new()));- let (a_entered_tx, a_entered_rx) = tokio::sync::oneshot::channel();- let (release_a_tx, release_a_rx) = tokio::sync::oneshot::channel();- let a_active = active.clone();- let a = tokio::spawn(async move {- with_module_lock(|| async move {- *a_active.lock().unwrap() = "A".into();- a_entered_tx.send(()).unwrap();- release_a_rx.await.unwrap();- assert_eq!(*a_active.lock().unwrap(), "A");- Ok::<_, String>(())- })- .await- .unwrap();- });- a_entered_rx.await.unwrap();- let b_active = active.clone();- let (b_started_tx, b_started_rx) = tokio::sync::oneshot::channel();- let b = tokio::spawn(async move {- b_started_tx.send(()).unwrap();- with_module_lock(|| async move {- *b_active.lock().unwrap() = "B".into();- Ok::<_, String>(())- })- .await- .unwrap();- });- b_started_rx.await.unwrap();- tokio::task::yield_now().await;- assert_eq!(*active.lock().unwrap(), "A");- release_a_tx.send(()).unwrap();- a.await.unwrap();- b.await.unwrap();- assert_eq!(*active.lock().unwrap(), "B");- }-- #[test]- fn gemini_deep_research_keeps_direct_key_on_backend_grounded_route() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.search.enabled_providers = Some(["gemini".to_owned()].into());- config.search.gemini_route = "backend".into();- config.search.gemini.api_key = Some("test-secret".into());- let payload = module_config(&config);- let deep = &payload.providers["gemini_deep_research"];- assert!(deep.enabled);- assert_eq!(deep.route, ProviderRoute::Direct);- assert_eq!(deep.credential.as_deref(), Some("test-secret"));- }-- #[test]- fn backend_api_key_uses_x_api_key_mode() {- let dir = tempfile::tempdir().unwrap();- let config = config_in(dir.path());- crate::security::credentials::api_key::store_api_key(&config, "test-backend-key").unwrap();- let payload = module_config(&config);- assert_eq!(payload.backend.auth_mode, BackendAuthMode::ApiKey);- assert_eq!(- payload.backend.credential.as_deref(),- Some("test-backend-key")- );- assert!(!format!("{payload:?}").contains("test-backend-key"));- }-- #[test]- fn explicit_provider_set_controls_separate_search_engines() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.seltz.enabled = true;- config.seltz.api_key = Some("test-secret".into());- config.searxng.enabled = true;- config.search.enabled_providers = Some(Default::default());- let payload = module_config(&config);- assert!(!payload.providers["seltz"].enabled);- assert!(!payload.providers["searxng"].enabled);- config.search.enabled_providers = Some(["seltz".to_owned()].into());- let payload = module_config(&config);- assert!(payload.providers["seltz"].enabled);- assert!(!payload.providers["searxng"].enabled);- }-- #[test]- fn legacy_disabled_removes_all_module_tools() {- let dir = tempfile::tempdir().unwrap();- let mut config = config_in(dir.path());- config.search.engine = "disabled".into();- config.search.parallel.api_key = Some("test-secret".into());- let payload = module_config(&config);- assert!(!payload.enabled);- assert!(payload.providers.values().all(|provider| !provider.enabled));- }-}+#[path = "search_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/modules/search_tests.rs b/crates/openhuman-core/src/modules/search_tests.rsnew file mode 100644index 0000000000..37a84dbb24--- /dev/null+++ b/crates/openhuman-core/src/modules/search_tests.rs@@ -0,0 +1,167 @@+use super::*;++fn config_in(dir: &std::path::Path) -> Config {+ let mut config = Config::default();+ config.config_path = dir.join("config.toml");+ config.workspace_dir = dir.join("workspace");+ config.secrets.encrypt = false;+ config+}++#[test]+fn direct_provider_config_keeps_limits_and_private_key() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.search.enabled_providers = Some(["parallel".to_owned()].into());+ config.search.parallel.api_key = Some("test-secret".into());+ config.search.max_results = 12;+ config.search.timeout_secs = 22;+ let payload = module_config(&config);+ let parallel = &payload.providers["parallel"];+ assert!(parallel.enabled);+ assert_eq!(parallel.route, ProviderRoute::Direct);+ assert_eq!(parallel.credential.as_deref(), Some("test-secret"));+ assert_eq!(parallel.max_results, Some(12));+ assert_eq!(parallel.timeout_secs, Some(22));+ assert!(!format!("{payload:?}").contains("test-secret"));+}++#[test]+fn synchronous_tool_specs_follow_provider_selection() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.search.enabled_providers = Some(["parallel".to_owned()].into());+ config.search.parallel.api_key = Some("test-secret".into());+ let specs = configured_tool_specs(&config);+ assert!(specs.iter().any(|spec| spec.name == "parallel_search"));+ config.search.enabled_providers = Some(Default::default());+ assert!(configured_tool_specs(&config).is_empty());+}++#[test]+fn managed_presentation_targets_backend_parallel() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.search.presentation = "one_provider".into();+ config.search.presentation_provider = Some("managed".into());+ let payload = module_config(&config);+ assert_eq!(payload.presentation.provider.as_deref(), Some("parallel"));+}++#[test]+fn managed_route_survives_parallel_selection_without_direct_key() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ crate::security::credentials::api_key::store_api_key(&config, "backend-sentinel").unwrap();+ config.search.enabled_providers = Some(["managed".into(), "parallel".into()].into());+ let payload = module_config(&config);+ assert!(payload.providers["parallel"].enabled);+ assert_eq!(payload.providers["parallel"].route, ProviderRoute::Backend);+ assert!(payload.providers["parallel"].credential.is_none());+}++#[test]+fn explicit_tinyfish_selection_overrides_legacy_toggle() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.integrations.tinyfish.enabled = false;+ config.search.enabled_providers = Some(["tinyfish".into()].into());+ assert!(module_config(&config).providers["tinyfish"].enabled);+ config.search.enabled_providers = None;+ assert!(!module_config(&config).providers["tinyfish"].enabled);+}++#[tokio::test]+async fn configured_calls_keep_the_lock_through_invocation() {+ use std::sync::{Arc, Mutex};+ let active = Arc::new(Mutex::new(String::new()));+ let (a_entered_tx, a_entered_rx) = tokio::sync::oneshot::channel();+ let (release_a_tx, release_a_rx) = tokio::sync::oneshot::channel();+ let a_active = active.clone();+ let a = tokio::spawn(async move {+ with_module_lock(|| async move {+ *a_active.lock().unwrap() = "A".into();+ a_entered_tx.send(()).unwrap();+ release_a_rx.await.unwrap();+ assert_eq!(*a_active.lock().unwrap(), "A");+ Ok::<_, String>(())+ })+ .await+ .unwrap();+ });+ a_entered_rx.await.unwrap();+ let b_active = active.clone();+ let (b_started_tx, b_started_rx) = tokio::sync::oneshot::channel();+ let b = tokio::spawn(async move {+ b_started_tx.send(()).unwrap();+ with_module_lock(|| async move {+ *b_active.lock().unwrap() = "B".into();+ Ok::<_, String>(())+ })+ .await+ .unwrap();+ });+ b_started_rx.await.unwrap();+ tokio::task::yield_now().await;+ assert_eq!(*active.lock().unwrap(), "A");+ release_a_tx.send(()).unwrap();+ a.await.unwrap();+ b.await.unwrap();+ assert_eq!(*active.lock().unwrap(), "B");+}++#[test]+fn gemini_deep_research_keeps_direct_key_on_backend_grounded_route() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.search.enabled_providers = Some(["gemini".to_owned()].into());+ config.search.gemini_route = "backend".into();+ config.search.gemini.api_key = Some("test-secret".into());+ let payload = module_config(&config);+ let deep = &payload.providers["gemini_deep_research"];+ assert!(deep.enabled);+ assert_eq!(deep.route, ProviderRoute::Direct);+ assert_eq!(deep.credential.as_deref(), Some("test-secret"));+}++#[test]+fn backend_api_key_uses_x_api_key_mode() {+ let dir = tempfile::tempdir().unwrap();+ let config = config_in(dir.path());+ crate::security::credentials::api_key::store_api_key(&config, "test-backend-key").unwrap();+ let payload = module_config(&config);+ assert_eq!(payload.backend.auth_mode, BackendAuthMode::ApiKey);+ assert_eq!(+ payload.backend.credential.as_deref(),+ Some("test-backend-key")+ );+ assert!(!format!("{payload:?}").contains("test-backend-key"));+}++#[test]+fn explicit_provider_set_controls_separate_search_engines() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.seltz.enabled = true;+ config.seltz.api_key = Some("test-secret".into());+ config.searxng.enabled = true;+ config.search.enabled_providers = Some(Default::default());+ let payload = module_config(&config);+ assert!(!payload.providers["seltz"].enabled);+ assert!(!payload.providers["searxng"].enabled);+ config.search.enabled_providers = Some(["seltz".to_owned()].into());+ let payload = module_config(&config);+ assert!(payload.providers["seltz"].enabled);+ assert!(!payload.providers["searxng"].enabled);+}++#[test]+fn legacy_disabled_removes_all_module_tools() {+ let dir = tempfile::tempdir().unwrap();+ let mut config = config_in(dir.path());+ config.search.engine = "disabled".into();+ config.search.parallel.api_key = Some("test-secret".into());+ let payload = module_config(&config);+ assert!(!payload.enabled);+ assert!(payload.providers.values().all(|provider| !provider.enabled));+}diff --git a/crates/openhuman-embed/tests/common/mod.rs b/crates/openhuman-embed/tests/common/mod.rsindex 00cde7e03c..b3fd3d5b07 100644--- a/crates/openhuman-embed/tests/common/mod.rs+++ b/crates/openhuman-embed/tests/common/mod.rs@@ -125,9 +125,12 @@ pub fn tool_results(request: &wiremock::Request) -> String {Some("tool") => Some(content),// The harness may prepend continuation guidance and// the active user request before the tool-result block.- Some("user") if content.contains(PROMPT_TOOL_RESULTS_PREFIX) => {- Some(content.split_once(PROMPT_TOOL_RESULTS_PREFIX)?.1.to_string())- }+ Some("user") if content.contains(PROMPT_TOOL_RESULTS_PREFIX) => Some(+ content+ .split_once(PROMPT_TOOL_RESULTS_PREFIX)?+ .1+ .to_string(),+ ),_ => None,}})diff --git a/scripts/ci/check-gated-test-allowlist.sh b/scripts/ci/check-gated-test-allowlist.shindex ad06dce328..a24b30af56 100755--- a/scripts/ci/check-gated-test-allowlist.sh+++ b/scripts/ci/check-gated-test-allowlist.sh@@ -19,6 +19,8 @@ EXPECTED=$(cat <<'EOF'agent/harness/builtin_definitions_tests.rsagent/harness/definition_tests.rsagent/session_host/builder/factory.rs+agent/session_host/runtime_session.rs+agent/session_host/runtime_session_tests.rsagent/session_host/turn/tools.rsagent/subagent_host/tool_prep_tests.rsagent/registry/agents/loader.rsdiff --git a/tests/config_auth_app_state_connectivity_e2e.rs b/tests/config_auth_app_state_connectivity_e2e.rsindex 08aa64a17c..0110d7b5e5 100644--- a/tests/config_auth_app_state_connectivity_e2e.rs+++ b/tests/config_auth_app_state_connectivity_e2e.rs@@ -3141,18 +3141,9 @@ async fn config_runtime_flags_settings_readbacks_and_validation_paths_are_exerci).await;let valid_search_payload = payload(&valid_search, "update_search_settings valid");- assert_eq!(- valid_search_payload.pointer("/config/search/engine"),- Some(&json!("brave"))- );- assert_eq!(- valid_search_payload.pointer("/config/search/max_results"),- Some(&json!(12))- );- assert_eq!(- valid_search_payload.pointer("/config/search/timeout_secs"),- Some(&json!(42))- );+ assert_eq!(valid_search_payload.get("engine"), Some(&json!("brave")));+ assert_eq!(valid_search_payload.get("max_results"), Some(&json!(12)));+ assert_eq!(valid_search_payload.get("timeout_secs"), Some(&json!(42)));let search_readback = rpc(&harness.rpc_base,11_026,@@ -3217,10 +3208,7 @@ async fn config_runtime_flags_settings_readbacks_and_validation_paths_are_exerci).await;let select_tavily_payload = payload(&select_tavily, "select Tavily search engine");- assert_eq!(- select_tavily_payload.pointer("/config/search/engine"),- Some(&json!("tavily"))- );+ assert_eq!(select_tavily_payload.get("engine"), Some(&json!("tavily")));let tavily_readback = rpc(&harness.rpc_base,11_127,@@ -3261,7 +3249,7 @@ async fn config_runtime_flags_settings_readbacks_and_validation_paths_are_exerci.await;let allow_all_payload = payload(&allow_all_search, "update_search_settings allow_all");assert_eq!(- allow_all_payload.pointer("/config/http_request/allowed_domains"),+ allow_all_payload.get("allowed_domains"),Some(&json!(["*"])));assert_error_contains(