fix: fix accept_elicitation_for_prompt_rule() test

This commit is contained in:
Michael Bolin
2025-12-10 11:35:08 -08:00
parent cb9a189857
commit cd2b7e7f5c
4 changed files with 23 additions and 11 deletions
+17 -1
View File
@@ -1,3 +1,4 @@
use assert_cmd::assert;
use codex_core::MCP_SANDBOX_STATE_NOTIFICATION;
use codex_core::SandboxState;
use codex_core::protocol::SandboxPolicy;
@@ -23,7 +24,10 @@ use std::sync::Arc;
use std::sync::Mutex;
use tokio::process::Command;
pub fn create_transport<P>(codex_home: P) -> anyhow::Result<TokioChildProcess>
pub async fn create_transport<P>(
codex_home: P,
dotslash_cache: P,
) -> anyhow::Result<TokioChildProcess>
where
P: AsRef<Path>,
{
@@ -36,11 +40,23 @@ where
.join("suite")
.join("bash");
// Need to ensure the artifact associated with the bash DotSlash file is
// available before it is run in a read-only sandbox.
let status = Command::new("dotslash")
.arg("--")
.arg("fetch")
.arg(bash.clone())
.env("DOTSLASH_CACHE", dotslash_cache.as_ref())
.status()
.await?;
assert!(status.success(), "dotslash fetch failed: {status:?}");
let transport =
TokioChildProcess::new(Command::new(mcp_executable.get_program()).configure(|cmd| {
cmd.arg("--bash").arg(bash);
cmd.arg("--execve").arg(execve_wrapper.get_program());
cmd.env("CODEX_HOME", codex_home.as_ref());
cmd.env("DOTSLASH_CACHE", dotslash_cache.as_ref());
// Important: pipe stdio so rmcp can speak JSON-RPC over stdin/stdout
cmd.stdin(Stdio::piped());