diff --git a/crates/tui/src/mcp/http_client.rs b/crates/tui/src/mcp/http_client.rs index c54ddee9ea..6cd9f078e6 100644 --- a/crates/tui/src/mcp/http_client.rs +++ b/crates/tui/src/mcp/http_client.rs @@ -549,7 +549,17 @@ mod tests { listener, "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: 2\r\n\r\nok".to_string(), )); - let configured = client(url, false); + // This path proves proxy routing, not a two-second scheduling bound. + let configured = McpHttpClient::new( + url, + false, + false, + false, + None, + Duration::from_secs(5), + Duration::from_secs(10), + ) + .unwrap(); assert_eq!( configured .send(configured.get(url)) diff --git a/crates/tui/src/plugins/tests.rs b/crates/tui/src/plugins/tests.rs index 29698a09d9..e4fdf75dd3 100644 --- a/crates/tui/src/plugins/tests.rs +++ b/crates/tui/src/plugins/tests.rs @@ -1892,7 +1892,6 @@ fn malformed_managed_policy_fails_closed() { #[test] fn managed_policy_path_env_override_is_honored() { - let _lock = crate::test_support::lock_test_env(); let tmp = tempfile::tempdir().unwrap(); let config = config(tmp.path()); write_plugin(&config, ""); @@ -1904,8 +1903,13 @@ fn managed_policy_path_env_override_is_honored() { "the default sibling must stay absent so the override is proven" ); - let _guard = crate::test_support::EnvVarGuard::set(MANAGED_POLICY_PATH_ENV, &custom); - let mut registry = discover_with_config(&config); + let environment = super::context::HostEnvironment::from_entries([( + std::ffi::OsString::from(MANAGED_POLICY_PATH_ENV), + custom.as_os_str().to_os_string(), + )]); + let context = + super::context::PluginDiscoveryContext::from_config_and_environment(&config, environment); + let mut registry = super::discovery::discover_with_context(&config, context); assert_eq!( registry.managed_policy_path(), Some(custom.as_path()), diff --git a/crates/tui/src/route_budget.rs b/crates/tui/src/route_budget.rs index 5d9fc88d3d..fc611a0372 100644 --- a/crates/tui/src/route_budget.rs +++ b/crates/tui/src/route_budget.rs @@ -528,6 +528,9 @@ mod tests { /// conservative compatibility ceiling, with an attributable source. #[test] fn uncatalogued_remote_model_keeps_a_conservative_ceiling() { + let _lock = crate::test_support::lock_test_env(); + let _canonical = crate::test_support::EnvVarGuard::remove("CODEWHALE_MAX_OUTPUT_TOKENS"); + let _legacy = crate::test_support::EnvVarGuard::remove("DEEPSEEK_MAX_OUTPUT_TOKENS"); let source = output_ceiling_source(ApiProvider::Openai, "totally-unknown-alias-v9"); assert_eq!( source, diff --git a/crates/tui/src/runtime_threads/tests.rs b/crates/tui/src/runtime_threads/tests.rs index ab2b5b9b55..4509204597 100644 --- a/crates/tui/src/runtime_threads/tests.rs +++ b/crates/tui/src/runtime_threads/tests.rs @@ -13996,6 +13996,9 @@ async fn terminal_turn_cancels_pending_dynamic_tool_exactly_once() -> Result<()> /// reads as a live claim that the (already answered) call is still waiting. #[tokio::test] async fn approval_wait_heartbeat_is_never_sequenced_after_the_decision() -> Result<()> { + // The timeout test changes a process-wide override to 25 ms. This case + // checks heartbeat ordering while a decision is still pending. + let _timeout_guard = test_approval_timeout_ms(0); let manager = test_manager(test_runtime_dir())?; let thread = manager .create_thread(CreateThreadRequest::default())