fix(wechat): recognize news page intents and harden scheduled task delivery
Memind CI / Test, build, and release guards (push) Failing after 4s
Memind CI / Test, build, and release guards (push) Failing after 4s
Expand page.generate rules for post-page verbs and link-missing retries, recover HTML artifacts when shadow LLM agrees, and stop marking scheduled tasks failed when WeChat notification hits rate limits. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,9 +29,20 @@ export const PAGE_IMMEDIATE_CREATE_PATTERN =
|
||||
export const PAGE_CONTENT_EDIT_PATTERN =
|
||||
/^(?:(?:请|麻烦|可以|能不能)\s*)?(?:(?:帮我|帮忙|给我)\s*)?(?:(?:把|将)\s*)?(?:(?:这个|刚才(?:的)?|上面(?:的)?|前面(?:的)?|它|这首(?:诗)?|这篇(?:文章)?|这段(?:内容)?|诗(?:里|中)?)\s*)?(?:的)?\s*(?:[\p{L}\p{N}]{0,12}\s*)?(?:改|修改|调整|更新|换|加长|缩短|润色)/iu;
|
||||
|
||||
const PAGE_LINK_MISSING_RETRY_PATTERN =
|
||||
/(?:页面|链接|新闻页|新闻页面|html).{0,16}(?:没有生成|没生成|未生成|没发|未发)/iu;
|
||||
|
||||
export function isWechatPageLinkRetryText(text) {
|
||||
const normalized = String(text ?? '').trim();
|
||||
return Boolean(normalized && PAGE_LINK_MISSING_RETRY_PATTERN.test(normalized));
|
||||
}
|
||||
|
||||
export function isWechatPageRetryText(text) {
|
||||
const normalized = String(text ?? '').trim();
|
||||
return Boolean(normalized && PAGE_RETRY_PATTERN.test(normalized));
|
||||
return Boolean(
|
||||
normalized
|
||||
&& (PAGE_RETRY_PATTERN.test(normalized) || isWechatPageLinkRetryText(normalized)),
|
||||
);
|
||||
}
|
||||
|
||||
export function isWechatPageEditText(text) {
|
||||
@@ -53,6 +64,7 @@ export function isWechatImmediateContextPageCreate(wechatIntent, text) {
|
||||
export function isWechatSessionPageContinuation(wechatIntent, text) {
|
||||
const normalized = String(text ?? '').trim();
|
||||
if (!normalized) return false;
|
||||
if (isWechatPageLinkRetryText(normalized)) return true;
|
||||
if (isWechatPageRetryText(normalized)) return true;
|
||||
if (isWechatImmediateContextPageCreate(wechatIntent, normalized)) return true;
|
||||
if (wechatIntent?.kind === 'page.generate' && isWechatPageEditText(normalized)) return true;
|
||||
|
||||
Reference in New Issue
Block a user