fix(schedule): parse ASR times with spaces around colons for ITL routing
Memind CI / Test, build, and release guards (push) Successful in 4m15s

Voice/wechat ASR often emits forms like "17 :08", which bypassed timed_reminder
classification and fell through to agent_schedule + schedule-guard false failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-24 17:12:50 +08:00
parent 4ef392e964
commit 1e3a125f83
2 changed files with 34 additions and 3 deletions
+19
View File
@@ -125,6 +125,25 @@ test('specific dated reminder still routes to schedule assistant', () => {
assert.equal(shouldUseScheduleAssistant('明天下午三点提醒我开会'), true);
});
test('parses ASR reminder text with spaced fullwidth colon before minutes', () => {
const now = Date.UTC(2026, 7, 24, 9, 7, 0); // 2026-08-24 17:07 Asia/Shanghai
const intent = parseScheduleIntent('设置一个提醒,今天下午 17 :08要开会', {
timezone: 'Asia/Shanghai',
now,
});
assert.equal(intent.action, 'create_timed_reminder');
assert.equal(intent.title, '要开会');
assert.equal(intent.hour, 17);
assert.equal(intent.minute, 8);
assert.equal(intent.remindLocal, '2026-08-24 17:08');
});
test('ASR spaced colon routes to ITL timed reminder not agent', () => {
const result = classifyUserIntent('设置一个提醒,今天下午 17 :08要开会');
assert.equal(result.kind, 'timed_reminder');
assert.equal(result.layer, 'L1');
});
test('parses direct reminder setup phrase from wechat', () => {
const now = Date.UTC(2026, 7, 24, 4, 0, 0); // 2026-08-24 12:00 Asia/Shanghai
const intent = parseScheduleIntent('帮我设置提醒,下午 14:30 分开会,项目计划例会', {