fix(codex): compare strict preflight paths by realpath (#3060)

Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
This commit is contained in:
Alexzhu
2026-06-01 22:01:13 -07:00
committed by GitHub
co-authored by Steven Enamakel
parent a7d42f52d0
commit da65322f4f
+17 -1
View File
@@ -41,6 +41,22 @@ function runCheck(label, ok, details = '') {
return { label, ok, details };
}
function sameFilesystemPath(left, right) {
let resolvedLeft;
let resolvedRight;
try {
resolvedLeft = fs.realpathSync(left);
} catch {
resolvedLeft = path.resolve(left);
}
try {
resolvedRight = fs.realpathSync(right);
} catch {
resolvedRight = path.resolve(right);
}
return resolvedLeft === resolvedRight;
}
function summarize(checks) {
const failed = checks.filter((check) => !check.ok);
for (const check of checks) {
@@ -75,7 +91,7 @@ function main() {
checks.push(runCheck('working directory exists', fs.existsSync(repoRoot), repoRoot));
if (options.strictPath) {
checks.push(runCheck('expected repo path', path.resolve(repoRoot) === path.resolve(options.expectedPath), `expected ${options.expectedPath}, got ${repoRoot}`));
checks.push(runCheck('expected repo path', sameFilesystemPath(repoRoot, options.expectedPath), `expected ${options.expectedPath}, got ${repoRoot}`));
}
for (const file of REQUIRED_FILES) {