diff --git a/codex-rs/core/src/tools/runtimes/unified_exec.rs b/codex-rs/core/src/tools/runtimes/unified_exec.rs index ed813f3f27..2a4c29fd01 100644 --- a/codex-rs/core/src/tools/runtimes/unified_exec.rs +++ b/codex-rs/core/src/tools/runtimes/unified_exec.rs @@ -103,6 +103,13 @@ pub struct UnifiedExecRuntime<'a> { shell_mode: UnifiedExecShellMode, } +/// Lifecycle callback surface that lets unified exec mirror its generic spawn +/// lifecycle into a resolved plugin-script execution. +/// +/// Implementations must preserve the caller-provided callback order: unified +/// exec invokes the generic `SpawnLifecycle` first, then forwards the matching +/// plugin callback. Terminal callbacks may be repeated by cleanup paths, so +/// implementations must keep cancellation and finish handling idempotent. trait PluginScriptLifecycle: Send + Sync { fn mark_started(&self); fn mark_cancelled(&self); @@ -935,7 +942,7 @@ mod tests { proposed_execpolicy_amendment: None, }, ); - request.environment = Arc::new( + request.turn_environment.environment = Arc::new( Environment::create_for_tests(Some("ws://127.0.0.1:1/remote-exec-server".to_string())) .expect("remote environment"), );