Lightweight coding agent that runs in your terminal
Rust
Avoid `AbsolutePathBuf::parent()` panic under `EMFILE` by skipping re-absolutization (#12647)
Eric Trauta4076ab4b124
diff --git a/codex-rs/utils/absolute-path/src/lib.rs b/codex-rs/utils/absolute-path/src/lib.rsindex 28b4f39a53..1ba1c40cfb 100644--- a/codex-rs/utils/absolute-path/src/lib.rs+++ b/codex-rs/utils/absolute-path/src/lib.rs@@ -69,8 +69,11 @@ impl AbsolutePathBuf {pub fn parent(&self) -> Option<Self> {self.0.parent().map(|p| {- #[expect(clippy::expect_used)]- Self::from_absolute_path(p).expect("parent of AbsolutePathBuf must be absolute")+ debug_assert!(+ p.is_absolute(),+ "parent of AbsolutePathBuf must be absolute"+ );+ Self(p.to_path_buf())})}