From 464bcfec26699dff011d968cea6ee36746288831 Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 2 Sep 2026 19:29:03 -0500 Subject: [PATCH] fix(runner): scope verified runtime inheritance --- .../runner-core/src/acpx_provider_backend.rs | 5 ++++- .../crates/runner-core/src/process_supervisor.rs | 16 ++++++++++++++-- .../runner-core/tests/process_supervisor.rs | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs b/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs index fb8c8c3e79..01e7f05b43 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs @@ -239,7 +239,10 @@ impl AcpxProviderDescriptor { Ok(AcpxSidecarTransportConfig { command: launch_profile.command.clone(), args: launch_profile.args.clone(), - verified_launch: Some(VerifiedProcessLaunch::new(command, verified_args)), + verified_launch: Some( + VerifiedProcessLaunch::new(command, verified_args) + .with_inherited_runtime_executable(), + ), request_timeout: Duration::from_secs(30), shutdown_grace: Duration::from_secs(2), }) diff --git a/packages/paperclip-runner/runner/crates/runner-core/src/process_supervisor.rs b/packages/paperclip-runner/runner/crates/runner-core/src/process_supervisor.rs index d2ad17c50b..42b744ed91 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/src/process_supervisor.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/src/process_supervisor.rs @@ -195,11 +195,21 @@ pub enum VerifiedProcessArgument { pub struct VerifiedProcessLaunch { program: VerifiedProcessArtifact, args: Vec, + inherit_runtime_executable: bool, } impl VerifiedProcessLaunch { pub fn new(program: VerifiedProcessArtifact, args: Vec) -> Self { - Self { program, args } + Self { + program, + args, + inherit_runtime_executable: false, + } + } + + pub fn with_inherited_runtime_executable(mut self) -> Self { + self.inherit_runtime_executable = true; + self } #[cfg(test)] @@ -624,7 +634,9 @@ impl SupervisedProcess { shutdown_grace, max_line_bytes, additional_environment_keys, - Some(&inherited.program), + launch + .inherit_runtime_executable + .then_some(inherited.program.as_path()), ); #[cfg(target_os = "macos")] if let Ok(process) = result.as_mut() { diff --git a/packages/paperclip-runner/runner/crates/runner-core/tests/process_supervisor.rs b/packages/paperclip-runner/runner/crates/runner-core/tests/process_supervisor.rs index 5cb1b63bb1..b871c7bfae 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/tests/process_supervisor.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/tests/process_supervisor.rs @@ -68,7 +68,8 @@ fn verified_launch_uses_open_command_and_script_after_atomic_path_replacement() ) .unwrap(), )], - ); + ) + .with_inherited_runtime_executable(); let replacement_command = directory.join("replacement-command"); let replacement_script = directory.join("replacement-script");