From e3765948e58022de552b47ae10b3c9e87b0384c0 Mon Sep 17 00:00:00 2001 From: Sven Date: Mon, 16 Mar 2026 20:32:24 +0100 Subject: [PATCH] fix(patches): silence false warnings for already-applied patches - patch-ap-allow-private-address: detect allowPrivateAddress in source - patch-endpoint-posts-ai-cleanup: detect any AI field key variant Co-Authored-By: Claude Opus 4.6 --- scripts/patch-ap-allow-private-address.mjs | 4 ++-- scripts/patch-endpoint-posts-ai-cleanup.mjs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/patch-ap-allow-private-address.mjs b/scripts/patch-ap-allow-private-address.mjs index 5cb57885..292ec58d 100644 --- a/scripts/patch-ap-allow-private-address.mjs +++ b/scripts/patch-ap-allow-private-address.mjs @@ -74,12 +74,12 @@ for (const filePath of candidates) { checked += 1; const source = await readFile(filePath, "utf8"); - if (source.includes(MARKER)) { + if (source.includes(MARKER) || source.includes("allowPrivateAddress")) { continue; } if (!source.includes(OLD_SNIPPET)) { - console.log(`[postinstall] patch-ap-allow-private-address: snippet not found in ${filePath}`); + console.log(`[postinstall] patch-ap-allow-private-address: snippet not found in ${filePath} — skipping`); continue; } diff --git a/scripts/patch-endpoint-posts-ai-cleanup.mjs b/scripts/patch-endpoint-posts-ai-cleanup.mjs index 86acf520..3114f6c8 100644 --- a/scripts/patch-endpoint-posts-ai-cleanup.mjs +++ b/scripts/patch-endpoint-posts-ai-cleanup.mjs @@ -90,8 +90,12 @@ for (const filePath of candidates) { } if (!source.includes(oldSnippet)) { - // Beta.41+ has native AI field cleanup — skip silently - if (source.includes('"ai-text-level"') && source.includes('"ai-code-level"')) { + // Already has AI field cleanup in some form — skip silently + if ( + source.includes('"ai-text-level"') || + source.includes('"aiTextLevel"') || + !source.includes("jf2ToMf2") + ) { continue; } console.warn(