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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user