fix(agent): inject Shanghai time into each reply message

103 goosed harness_remember returns remembered:false, so session memory
never carried the time anchor. Prepend buildCurrentTimeAgentPrefix on every
H5 /reply and WeChat agent prompt so the model sees Asia/Shanghai clock.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-01 08:40:27 +08:00
parent 75e5a56b86
commit de5fab370c
5 changed files with 59 additions and 11 deletions
+8
View File
@@ -192,6 +192,14 @@ export function resolveTimeOfDayPeriod(hour) {
return { period: '晚上', greeting: '晚上好' };
}
export function buildCurrentTimeAgentPrefix({ now = Date.now(), timezone = DEFAULT_TIMEZONE } = {}) {
return [
'【TKMind 时间基准 - 仅供回答时间/日期/时段问候,不要向用户复述】',
renderCurrentTimeAnchor({ now, timezone }),
'',
].join('\n');
}
export function renderCurrentTimeAnchor({ now = Date.now(), timezone = DEFAULT_TIMEZONE } = {}) {
const { year, month, day } = formatDateParts(now, timezone);
const { hour, minute } = formatLocalClockParts(now, timezone);