fix(wechat): pass inbound messages to goose and gate side effects at MCP tools
Memind CI / Test, build, and release guards (push) Failing after 14m19s
Memind CI / Test, build, and release guards (push) Failing after 14m19s
Stop ITL regex from intercepting new messages before Agent execution; move scheduled task and schedule write confirmation to MCP tool calls with draft commit on 确认. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -94,22 +94,35 @@ async function main() {
|
||||
|
||||
const drafts = createDraftStore();
|
||||
const scheduleService = createScheduleService();
|
||||
const card = await handleWechatIntentTransaction({
|
||||
const passthrough = await handleWechatIntentTransaction({
|
||||
intent: { agentText: '下午2点半提醒我开项目计划例会', msgId: 'verify-1', msgType: 'text' },
|
||||
user: { userId: 'verify-user' },
|
||||
intentDraftService: drafts,
|
||||
scheduleService,
|
||||
env,
|
||||
});
|
||||
if (card?.includes('我准备执行') && card.includes('确认')) {
|
||||
pass('creates action card for timed reminder');
|
||||
} else {
|
||||
fail('creates action card for timed reminder', card);
|
||||
}
|
||||
if (passthrough === null) pass('new messages pass through to goose');
|
||||
else fail('new messages pass through to goose', passthrough);
|
||||
|
||||
await drafts.createDraft({
|
||||
userId: 'verify-user',
|
||||
layer: 'L1',
|
||||
draftType: 'timed_reminder',
|
||||
actionLevel: 1,
|
||||
title: '项目计划例会',
|
||||
payload: {
|
||||
title: '项目计划例会',
|
||||
remindLocal: '2026-08-28 14:30',
|
||||
hour: 14,
|
||||
minute: 30,
|
||||
recurrence: 'once',
|
||||
sourceChannel: 'agent',
|
||||
},
|
||||
cardText: '确认卡片',
|
||||
});
|
||||
const pending = await drafts.getPendingDraft('verify-user');
|
||||
if (pending?.draftType === 'timed_reminder') pass('persists pending draft');
|
||||
else fail('persists pending draft', JSON.stringify(pending));
|
||||
if (pending?.draftType === 'timed_reminder') pass('pending draft can be committed after tool gate');
|
||||
else fail('pending draft can be committed after tool gate', JSON.stringify(pending));
|
||||
|
||||
const committed = await handleWechatIntentTransaction({
|
||||
intent: { agentText: '确认', msgId: 'verify-2', msgType: 'text' },
|
||||
@@ -131,11 +144,18 @@ async function main() {
|
||||
scheduleService,
|
||||
env,
|
||||
});
|
||||
if (slotFill?.includes('补充') && !slotFill.includes('我准备执行')) {
|
||||
pass('slot fill does not create confirmable draft');
|
||||
} else {
|
||||
fail('slot fill does not create confirmable draft', slotFill);
|
||||
}
|
||||
if (slotFill === null) pass('incomplete requests pass through to goose');
|
||||
else fail('incomplete requests pass through to goose', slotFill);
|
||||
|
||||
const pagePassthrough = await handleWechatIntentTransaction({
|
||||
intent: { agentText: '我想帮我做一个页面,页面上每天自动更新天气', msgId: 'verify-page', msgType: 'text' },
|
||||
user: { userId: 'verify-user-page' },
|
||||
intentDraftService: createDraftStore(),
|
||||
scheduleService,
|
||||
env,
|
||||
});
|
||||
if (pagePassthrough === null) pass('page delivery with auto refresh passes through to goose');
|
||||
else fail('page delivery with auto refresh passes through to goose', pagePassthrough);
|
||||
|
||||
const disabled = await handleWechatIntentTransaction({
|
||||
intent: { agentText: '下午2点提醒我', msgId: 'verify-4', msgType: 'text' },
|
||||
|
||||
Reference in New Issue
Block a user