Run package updates outside the project on non-Windows platforms (#58403)

## Why

Package managers search parent directories for project configuration and hooks, which can influence Codex updates launched from a project directory.

## What changed

Run non-Windows update commands with `/` as their working directory.

## Testing

Add a regression test using a fake `pnpm` executable to verify that updates run outside the project even when `TMPDIR` points into it.

GitOrigin-RevId: a39b36872a62f2404aadd0614e1486d0755636fc
This commit is contained in:
viyatb-oai
2026-10-30 18:12:10 +00:00
committed by copyberry
parent a94ba8bdd0
commit e7b8d3a36d
2 changed files with 34 additions and 0 deletions
+2
View File
@@ -848,6 +848,8 @@ fn run_update_action(
.collect();
std::process::Command::new(&command_path)
.args(&normalized_args)
// Package managers search parent directories for project config and hooks.
.current_dir("/")
.status()?
}
};