fix(agent): inject Asia/Shanghai time anchor on 0630007 line
Agent replies were reporting UTC time because 0630007-memind never injected TKMind 当前时间基准 into session memory. Port the time anchor from the 0630004 work only—no miniapp branch changes—and add a 103 rollback script. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -107,6 +107,22 @@ test('buildSessionMemoryEntries injects stored conversation memories', () => {
|
||||
assert.match(entries.at(-1).content, /AI 产品设计/);
|
||||
});
|
||||
|
||||
test('buildSessionMemoryEntries injects time anchor even without memory store', () => {
|
||||
const sessionPolicy = buildAgentExtensionPolicy({
|
||||
...DEFAULT_USER_CAPABILITIES,
|
||||
memory_store: false,
|
||||
});
|
||||
const entries = buildSessionMemoryEntries({
|
||||
workingDir: '/tmp/unused',
|
||||
sessionPolicy,
|
||||
now: Date.UTC(2026, 5, 29, 5, 0, 0),
|
||||
});
|
||||
assert.equal(entries.length, 1);
|
||||
assert.equal(entries[0].title, 'TKMind 当前时间基准');
|
||||
assert.match(entries[0].content, /Asia\/Shanghai/);
|
||||
assert.match(entries[0].content, /13:00(中午)/);
|
||||
});
|
||||
|
||||
test('renderCurrentTimeAnchor formats Shanghai weekday from exact date', () => {
|
||||
const text = renderCurrentTimeAnchor({
|
||||
now: Date.UTC(2026, 5, 29, 5, 0, 0),
|
||||
|
||||
Reference in New Issue
Block a user