diff --git a/scripts/e2e/lib/upgrade-survivor/assertions.mjs b/scripts/e2e/lib/upgrade-survivor/assertions.mjs index e25e2dbb7e7..7555be70f7a 100644 --- a/scripts/e2e/lib/upgrade-survivor/assertions.mjs +++ b/scripts/e2e/lib/upgrade-survivor/assertions.mjs @@ -337,10 +337,12 @@ function assertStateSurvived() { const stage = process.env.OPENCLAW_UPGRADE_SURVIVOR_ASSERT_STAGE || "survival"; const legacyRuntimeRoot = path.join(stateDir, "plugin-runtime-deps"); if (stage === "baseline") { - assert( - fs.existsSync(path.join(legacyRuntimeRoot, "discord")), - "legacy plugin runtime deps root missing before doctor cleanup", - ); + if (fs.existsSync(legacyRuntimeRoot)) { + assert( + fs.existsSync(path.join(legacyRuntimeRoot, "discord")), + "legacy plugin runtime deps root exists but discord debris is missing before doctor cleanup", + ); + } } else { assert( !fs.existsSync(legacyRuntimeRoot),