mirror of
https://github.com/openai/codex.git
synced 2026-04-27 09:51:03 +03:00
Validate remote exec-server cwd during startup
Fail fast when a remote exec-server cannot see the configured thread cwd. This catches the most dangerous split-brain state before user instructions, skills, or tool processes are resolved from the wrong filesystem. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -546,6 +546,15 @@ impl Codex {
|
||||
.current()
|
||||
.await
|
||||
.map_err(|err| CodexErr::Fatal(format!("failed to create environment: {err}")))?;
|
||||
if let Some(environment) = environment.as_ref()
|
||||
&& environment.is_remote()
|
||||
&& let Err(err) = environment.get_filesystem().get_metadata(&config.cwd).await
|
||||
{
|
||||
return Err(CodexErr::Fatal(format!(
|
||||
"remote exec-server cannot access cwd `{}`: {err}",
|
||||
config.cwd.display()
|
||||
)));
|
||||
}
|
||||
let user_instructions = get_user_instructions(&config, environment.as_deref()).await;
|
||||
|
||||
let exec_policy = if crate::guardian::is_guardian_reviewer_source(&session_source) {
|
||||
|
||||
Reference in New Issue
Block a user