release: prepare 0629001 portal updates
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
buildTaskRoutingAgentText,
|
||||
resolveCodeExecutorRouting,
|
||||
renderCodeExecutorGuidance,
|
||||
renderCurrentTimeAnchor,
|
||||
suggestCodeExecutorForTask,
|
||||
buildSessionMemoryEntries,
|
||||
ensureUserMemoryProfile,
|
||||
@@ -77,13 +78,16 @@ test('buildSessionMemoryEntries injects sandbox, guidance, and profile', () => {
|
||||
sessionPolicy,
|
||||
sandboxConstraints: '## sandbox',
|
||||
userContext: { userId: 'user-2', displayName: 'Bob', username: 'bob' },
|
||||
now: Date.UTC(2026, 5, 29, 5, 0, 0),
|
||||
});
|
||||
assert.equal(entries.length, 4);
|
||||
assert.equal(entries.length, 5);
|
||||
assert.equal(entries[0].title, 'TKMind 用户空间沙箱');
|
||||
assert.equal(entries[1].title, 'TKMind 代码委托策略');
|
||||
assert.match(entries[1].content, /openhands/);
|
||||
assert.match(entries[2].content, /长期记忆/);
|
||||
assert.match(entries[3].content, /Bob/);
|
||||
assert.equal(entries[2].title, 'TKMind 当前时间基准');
|
||||
assert.match(entries[2].content, /2026-06-29(星期一)/);
|
||||
assert.match(entries[3].content, /长期记忆/);
|
||||
assert.match(entries[4].content, /Bob/);
|
||||
});
|
||||
|
||||
test('buildSessionMemoryEntries injects stored conversation memories', () => {
|
||||
@@ -94,11 +98,21 @@ test('buildSessionMemoryEntries injects stored conversation memories', () => {
|
||||
sessionPolicy,
|
||||
userContext: { userId: 'user-3', displayName: 'Carol', username: 'carol' },
|
||||
userMemories: [{ label: 'interest', text: '用户关注 AI 产品设计' }],
|
||||
now: Date.UTC(2026, 5, 29, 5, 0, 0),
|
||||
});
|
||||
assert.equal(entries.at(-1).title, 'TKMind 已沉淀用户记忆');
|
||||
assert.match(entries.at(-1).content, /AI 产品设计/);
|
||||
});
|
||||
|
||||
test('renderCurrentTimeAnchor formats Shanghai weekday from exact date', () => {
|
||||
const text = renderCurrentTimeAnchor({
|
||||
now: Date.UTC(2026, 5, 29, 5, 0, 0),
|
||||
timezone: 'Asia/Shanghai',
|
||||
});
|
||||
assert.match(text, /2026-06-29(星期一)/);
|
||||
assert.match(text, /Asia\/Shanghai/);
|
||||
});
|
||||
|
||||
test('renderMemoryStoreGuidance scopes memory to one user', () => {
|
||||
const text = renderMemoryStoreGuidance({ addressName: '小陈' });
|
||||
assert.match(text, /小陈/);
|
||||
|
||||
Reference in New Issue
Block a user