From b09ac9b24d6256f74f9f710fd9bbc764e77dec57 Mon Sep 17 00:00:00 2001 From: Derek Pearson Date: Sun, 22 Mar 2026 14:30:08 -0400 Subject: [PATCH] fix(skills): address QA round 2 Widen botched-migration guard from "all copies failed" to "any copies failed" (F2.1). If even one skill fails to copy, the marker is removed so migration retries on the next launch. Previously, a partial failure (e.g., 3 of 5 skills copied) would write the marker, causing the 2 remaining skills to be silently dropped. --- src/resource-loader.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/resource-loader.ts b/src/resource-loader.ts index dfb948d28..c472031a3 100644 --- a/src/resource-loader.ts +++ b/src/resource-loader.ts @@ -494,9 +494,10 @@ function migrateSkillsToEcosystemDir(agentDir: string): void { } } - // If there were skills to migrate but ALL copies failed, remove the marker - // so migration retries on the next launch. Keeps the legacy dir as fallback. - if (candidates > 0 && migrated === 0) { + // If any skills failed to copy, remove the marker so migration retries + // on the next launch. This keeps the legacy dir as fallback until every + // skill has been successfully migrated. + if (migrated < candidates) { try { closeSync(markerFd); markerFd = -1 } catch { /* non-fatal */ } try { unlinkSync(markerPath) } catch { /* non-fatal */ } return