fix(ui): support legacy prompts and publication confirmation

This commit is contained in:
john
2026-07-14 15:05:37 +08:00
parent 77f1ea8350
commit f2d0c99f6c
5 changed files with 105 additions and 1 deletions
+11
View File
@@ -361,6 +361,17 @@ export function stripKnownChatSkillPrompt(text) {
break;
}
}
// Older persisted Page Data messages can contain a prompt from a previous
// template revision. Keep this compatibility path anchored to the stable
// skill header and final delivery sentence so the user's request is not
// mistaken for executor-only instructions.
if (/^请使用\s+page-data-collect\s+技能[:]/u.test(next)) {
const legacyEndMarker = '并说明后台入口与口令。';
const markerIndex = next.indexOf(legacyEndMarker);
if (markerIndex >= 0) {
next = next.slice(markerIndex + legacyEndMarker.length);
}
}
return next.trim();
}