@lobehub/chat 1.114.1 → 1.114.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +75 -13
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/packages/electron-server-ipc/package.json +2 -1
- package/packages/electron-server-ipc/vitest.config.ts +10 -0
- package/packages/file-loaders/package.json +2 -1
- package/packages/model-runtime/package.json +4 -0
- package/packages/model-runtime/src/baichuan/index.test.ts +1 -1
- package/packages/model-runtime/src/mistral/index.test.ts +1 -1
- package/packages/model-runtime/src/utils/anthropicHelpers.test.ts +1 -1
- package/packages/model-runtime/vitest.config.ts +16 -0
- package/packages/prompts/package.json +4 -0
- package/packages/prompts/src/chains/__tests__/summaryDescription.test.ts +2 -4
- package/packages/prompts/src/chains/__tests__/summaryTitle.test.ts +1 -11
- package/packages/prompts/src/prompts/plugin/index.test.ts +2 -0
- package/packages/prompts/vitest.config.ts +7 -0
- package/packages/types/src/index.ts +1 -0
- package/packages/web-crawler/package.json +4 -0
- package/packages/web-crawler/src/crawImpl/__tests__/jina.test.ts +1 -1
- package/packages/web-crawler/src/crawImpl/__tests__/search1api.test.ts +1 -1
- package/packages/web-crawler/src/utils/__tests__/withTimeout.test.ts +1 -1
- package/packages/web-crawler/src/utils/appUrlRules.test.ts +2 -0
- package/packages/web-crawler/src/utils/htmlToMarkdown.test.ts +1 -1
- package/packages/web-crawler/vitest.config.ts +7 -0
- package/src/app/[variants]/(main)/settings/provider/(detail)/[id]/ClientMode.tsx +4 -0
- package/vitest.config.ts +2 -0
@@ -2,8 +2,82 @@ name: Test CI
|
|
2
2
|
|
3
3
|
on: [push, pull_request]
|
4
4
|
|
5
|
+
permissions:
|
6
|
+
contents: read
|
7
|
+
|
5
8
|
jobs:
|
6
|
-
test
|
9
|
+
# Package tests - using each package's own test script
|
10
|
+
test-packages:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
package: [file-loaders, prompts, model-runtime, web-crawler, electron-server-ipc]
|
15
|
+
|
16
|
+
name: Test package ${{ matrix.package }}
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v5
|
20
|
+
|
21
|
+
- name: Setup Node.js
|
22
|
+
uses: actions/setup-node@v4
|
23
|
+
with:
|
24
|
+
node-version: 22
|
25
|
+
|
26
|
+
- uses: pnpm/action-setup@v4
|
27
|
+
|
28
|
+
- name: Install bun
|
29
|
+
uses: oven-sh/setup-bun@v1
|
30
|
+
with:
|
31
|
+
bun-version: ${{ secrets.BUN_VERSION }}
|
32
|
+
|
33
|
+
- name: Install deps
|
34
|
+
run: bun i
|
35
|
+
|
36
|
+
- name: Test ${{ matrix.package }} package with coverage
|
37
|
+
run: pnpm --filter @lobechat/${{ matrix.package }} test:coverage
|
38
|
+
|
39
|
+
- name: Upload ${{ matrix.package }} coverage to Codecov
|
40
|
+
uses: codecov/codecov-action@v4
|
41
|
+
with:
|
42
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
43
|
+
files: ./packages/${{ matrix.package }}/coverage/lcov.info
|
44
|
+
flags: packages/${{ matrix.package }}
|
45
|
+
|
46
|
+
# App tests
|
47
|
+
test-website:
|
48
|
+
name: Test Website
|
49
|
+
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
|
52
|
+
steps:
|
53
|
+
- uses: actions/checkout@v5
|
54
|
+
|
55
|
+
- name: Setup Node.js
|
56
|
+
uses: actions/setup-node@v4
|
57
|
+
with:
|
58
|
+
node-version: 22
|
59
|
+
|
60
|
+
- name: Install bun
|
61
|
+
uses: oven-sh/setup-bun@v1
|
62
|
+
with:
|
63
|
+
bun-version: ${{ secrets.BUN_VERSION }}
|
64
|
+
|
65
|
+
- name: Install deps
|
66
|
+
run: bun i
|
67
|
+
|
68
|
+
- name: Test App Coverage
|
69
|
+
run: bun run test-app:coverage
|
70
|
+
|
71
|
+
- name: Upload App Coverage to Codecov
|
72
|
+
uses: codecov/codecov-action@v4
|
73
|
+
with:
|
74
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
75
|
+
files: ./coverage/app/lcov.info
|
76
|
+
flags: app
|
77
|
+
|
78
|
+
test-server:
|
79
|
+
name: Test Database
|
80
|
+
|
7
81
|
runs-on: ubuntu-latest
|
8
82
|
|
9
83
|
services:
|
@@ -13,8 +87,6 @@ jobs:
|
|
13
87
|
POSTGRES_PASSWORD: postgres
|
14
88
|
options: >-
|
15
89
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
16
|
-
|
17
|
-
|
18
90
|
ports:
|
19
91
|
- 5432:5432
|
20
92
|
|
@@ -53,13 +125,3 @@ jobs:
|
|
53
125
|
token: ${{ secrets.CODECOV_TOKEN }}
|
54
126
|
files: ./coverage/server/lcov.info
|
55
127
|
flags: server
|
56
|
-
|
57
|
-
- name: Test App Coverage
|
58
|
-
run: bun run test-app:coverage
|
59
|
-
|
60
|
-
- name: Upload App Coverage to Codecov
|
61
|
-
uses: codecov/codecov-action@v4
|
62
|
-
with:
|
63
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
64
|
-
files: ./coverage/app/lcov.info
|
65
|
-
flags: app
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.114.2](https://github.com/lobehub/lobe-chat/compare/v1.114.1...v1.114.2)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-21**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Can't load custom provider config.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Can't load custom provider config, closes [#8880](https://github.com/lobehub/lobe-chat/issues/8880) ([9ec3315](https://github.com/lobehub/lobe-chat/commit/9ec3315))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.114.1](https://github.com/lobehub/lobe-chat/compare/v1.114.0...v1.114.1)
|
6
31
|
|
7
32
|
<sup>Released on **2025-08-21**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.114.
|
3
|
+
"version": "1.114.2",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { Mock, afterEach, beforeEach, expect, it, vi } from 'vitest';
|
2
|
+
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
4
|
import { LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
5
5
|
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { resolve } from 'node:path';
|
2
|
+
import { defineConfig } from 'vitest/config';
|
3
|
+
|
4
|
+
export default defineConfig({
|
5
|
+
test: {
|
6
|
+
alias: {
|
7
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
8
|
+
'@/libs/model-runtime': resolve(__dirname, './src'),
|
9
|
+
'@/types': resolve(__dirname, '../types/src'),
|
10
|
+
'@/const': resolve(__dirname, '../const/src'),
|
11
|
+
'@': resolve(__dirname, '../../src'),
|
12
|
+
/* eslint-enable */
|
13
|
+
},
|
14
|
+
environment: 'happy-dom',
|
15
|
+
},
|
16
|
+
});
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
import { globalHelpers } from '@/store/global/helpers';
|
1
|
+
import { describe, expect, it } from 'vitest';
|
4
2
|
|
5
3
|
import { chainSummaryDescription } from '../summaryDescription';
|
6
4
|
|
@@ -10,7 +8,7 @@ describe('chainSummaryDescription', () => {
|
|
10
8
|
const expectedOutput = {
|
11
9
|
messages: [
|
12
10
|
{
|
13
|
-
content: `你是一名擅长技能总结的助理,你需要将用户的输入的内容总结为一个角色技能简介,不超过 20
|
11
|
+
content: `你是一名擅长技能总结的助理,你需要将用户的输入的内容总结为一个角色技能简介,不超过 20 个字。内容需要确保信息清晰、逻辑清晰,并有效地传达角色的技能和经验,需要并翻译为目标语言:en-US。格式要求如下:\n输入: {文本作为JSON引用字符串} [locale]\n输出: {简介}`,
|
14
12
|
role: 'system',
|
15
13
|
},
|
16
14
|
{
|
@@ -1,17 +1,8 @@
|
|
1
1
|
import { OpenAIChatMessage } from '@lobechat/types';
|
2
|
-
import {
|
3
|
-
|
4
|
-
import { chatHelpers } from '@/store/chat/helpers';
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
5
3
|
|
6
4
|
import { chainSummaryTitle } from '../summaryTitle';
|
7
5
|
|
8
|
-
// Mock the chatHelpers.getMessagesTokenCount function
|
9
|
-
vi.mock('@/store/chat/helpers', () => ({
|
10
|
-
chatHelpers: {
|
11
|
-
getMessagesTokenCount: vi.fn(),
|
12
|
-
},
|
13
|
-
}));
|
14
|
-
|
15
6
|
describe('chainSummaryTitle', () => {
|
16
7
|
it('should use the default model if the token count is below the GPT-3.5 limit', async () => {
|
17
8
|
// Arrange
|
@@ -21,7 +12,6 @@ describe('chainSummaryTitle', () => {
|
|
21
12
|
];
|
22
13
|
const currentLanguage = 'en-US';
|
23
14
|
const tokenCount = 10000; // Arbitrary token count below the GPT-3.5 limit
|
24
|
-
(chatHelpers.getMessagesTokenCount as Mock).mockResolvedValue(tokenCount);
|
25
15
|
|
26
16
|
// Act
|
27
17
|
const result = await chainSummaryTitle(messages, currentLanguage);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
3
|
import { NetworkConnectionError, PageNotFoundError, TimeoutError } from '../../utils/errorType';
|
4
4
|
import * as withTimeoutModule from '../../utils/withTimeout';
|
@@ -7,11 +7,15 @@ import { Flexbox } from 'react-layout-kit';
|
|
7
7
|
import Loading from '@/components/Loading/BrandTextLoading';
|
8
8
|
import { useClientDataSWR } from '@/libs/swr';
|
9
9
|
import { aiProviderService } from '@/services/aiProvider';
|
10
|
+
import { useAiInfraStore } from '@/store/aiInfra';
|
10
11
|
|
11
12
|
import ModelList from '../../features/ModelList';
|
12
13
|
import ProviderConfig from '../../features/ProviderConfig';
|
13
14
|
|
14
15
|
const ClientMode = memo<{ id: string }>(({ id }) => {
|
16
|
+
const useFetchAiProviderItem = useAiInfraStore((s) => s.useFetchAiProviderItem);
|
17
|
+
useFetchAiProviderItem(id);
|
18
|
+
|
15
19
|
const { data, isLoading } = useClientDataSWR('get-client-provider', () =>
|
16
20
|
aiProviderService.getAiProviderById(id),
|
17
21
|
);
|
package/vitest.config.ts
CHANGED
@@ -22,6 +22,7 @@ export default defineConfig({
|
|
22
22
|
// https://github.com/lobehub/lobe-chat/pull/7265
|
23
23
|
...coverageConfigDefaults.exclude,
|
24
24
|
'__mocks__/**',
|
25
|
+
'**/packages/**',
|
25
26
|
// just ignore the migration code
|
26
27
|
// we will use pglite in the future
|
27
28
|
// so the coverage of this file is not important
|
@@ -38,6 +39,7 @@ export default defineConfig({
|
|
38
39
|
'**/dist/**',
|
39
40
|
'**/build/**',
|
40
41
|
'**/apps/desktop/**',
|
42
|
+
'**/packages/**',
|
41
43
|
'src/database/server/**/**',
|
42
44
|
'src/database/repositories/dataImporter/deprecated/**/**',
|
43
45
|
],
|