feat: prepare Zhinian desktop client for pilot release
This commit is contained in:
@@ -55,6 +55,28 @@ describe('matchesOptimisticUserMessage', () => {
|
||||
expect(matchesOptimisticUserMessage(candidate, optimistic, 1_700_000_000_000)).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a same-text Gateway echo whose timestamp drifts during processing', () => {
|
||||
const optimistic = { role: 'user', content: '帮我整理今日事项', timestamp: 1_700_000_000 } as const;
|
||||
const candidate = {
|
||||
role: 'user',
|
||||
content: '[Wed 2026-04-22 10:31 GMT+8] 帮我整理今日事项',
|
||||
timestamp: 1_700_000_045,
|
||||
} as const;
|
||||
|
||||
expect(matchesOptimisticUserMessage(candidate, optimistic, 1_700_000_000_000)).toBe(true);
|
||||
});
|
||||
|
||||
it('does not match an older repeated question from the same session', () => {
|
||||
const optimistic = { role: 'user', content: '继续', timestamp: 1_700_000_000 } as const;
|
||||
const candidate = {
|
||||
role: 'user',
|
||||
content: '继续',
|
||||
timestamp: 1_699_999_700,
|
||||
} as const;
|
||||
|
||||
expect(matchesOptimisticUserMessage(candidate, optimistic, 1_700_000_000_000)).toBe(false);
|
||||
});
|
||||
|
||||
it('still rejects unrelated user messages', () => {
|
||||
const optimistic = { role: 'user', content: 'run github1', timestamp: 1_700_000_000 } as const;
|
||||
const candidate = {
|
||||
|
||||
Reference in New Issue
Block a user