From a27a2a5daa2a9ee4528a516029c22475fcc356f2 Mon Sep 17 00:00:00 2001 From: MLittleprince Date: Fri, 28 Aug 2026 11:53:22 +0800 Subject: [PATCH 1/3] fix: publish local plugin release notes in English --- .../scripts/draft-local-plugin-release-notes.mjs | 8 +++++--- .../draft-local-plugin-release-notes.test.mjs | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/scripts/draft-local-plugin-release-notes.mjs b/.github/scripts/draft-local-plugin-release-notes.mjs index 5ba2d6af0..1af198988 100644 --- a/.github/scripts/draft-local-plugin-release-notes.mjs +++ b/.github/scripts/draft-local-plugin-release-notes.mjs @@ -760,7 +760,7 @@ function categoriesFromReleaseItems(items) { for (const category of RELEASE_CATEGORY_ORDER) { const categoryItems = items.filter((item) => item.category === category); if (categoryItems.length === 0) continue; - releaseCategories[category] = categoryItems.map((item) => item.text_cn); + releaseCategories[category] = categoryItems.map((item) => item.text_en); const docCategory = RELEASE_TO_DOC_CATEGORY[category]; docsCategories.cn[docCategory] = categoryItems.map((item) => item.text_cn); docsCategories.en[docCategory] = categoryItems.map((item) => item.text_en); @@ -1039,7 +1039,7 @@ function markdownFromReleaseItems(items, coverage) { lines.push(""); lines.push(`### ${category}`); for (const item of categoryItems) { - lines.push(`- ${item.text_cn}`); + lines.push(`- ${item.text_en}`); } } lines.push(""); @@ -1237,7 +1237,9 @@ export function manualDraftFromNotes(notes, evidence) { validation_report: validationReport, validation_attempt_count: 1, repair_attempt_count: 0, - release_notes_markdown: ensureSourceHint(text), + release_notes_markdown: ensureSourceHint( + markdownFromReleaseItems(draft.release_items, draft.coverage), + ), }; } diff --git a/.github/scripts/draft-local-plugin-release-notes.test.mjs b/.github/scripts/draft-local-plugin-release-notes.test.mjs index f88845035..ad89d99a0 100644 --- a/.github/scripts/draft-local-plugin-release-notes.test.mjs +++ b/.github/scripts/draft-local-plugin-release-notes.test.mjs @@ -392,6 +392,9 @@ test("postprocesses a single misclassified performance item into Improved", () = assert.equal(processed.release_items[0].category, "Improved"); assert.match(processed.release_items[0].text_cn, /向量扫描性能优化/); assert.match(processed.release_notes_markdown, /### Improved/); + assert.doesNotMatch(processed.release_categories.Improved[0], /[\u3400-\u9fff]/u); + assert.match(processed.docs_categories.cn.Improvements[0], /[\u3400-\u9fff]/u); + assert.doesNotMatch(processed.docs_categories.en.Improvements[0], /[\u3400-\u9fff]/u); }); test("postprocesses mixed endpoint and auth fixes without dropping either concern", () => { @@ -554,6 +557,9 @@ test("repairs postprocessed language validation issues with exact context", asyn ["text_cn", "text_en"], ); assert.equal(requests[1].release_notes_repair_context.previous_release_items[0].source_refs[0], "abc1234"); + const visibleNotes = result.release_notes_markdown.split("/, + )?.[1]; + assert.ok(embeddedJson, "release notes should retain the hidden bilingual payload"); + const embeddedPayload = JSON.parse(embeddedJson); + assert.equal(embeddedPayload.items[0].text_cn, "修复 Hermes 桥接状态恢复。"); + assert.equal(embeddedPayload.items[0].text_en, "Restores Hermes bridge state."); + assert.deepEqual(embeddedPayload.items[0].source_refs, ["abc1234"]); assert.match(draft.release_notes_markdown, /source-id=openclaw-local-plugin/); assert.throws(