feat(chat): add local-first conversation workspace

This commit is contained in:
2026-08-13 15:55:15 +08:00
parent d1d50d722c
commit 8991f78f9f
43 changed files with 5450 additions and 592 deletions
+7
View File
@@ -16,4 +16,11 @@ describe("response metadata", () => {
expect(metadata.outputTokens).toBeNull();
expect(metadata.tokensPerSecond).toBeNull();
});
test("falls back to estimated tokens when provider output is absent", () => {
const metadata = responseMetadata("local", "model", performance.now() - 2000, undefined, 80);
expect(metadata.outputTokens).toBe(80);
expect(metadata.tokensPerSecond).toBeGreaterThanOrEqual(39);
expect(metadata.tokensPerSecond).toBeLessThanOrEqual(41);
});
});