codex: restore legacy shell workdir resolution

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-05-05 14:42:38 -07:00
parent 3b0575d02b
commit 13e887a52b

View File

@@ -80,6 +80,18 @@ where
parse_arguments(arguments)
}
fn resolve_workdir_base_path(
arguments: &str,
cwd: &AbsolutePathBuf,
) -> Result<AbsolutePathBuf, FunctionCallError> {
let target_args: EnvironmentTargetArgs = parse_arguments(arguments)?;
Ok(target_args
.workdir
.as_deref()
.filter(|workdir| !workdir.is_empty())
.map_or_else(|| cwd.clone(), |workdir| cwd.join(workdir)))
}
#[derive(Debug, Deserialize)]
struct EnvironmentTargetArgs {
#[serde(default)]