From 8661e3ae1b8a29b4d248744ea8232480fe312ee7 Mon Sep 17 00:00:00 2001 From: scotares Date: Thu, 26 Nov 2026 07:12:13 +0800 Subject: [PATCH] fix(xtask): stop overriding the provided HostPlatform The served profile now points HostPlatform at its isolated home instead of injecting a second process value, so scenario assemblies no longer fail with a duplicate provider. --- xtask/src/app_server.rs | 1 + xtask/src/scenario_eval.rs | 27 ++------------------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/xtask/src/app_server.rs b/xtask/src/app_server.rs index 377f9bc6aa..f5d56e0525 100644 --- a/xtask/src/app_server.rs +++ b/xtask/src/app_server.rs @@ -221,6 +221,7 @@ pub async fn serve_home( startup_timeout: Duration::from_secs(60), ..Default::default() }; + config.platform_home = Some(home.clone()); config.session_defaults.cwd = cwd.to_string_lossy().into_owned(); dim_app_server::cli::product_session_defaults(&mut config.session_defaults); if let Some(defaults) = &run.defaults { diff --git a/xtask/src/scenario_eval.rs b/xtask/src/scenario_eval.rs index 342316709c..56ed8f9cbe 100644 --- a/xtask/src/scenario_eval.rs +++ b/xtask/src/scenario_eval.rs @@ -9787,7 +9787,6 @@ mod tests { HostFuture, ModelConnection, ModelDriver, ModelStopReason, ResolveModelConnection, ResolvedModelConnection, }; - use dim_agent_capabilities::host_platform::{HostPlatform, resolve_shell}; use std::sync::{ Mutex, atomic::{AtomicUsize, Ordering}, @@ -16284,10 +16283,6 @@ mod tests { http: tokio::task::JoinHandle<()>, models: PathBuf, scenarios: PathBuf, - /// The process facts a flow's runs see: the ones this process has, - /// with `home` pointed at the fixture's own empty directory, so a run - /// never reads the developer's `~/AGENTS.md`, Skills list or ``. - platform: HostPlatform, } impl Fixture { /// `scenario` is the scenario file's content and `workspace` the @@ -16385,25 +16380,12 @@ mod tests { serde_json::to_string_pretty(&scenario).unwrap(), ) .unwrap(); - let platform_home = directory.join("platform-home"); - std::fs::create_dir_all(&platform_home).unwrap(); - let env: Vec<_> = std::env::vars_os().collect(); - let shell = resolve_shell(Ok(None), &env).await; - let mut platform = HostPlatform::current(shell) - .unwrap() - .with_execution_settings( - dim_agent_capabilities::execution_settings::ExecutionSettingsHost::fixed( - Default::default(), - ), - ); - platform.home = platform_home; Self { directory, provider, http, models, scenarios, - platform, } } /// [`evaluate`] over this fixture's runs, whose process facts point at @@ -16419,19 +16401,14 @@ mod tests { rejudge( options, options.rejudge.as_deref().expect("a rejudge source"), - |builder| { - builder.process_value(Arc::new(self.platform.clone())); - }, + |_| {}, ) .await } /// [`pooled`] over this fixture's provider, with the same process /// facts as [`evaluate`](Self::evaluate). async fn pooled(&self, options: &Options) -> Result { - pooled(options, |builder| { - builder.process_value(Arc::new(self.platform.clone())); - }) - .await + pooled(options, |_| {}).await } /// The options of one run per arm over this fixture, with `out`. fn options(&self, out: PathBuf) -> Options {