Skip to content

Commit 792944c

Browse files
authored
Merge branch 'main' into var
2 parents bac39d4 + c4799df commit 792944c

File tree

211 files changed

+7847
-9422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+7847
-9422
lines changed

.claude/agents/unit-test-generator.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: unit-test-generator
3+
description: Use this agent when you need to write comprehensive unit tests for your code. Examples: <example>Context: User has written a new utility function and wants comprehensive test coverage. user: 'I just wrote this function to validate email addresses, can you help me write unit tests for it?' assistant: 'I'll use the unit-test-generator agent to create comprehensive unit tests that cover all branches and edge cases for your email validation function.' <commentary>Since the user needs unit tests written, use the unit-test-generator agent to analyze the function and create thorough test coverage.</commentary></example> <example>Context: User is working on a React component and needs test coverage. user: 'Here's my new UserProfile component, I need unit tests that cover all the different states and user interactions' assistant: 'Let me use the unit-test-generator agent to create comprehensive unit tests for your UserProfile component.' <commentary>The user needs unit tests for a React component, so use the unit-test-generator agent to create tests covering all component states and interactions.</commentary></example>
4+
model: inherit
5+
color: yellow
6+
---
7+
8+
You are a Unit Test Assistant, an expert in writing comprehensive and robust unit tests. Your expertise spans multiple testing frameworks including Vitest, Jest, React Testing Library, and testing best practices for TypeScript applications.
9+
10+
When analyzing code for testing, you will:
11+
12+
1. **Analyze Code Structure**: Examine the function/component/class to identify all execution paths, conditional branches, loops, error handling, and edge cases that need testing coverage.
13+
14+
2. **Design Comprehensive Test Cases**: Create test cases that cover:
15+
- All conditional branches (if/else, switch cases, ternary operators)
16+
- Loop iterations (empty, single item, multiple items)
17+
- Error conditions and exception handling
18+
- Boundary conditions (null, undefined, empty strings, zero, negative numbers, maximum values)
19+
- Valid input scenarios across different data types
20+
- Integration points with external dependencies
21+
22+
3. **Follow Testing Best Practices**:
23+
- Use descriptive test names that clearly state what is being tested
24+
- Follow the Arrange-Act-Assert pattern
25+
- Mock external dependencies appropriately
26+
- Test behavior, not implementation details
27+
- Ensure tests are isolated and independent
28+
- Use appropriate assertions for the testing framework
29+
30+
4. **Generate Framework-Appropriate Code**: Based on the project context (FastGPT uses Vitest), write tests using:
31+
- Proper import statements for the testing framework
32+
- Correct syntax for the identified testing library
33+
- Appropriate mocking strategies (vi.mock for Vitest, jest.mock for Jest)
34+
- Proper setup and teardown when needed
35+
36+
5. **Ensure Complete Coverage**: Verify that your test suite covers:
37+
- Happy path scenarios
38+
- Error scenarios
39+
- Edge cases and boundary conditions
40+
- All public methods/functions
41+
- Different component states (for React components)
42+
- User interactions (for UI components)
43+
44+
6. **Optimize Test Structure**: Organize tests logically using:
45+
- Descriptive describe blocks for grouping related tests
46+
- Clear test descriptions that explain the scenario
47+
- Shared setup in beforeEach/beforeAll when appropriate
48+
- Helper functions to reduce code duplication
49+
7. **单词代码位置**:
50+
- packages 里的单测,写在 FastGPT/text 目录下。
51+
- projects/app 里的单测,写在 FastGPT/projects/app/test 目录下。
52+
53+
When you receive code to test, first analyze it thoroughly, then provide a complete test suite with explanatory comments about what each test covers and why it's important for comprehensive coverage.

