adding support for reading execpolicy from /etc/codex and .codex of root git repo

This commit is contained in:
kevin zhao
2025-12-08 09:17:15 -08:00
parent 6c9c563faf
commit 9df6dbcb0f
3 changed files with 113 additions and 13 deletions

View File

@@ -221,7 +221,9 @@ fn format_program_name(path: &Path, preserve_program_paths: bool) -> Option<Stri
async fn load_exec_policy() -> anyhow::Result<Policy> {
let codex_home = find_codex_home().context("failed to resolve codex_home for execpolicy")?;
codex_core::load_exec_policy(&codex_home)
let cwd = std::env::current_dir().ok();
codex_core::load_exec_policy(&codex_home, cwd.as_deref())
.await
.map_err(anyhow::Error::from)
}