fix(wechat): guard ambiguous memory recall and scheduled task execution

Skip memory injection for short filler messages, demote page-workflow memory
pollution, keep scheduled automation off page.generate, and fail scheduled
tasks that only return clarification instead of deliverables.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-01 22:49:52 +08:00
parent dcf83e9b6f
commit 26fe5912a3
9 changed files with 222 additions and 0 deletions
+13
View File
@@ -4,6 +4,7 @@ import {
buildScheduledTaskExecutionPrompt,
extractScheduledTaskDeliveryText,
formatScheduledTaskDeliveryMessage,
looksLikeScheduledTaskNonDelivery,
} from './scheduled-task-executor.mjs';
test('buildScheduledTaskExecutionPrompt includes task spec and automation marker', () => {
@@ -19,6 +20,18 @@ test('buildScheduledTaskExecutionPrompt includes task spec and automation marker
assert.match(text, /每日新闻页/);
assert.match(text, /搜索今日新闻并生成 HTML 页面/);
assert.match(text, /Scheduled Automation/);
assert.match(text, /禁止调用 scheduled_task_create/);
});
test('looksLikeScheduledTaskNonDelivery detects clarification replies', () => {
assert.equal(
looksLikeScheduledTaskNonDelivery('请问 7月31日具体几点执行这个任务?'),
true,
);
assert.equal(
looksLikeScheduledTaskNonDelivery('页面已生成:https://example.com/news.html'),
false,
);
});
test('extractScheduledTaskDeliveryText reads last assistant message', () => {