fix(wechat): treat report page follow-ups as session continuation
Memind CI / Test, build, and release guards (push) Has been cancelled

Phrases like "解读详细报告,做成页面" now bind to the in-session report
context instead of behaving like a brand-new page topic.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-14 22:53:00 +08:00
parent b97f607817
commit c9b2fcba87
3 changed files with 20 additions and 1 deletions
+10
View File
@@ -32,6 +32,15 @@ export const PAGE_CONTENT_EDIT_PATTERN =
const PAGE_LINK_MISSING_RETRY_PATTERN =
/(?:页面|链接|新闻页|新闻页面|html).{0,16}(?:没有生成|没生成|未生成|没发|未发)/iu;
export const REPORT_PAGE_CONTINUATION_PATTERN =
/(?:解读|分析|说明).{0,12}(?:详细)?(?:报告|化验|检验)|(?:报告|化验|检验).{0,12}(?:解读|做成|生成).{0,8}(?:页面|网页)/iu;
export function isWechatReportPageFollowup(wechatIntent, text) {
const normalized = String(text ?? '').trim();
if (!normalized || wechatIntent?.kind !== 'page.generate') return false;
return REPORT_PAGE_CONTINUATION_PATTERN.test(normalized);
}
export function isWechatPageLinkRetryText(text) {
const normalized = String(text ?? '').trim();
return Boolean(normalized && PAGE_LINK_MISSING_RETRY_PATTERN.test(normalized));
@@ -69,6 +78,7 @@ export function isWechatSessionPageContinuation(wechatIntent, text) {
if (isWechatImmediateContextPageCreate(wechatIntent, normalized)) return true;
if (wechatIntent?.kind === 'page.generate' && isWechatPageEditText(normalized)) return true;
if (wechatIntent?.kind === 'chat.general' && isWechatContentEditFollowup(normalized)) return true;
if (isWechatReportPageFollowup(wechatIntent, normalized)) return true;
return false;
}