mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +00:00
Support Windows registry overrides for requirements.toml (#55456)
## What changed Read `RequirementsPath` from the 64-bit registry view of `HKLM\SOFTWARE\Policies\OpenAI\Codex` to select the system requirements file on Windows. Require an absolute path and return an error for relative values. If the registry key or value cannot be read, retain the default `OpenAI\Codex\requirements.toml` location under ProgramData. ## Testing Expand absolute-path validation tests to cover empty, drive-relative, and root-relative paths. Update the Windows default-directory test to remain independent of registry overrides. GitOrigin-RevId: c31045d749e32cf266b389245ae4db2440156e8e
This commit is contained in:
@@ -477,10 +477,17 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn from_absolute_path_checked_rejects_relative_path() {
|
||||
let err = AbsolutePathBuf::from_absolute_path_checked("relative/path")
|
||||
.expect_err("relative path should fail");
|
||||
for path in [
|
||||
"",
|
||||
"relative/path",
|
||||
r"C:requirements.toml",
|
||||
r"\requirements.toml",
|
||||
] {
|
||||
let err = AbsolutePathBuf::from_absolute_path_checked(path)
|
||||
.expect_err("relative path should fail");
|
||||
|
||||
assert_eq!(err.kind(), std::io::ErrorKind::InvalidInput);
|
||||
assert_eq!(err.kind(), std::io::ErrorKind::InvalidInput);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user