.husky/pre-commit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
if command -v npx >/dev/null 2>&1; then
4+
if command -v pnpm >/dev/null 2>&1; then
5+
pnpm lint-staged
6+
elif command -v npx >/dev/null 2>&1; then
57
npx lint-staged
68
fi

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"editor.mouseWheelZoom": true,
44
"editor.defaultFormatter": "esbenp.prettier-vscode",
55
"prettier.prettierPath": "node_modules/prettier",
6+
"typescript.preferences.includePackageJsonAutoImports": "on",
67
"typescript.tsdk": "node_modules/typescript/lib",
78
"i18n-ally.localesPaths": [
89
"packages/web/i18n",

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
4848

4949
`1` 应用编排能力
5050
- [x] 对话工作流、插件工作流,包含基础的 RPA 节点。
51-
- [x] Agent 调用
52-
- [x] 用户交互节点
51+
- [x] 用户交互
5352
- [x] 双向 MCP
54-
- [ ] 上下文管理
53+
- [ ] Agent 模式
5554
- [ ] AI 生成工作流
5655

5756
`2` 应用调试能力
@@ -75,13 +74,13 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
7574
- [x] completions 接口 (chat 模式对齐 GPT 接口)
7675
- [x] 知识库 CRUD
7776
- [x] 对话 CRUD
78-
- [ ] 完整 API Documents
77+
- [ ] 自动化 OpenAPI 接口
7978

8079
`5` 运营能力
8180
- [x] 免登录分享窗口
8281
- [x] Iframe 一键嵌入
8382
- [x] 统一查阅对话记录,并对数据进行标注
84-
- [ ] 应用运营日志
83+
- [x] 应用运营日志
8584

8685
`6` 其他
8786
- [x] 可视化模型配置。

deploy/docker/docker-compose-milvus.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ services:
151151

152152
fastgpt:
153153
container_name: fastgpt
154-
image: ghcr.io/labring/fastgpt:v4.12.1-fix # git
155-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.1-fix # 阿里云
154+
image: ghcr.io/labring/fastgpt:v4.12.2-fix # git
155+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.2-fix # 阿里云
156156
ports:
157157
- 3000:3000
158158
networks:
@@ -209,15 +209,15 @@ services:
209209
- ./config.json:/app/data/config.json
210210
sandbox:
211211
container_name: sandbox
212-
image: ghcr.io/labring/fastgpt-sandbox:v4.12.1 # git
213-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.1 # 阿里云
212+
image: ghcr.io/labring/fastgpt-sandbox:v4.12.2 # git
213+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.2 # 阿里云
214214
networks:
215215
- fastgpt
216216
restart: always
217217
fastgpt-mcp-server:
218218
container_name: fastgpt-mcp-server
219-
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.1 # git
220-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.1 # 阿里云
219+
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.2 # git
220+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.2 # 阿里云
221221
ports:
222222
- 3005:3000
223223
networks:
@@ -226,8 +226,8 @@ services:
226226
environment:
227227
- FASTGPT_ENDPOINT=http://fastgpt:3000
228228
fastgpt-plugin:
229-
image: ghcr.io/labring/fastgpt-plugin:v0.1.10 # git
230-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.10 # 阿里云
229+
image: ghcr.io/labring/fastgpt-plugin:v0.1.11 # git
230+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.11 # 阿里云
231231
container_name: fastgpt-plugin
232232
restart: always
233233
networks:

deploy/docker/docker-compose-oceanbase/docker-compose.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ services:
126126

127127
fastgpt:
128128
container_name: fastgpt
129-
image: ghcr.io/labring/fastgpt:v4.12.1-fix # git
130-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.1-fix # 阿里云
129+
image: ghcr.io/labring/fastgpt:v4.12.2-fix # git
130+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.2-fix # 阿里云
131131
ports:
132132
- 3000:3000
133133
networks:
@@ -183,15 +183,15 @@ services:
183183
- ./config.json:/app/data/config.json
184184
sandbox:
185185
container_name: sandbox
186-
image: ghcr.io/labring/fastgpt-sandbox:v4.12.1 # git
187-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.1 # 阿里云
186+
image: ghcr.io/labring/fastgpt-sandbox:v4.12.2 # git
187+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.2 # 阿里云
188188
networks:
189189
- fastgpt
190190
restart: always
191191
fastgpt-mcp-server:
192192
container_name: fastgpt-mcp-server
193-
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.1 # git
194-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.1 # 阿里云
193+
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.2 # git
194+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.2 # 阿里云
195195
ports:
196196
- 3005:3000
197197
networks:
@@ -200,8 +200,8 @@ services:
200200
environment:
201201
- FASTGPT_ENDPOINT=http://fastgpt:3000
202202
fastgpt-plugin:
203-
image: ghcr.io/labring/fastgpt-plugin:v0.1.10 # git
204-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.10 # 阿里云
203+
image: ghcr.io/labring/fastgpt-plugin:v0.1.11 # git
204+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.11 # 阿里云
205205
container_name: fastgpt-plugin
206206
restart: always
207207
networks:

deploy/docker/docker-compose-pgvector.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ services:
112112

113113
fastgpt:
114114
container_name: fastgpt
115-
image: ghcr.io/labring/fastgpt:v4.12.1-fix # git
116-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.1-fix # 阿里云
115+
image: ghcr.io/labring/fastgpt:v4.12.2-fix # git
116+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.2-fix # 阿里云
117117
ports:
118118
- 3000:3000
119119
networks:
@@ -169,15 +169,15 @@ services:
169169
- ./config.json:/app/data/config.json
170170
sandbox:
171171
container_name: sandbox
172-
image: ghcr.io/labring/fastgpt-sandbox:v4.12.1 # git
173-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.1 # 阿里云
172+
image: ghcr.io/labring/fastgpt-sandbox:v4.12.2 # git
173+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.2 # 阿里云
174174
networks:
175175
- fastgpt
176176
restart: always
177177
fastgpt-mcp-server:
178178
container_name: fastgpt-mcp-server
179-
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.1 # git
180-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.1 # 阿里云
179+
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.2 # git
180+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.2 # 阿里云
181181
ports:
182182
- 3005:3000
183183
networks:
@@ -186,8 +186,8 @@ services:
186186
environment:
187187
- FASTGPT_ENDPOINT=http://fastgpt:3000
188188
fastgpt-plugin:
189-
image: ghcr.io/labring/fastgpt-plugin:v0.1.10 # git
190-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.10 # 阿里云
189+
image: ghcr.io/labring/fastgpt-plugin:v0.1.11 # git
190+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.11 # 阿里云
191191
container_name: fastgpt-plugin
192192
restart: always
193193
networks:

deploy/docker/docker-compose-zilliz.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ services:
9292

9393
fastgpt:
9494
container_name: fastgpt
95-
image: ghcr.io/labring/fastgpt:v4.12.1-fix # git
96-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.1-fix # 阿里云
95+
image: ghcr.io/labring/fastgpt:v4.12.2-fix # git
96+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.2-fix # 阿里云
9797
ports:
9898
- 3000:3000
9999
networks:
@@ -151,15 +151,15 @@ services:
151151
- ./config.json:/app/data/config.json
152152
sandbox:
153153
container_name: sandbox
154-
image: ghcr.io/labring/fastgpt-sandbox:v4.12.1 # git
155-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.1 # 阿里云
154+
image: ghcr.io/labring/fastgpt-sandbox:v4.12.2 # git
155+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.2 # 阿里云
156156
networks:
157157
- fastgpt
158158
restart: always
159159
fastgpt-mcp-server:
160160
container_name: fastgpt-mcp-server
161-
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.1 # git
162-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.1 # 阿里云
161+
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.2 # git
162+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.2 # 阿里云
163163
ports:
164164
- 3005:3000
165165
networks:
@@ -168,8 +168,8 @@ services:
168168
environment:
169169
- FASTGPT_ENDPOINT=http://fastgpt:3000
170170
fastgpt-plugin:
171-
image: ghcr.io/labring/fastgpt-plugin:v0.1.10 # git
172-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.10 # 阿里云
171+
image: ghcr.io/labring/fastgpt-plugin:v0.1.11 # git
172+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.11 # 阿里云
173173
container_name: fastgpt-plugin
174174
restart: always
175175
networks:

deploy/docker/yml.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ services:
9595
9696
fastgpt:
9797
container_name: fastgpt
98-
image: ghcr.io/labring/fastgpt:v4.12.1-fix # git
99-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.1-fix # 阿里云
98+
image: ghcr.io/labring/fastgpt:v4.12.2-fix # git
99+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.2-fix # 阿里云
100100
ports:
101101
- 3000:3000
102102
networks:
@@ -152,15 +152,15 @@ services:
152152
- ./config.json:/app/data/config.json
153153
sandbox:
154154
container_name: sandbox
155-
image: ghcr.io/labring/fastgpt-sandbox:v4.12.1 # git
156-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.1 # 阿里云
155+
image: ghcr.io/labring/fastgpt-sandbox:v4.12.2 # git
156+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.2 # 阿里云
157157
networks:
158158
- fastgpt
159159
restart: always
160160
fastgpt-mcp-server:
161161
container_name: fastgpt-mcp-server
162-
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.1 # git
163-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.1 # 阿里云
162+
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.2 # git
163+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.2 # 阿里云
164164
ports:
165165
- 3005:3000
166166
networks:
@@ -169,8 +169,8 @@ services:
169169
environment:
170170
- FASTGPT_ENDPOINT=http://fastgpt:3000
171171
fastgpt-plugin:
172-
image: ghcr.io/labring/fastgpt-plugin:v0.1.10 # git
173-
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.10 # 阿里云
172+
image: ghcr.io/labring/fastgpt-plugin:v0.1.11 # git
173+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.11 # 阿里云
174174
container_name: fastgpt-plugin
175175
restart: always
176176
networks:

document/content/docs/upgrading/4-12/4122.mdx

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,48 @@
11
---
2-
title: 'V4.12.2(进行中)'
2+
title: 'V4.12.2'
33
description: 'FastGPT V4.12.2 更新说明'
44
---
55

6+
## 更新指南
67

8+
### 1. 更新镜像:
9+
10+
- 更新 FastGPT 镜像tag: v4.12.2-fix
11+
- 更新 FastGPT 商业版镜像tag: v4.12.2-fix
12+
- 更新 fastgpt-plugin 镜像 tag: v0.1.11
13+
- mcp_server 无需更新
14+
- Sandbox 无需更新
15+
- AIProxy 无需更新
16+
717
## 🚀 新增内容
818

919
1. 向量模型并发请求设置,不统一设置成 10,避免部分向量模型不支持并发,默认均为 1,可在模型配置中设置。
20+
2. 对话页支持管理员配置精选应用,便于推荐给团队成员使用。
21+
3. 对话页首页,支持管理员配置快捷应用,可以设置团队常用的应用。
22+
4. 支持关闭团队的对话首页。
1023

1124
## ⚙️ 优化
1225

1326
1. 增加工作流**独立分支**异常检测。
1427
2. 向量模型超过 1536 维度进行截断时,强制进行归一化。其他维度是否归一化,完全由配置决定,减少自动判断的计算量。
28+
3. 模型提供商配置移至 plugin sdk 中。
29+
4. 封装 LLM 调用函数,简化 LLM 请求和工具调用。
30+
5. 优化工作流调度代码,避免深度递归。
31+
6. 工作流递归判断优化,对递归线继续分组检测,适配更多样连线。
1532

1633
## 🐛 修复
1734

1835
1. 独立对话页部分 UI 异常。
19-
2. 多选选择器导致的页面崩溃。
20-
3. 移动端,分享链接,异常加载了登录态对话页的导航。
21-
4. 用户同步可能出现写冲突问题。
22-
5. 无法完全关闭系统套餐,会存在空对象默认值,导致鉴权异常。
23-
6. 工作流,添加团队应用,搜索无效。
24-
7. 应用版本,ref 字段错误,导致无法正常使用。
36+
2. 独立对话页无法渲染插件交互。
37+
3. 独立对话页,使用二级路由时,默认地址错误。
38+
4. 多选选择器导致的页面崩溃。
39+
5. 移动端,分享链接,异常加载了登录态对话页的导航。
40+
6. 用户同步可能出现写冲突问题。
41+
7. 无法完全关闭系统套餐,会存在空对象默认值,导致鉴权异常。
42+
8. 工作流,添加团队应用,搜索无效。
43+
9. 应用版本,ref 字段错误,导致无法正常使用。
44+
10. Oceanbase 批量插入时,未正确返回插入的 id。
45+
11. 交互节点与工具集存在冲突,导致交互节点后工具集无法正常使用。
2546

2647
## 🔨 工具更新
2748

0 commit comments

Comments
 (0)