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
+5 -2
View File
@@ -73,7 +73,7 @@ function countTimeExpressions(text) {
}
function wantsSimpleTimedReminder(compact, text) {
if (!/(?:提醒我|设置提醒|设个?提醒|到点提醒|提醒一下|闹钟|叫我)/u.test(compact)) return false;
if (!/(?:提醒我|设置(?:一个|个)?提醒|设(?:一个|个)?提醒|到点提醒|提醒一下|闹钟|叫我)/u.test(compact)) return false;
if (countTimeExpressions(text) !== 1) return false;
if (/[0-9零一二两三四五六七八九十]{1,3}(?:点|:|).{1,24}[0-9零一二两三四五六七八九十]{1,3}(?:点|:|)/u.test(compact)) {
return false;
@@ -100,7 +100,10 @@ function cleanupTimedReminderTitleFragment(text) {
title = title
.replace(/(?:今天|今日|今晚|明天|后天|明早|今早)/gu, ' ')
.replace(/(?:早上|上午|清晨|中午|下午|傍晚|晚上|凌晨)/gu, ' ')
.replace(/[0-9零一二两三四五六七八九十]{1,3}(?:点|:|)(?:半|[0-9]{1,2}(?:分(?!开)|(?![0-9]))?)?/gu, ' ')
.replace(
/[0-9零一二两三四五六七八九十]{1,3}(?:点|:|)(?:半|[0-9]{1,2}(?:\s*分(?!开)|(?![0-9]))?)?/gu,
' ',
)
.replace(/(?:提醒我|提醒|闹钟|叫我|设置提醒|设提醒)/gu, ' ')
.replace(/[,、:]/g, ' ')
.replace(/\s+/g, ' ')