From 9a3c71ee6d455276cc1d2c00c22f6fee42154adc Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Tue, 23 Jun 2026 10:56:58 +0800 Subject: [PATCH] fix: prefer root secret sources from tool worktrees (#732) Co-authored-by: Codex --- scripts/src/hwlab-node-impl.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/src/hwlab-node-impl.ts b/scripts/src/hwlab-node-impl.ts index 8dca2028..0e6e2d96 100644 --- a/scripts/src/hwlab-node-impl.ts +++ b/scripts/src/hwlab-node-impl.ts @@ -6505,10 +6505,14 @@ function readLocalPostgresPasswordMaterial(input: { sourceRef: string; sourceKey } function localSecretSourcePaths(sourceRef: string): string[] { - const paths = [join(repoRoot, ".state", "secrets", sourceRef)]; const marker = "/.worktree/"; const index = repoRoot.indexOf(marker); - if (index >= 0) paths.push(join(repoRoot.slice(0, index), ".state", "secrets", sourceRef)); + const paths = index >= 0 + ? [ + join(repoRoot.slice(0, index), ".state", "secrets", sourceRef), + join(repoRoot, ".state", "secrets", sourceRef), + ] + : [join(repoRoot, ".state", "secrets", sourceRef)]; return [...new Set(paths)]; }