fix: stabilize D601 env reuse planning

This commit is contained in:
lyon
2026-06-16 07:50:51 +08:00
parent acd3411ed0
commit 05f1e8ccd7
2 changed files with 24 additions and 4 deletions
+11 -1
View File
@@ -666,10 +666,20 @@ export async function hashGitPaths(repoRoot, targetRef, paths, options = {}) {
async function hashEnvReuseInputs(repoRoot, targetRef, paths, recipe, options = {}) {
return stableHash({
gitPaths: await hashGitPaths(repoRoot, targetRef, paths, options),
envRecipe: recipe
envRecipe: envReuseIdentityRecipe(recipe)
});
}
function envReuseIdentityRecipe(recipe) {
const identity = JSON.parse(JSON.stringify(recipe ?? {}));
if (identity.downloadStack && typeof identity.downloadStack === "object") {
delete identity.downloadStack.httpProxy;
delete identity.downloadStack.httpsProxy;
delete identity.downloadStack.noProxy;
}
return identity;
}
export async function lastCommitForPaths(repoRoot, targetRef, paths) {
const normalizedPaths = uniqueSorted(paths.map(normalizeRepoPath).filter(Boolean));
if (normalizedPaths.length === 0) return null;