Separate WeChat chat, page refine, and task flows with explicit routing.
Memind CI / Test, build, and release guards (push) Successful in 4m40s

Add channel prefixes, pin edit targets in Cursor prompts, and force fresh sessions for page refine URLs so DeepSeek/Goose chat history does not pollute page tasks.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-31 14:10:02 +08:00
parent b80584696d
commit 8f88eec2bd
10 changed files with 308 additions and 13 deletions
+18 -4
View File
@@ -46,11 +46,16 @@ import {
resolveSyncReply,
shouldHandleSyncReply,
} from './wechat/handlers/sync-replies.mjs';
import { stripWechatChannelPrefix, WECHAT_CHANNEL_PREFIX } from './wechat/intent/channel-prefix.mjs';
import { classifyWechatIntent } from './wechat/intent/classifier.mjs';
import {
isWechatSessionResetAction,
resolveWechatSessionAction,
} from './wechat/intent/session-action.mjs';
import {
extractMindSpacePublicHtmlPath,
isWechatPageRefineRequestText,
} from './wechat/page-refine-target.mjs';
import { isPageGenerateText, isTopicResetText } from './wechat/intent/patterns.mjs';
import {
isPageDataDevIntent,
@@ -1078,12 +1083,21 @@ function isTopicResetIntent(text) {
}
export function shouldForceNewWechatAgentSession(wechatIntent, resetCandidate) {
return (
if (
wechatIntent?.kind === 'session.reset' ||
isWechatSessionResetAction(wechatIntent?.sessionActionResult) ||
isTopicResetIntent(resetCandidate) ||
isPageDataIntent(resetCandidate)
);
) {
return true;
}
if (wechatIntent?.kind !== 'page.generate') return false;
const text = String(resetCandidate ?? wechatIntent?.topic ?? '').trim();
if (isWechatSessionPageContinuation(wechatIntent, text)) return false;
if (wechatIntent?.channelPrefix === WECHAT_CHANNEL_PREFIX.PAGE) return true;
if (extractMindSpacePublicHtmlPath(text)) return true;
if (isWechatPageRefineRequestText(text)) return true;
return false;
}
export function isWechatImmediateContextFollowup(wechatIntent, text) {
@@ -1384,7 +1398,7 @@ function normalizeWechatInboundIntent(inbound) {
return {
...base,
displayText: content,
agentText: content,
agentText: stripWechatChannelPrefix(content),
};
}
@@ -1393,7 +1407,7 @@ function normalizeWechatInboundIntent(inbound) {
return {
...base,
displayText: recognition ? `语音:${recognition}` : '语音消息',
agentText: recognition,
agentText: stripWechatChannelPrefix(recognition),
media: {
mediaId: inbound?.mediaId || '',
format: inbound?.format || '',