feat: prepare Zhinian desktop client for pilot release

This commit is contained in:
inman
2026-04-29 10:23:20 +08:00
parent f9361e686a
commit 47b83b79fc
149 changed files with 15341 additions and 3590 deletions

View File

@@ -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 = {