feat(wechat): add WX gate evidence and v1.49 103 cutover runbook
Prioritize scheduled-task intent over page.generate for automation phrases, add run-wechat-gate-evidence.mjs for WX-01..13, and document 103 maintenance-window steps for Goose v1.49. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,15 +19,16 @@ export async function handleWechatScheduledTaskIntent({
|
||||
if (!scheduledTaskService) return null;
|
||||
|
||||
const agentText = String(intent?.agentText ?? '').trim();
|
||||
if (isPageGenerateText(agentText)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const timezone = env.H5_DEFAULT_TIMEZONE || 'Asia/Shanghai';
|
||||
const taskIntent = parseScheduledTaskIntent(agentText, {
|
||||
timezone,
|
||||
});
|
||||
if (!isScheduledTaskIntent(taskIntent)) return null;
|
||||
if (!isScheduledTaskIntent(taskIntent)) {
|
||||
if (isPageGenerateText(agentText)) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
if (taskIntent.action === 'list_scheduled_tasks') {
|
||||
|
||||
@@ -36,6 +36,23 @@ test('handleWechatScheduledTaskIntent passes incomplete create requests to goose
|
||||
assert.equal(reply, null);
|
||||
});
|
||||
|
||||
test('handleWechatScheduledTaskIntent passes scheduled page automation to goose even when page keywords appear', async () => {
|
||||
const reply = await handleWechatScheduledTaskIntent({
|
||||
intent: {
|
||||
msgType: 'text',
|
||||
agentText: '我想创建一个定时执行任务,今晚 21:45 分执行做新闻页面',
|
||||
msgId: 'msg-sched-page-1',
|
||||
},
|
||||
user: { userId: 'user-1' },
|
||||
scheduledTaskService: {
|
||||
async listTasks() {
|
||||
throw new Error('should not list for create_scheduled_task');
|
||||
},
|
||||
},
|
||||
});
|
||||
assert.equal(reply, null);
|
||||
});
|
||||
|
||||
test('handleWechatScheduledTaskIntent yields page.generate requests to cursor/goose path', async () => {
|
||||
const reply = await handleWechatScheduledTaskIntent({
|
||||
intent: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isScheduledTaskIntent, parseScheduledTaskIntent } from '../../scheduled-task-intent.mjs';
|
||||
import { parseWechatChannelPrefix, WECHAT_CHANNEL_PREFIX } from './channel-prefix.mjs';
|
||||
import {
|
||||
CONNECTIVITY_TEST_PATTERN,
|
||||
@@ -80,6 +81,10 @@ export function classifyWechatIntent(intent) {
|
||||
wantsDocx: wantsDocxDownload(text),
|
||||
}, channelPrefix);
|
||||
}
|
||||
const scheduledTaskIntent = parseScheduledTaskIntent(text);
|
||||
if (isScheduledTaskIntent(scheduledTaskIntent)) {
|
||||
return withChannelMeta({ kind: 'chat.general', text }, channelPrefix);
|
||||
}
|
||||
if (isPageGenerateText(text)) {
|
||||
return withChannelMeta({
|
||||
kind: 'page.generate',
|
||||
|
||||
Reference in New Issue
Block a user