fix: hide preserved path masks from git status

Represent missing .agents and .codex preserved path masks as read-only empty directories instead of empty files so Git ignores them while cleanup still removes the host mount targets after bwrap exits.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
viyatb-oai
2026-04-27 08:41:47 -07:00
committed by Eva Wong
co-authored by Codex
parent 87266432a0
commit eb7a3bfa0c
4 changed files with 198 additions and 41 deletions
+4
View File
@@ -37,6 +37,10 @@ pub fn is_preserved_path_name(name: &OsStr) -> bool {
.any(|preserved| name == OsStr::new(preserved))
}
pub fn is_preserved_directory_path_name(name: &OsStr) -> bool {
name == OsStr::new(PRESERVED_AGENTS_PATH_NAME) || name == OsStr::new(PRESERVED_CODEX_PATH_NAME)
}
/// Returns the preserved workspace metadata name when an agent write to `path`
/// should be blocked before execution.
pub fn forbidden_agent_preserved_path_write(