fix(schedule): parse「设置一个提醒」as timed reminder for ITL Confirm Gate
Memind CI / Test, build, and release guards (push) Successful in 4m29s

Colloquial phrasing with optional 一个/个 was falling through to agent_schedule,
so schedule-guard blocked false confirmations. Also strip orphaned 分 after HH:MM times.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-24 16:29:31 +08:00
parent a512fecdc5
commit 4ef392e964
2 changed files with 25 additions and 2 deletions
+20
View File
@@ -1,6 +1,7 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { parseScheduleIntent, shouldUseScheduleAssistant } from './schedule-intent.mjs';
import { classifyUserIntent } from './intent-classifier.mjs';
import { nextDailyRunAt } from './schedule-time.mjs';
test('daily news automation does not route to schedule assistant', () => {
@@ -135,6 +136,25 @@ test('parses direct reminder setup phrase from wechat', () => {
assert.equal(intent.remindLocal, '2026-08-24 14:30');
});
test('parses set-a-reminder colloquial phrase with numeric time', () => {
const now = Date.UTC(2026, 7, 24, 6, 0, 0); // 2026-08-24 14:00 Asia/Shanghai
const intent = parseScheduleIntent('设置一个提醒,今天下午 16:25 分要出门', {
timezone: 'Asia/Shanghai',
now,
});
assert.equal(intent.action, 'create_timed_reminder');
assert.equal(intent.title, '要出门');
assert.equal(intent.hour, 16);
assert.equal(intent.minute, 25);
assert.equal(intent.remindLocal, '2026-08-24 16:25');
});
test('set-a-reminder colloquial phrase routes to ITL timed reminder not agent', () => {
const result = classifyUserIntent('设置一个提醒,今天下午 16:25 分要出门');
assert.equal(result.kind, 'timed_reminder');
assert.equal(result.layer, 'L1');
});
test('simple reminder today rolls to tomorrow when time already passed', () => {
const now = Date.UTC(2026, 7, 24, 7, 0, 0); // 2026-08-24 15:00 Asia/Shanghai
const intent = parseScheduleIntent('今天10点提醒我吃药', {