Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8ccabec
feat: favorite apps & quick apps with their own configuration (#5515)
xqvvu Aug 22, 2025
d4e88ab
perf: chat home page code
c121914yu Aug 22, 2025
8ec1a28
chatbox ui
c121914yu Aug 22, 2025
b1fe6dd
fix: 4.12.2-dev (#5520)
xqvvu Aug 22, 2025
58e1d25
remove log
c121914yu Aug 22, 2025
3888576
fix: fix modal padding (#5521)
xqvvu Aug 22, 2025
78df15e
perf: manage app
c121914yu Aug 22, 2025
a94120f
feat: enhance model provider handling and update icon references (#…
ctrlz526 Aug 22, 2025
2070564
perf: model provider
c121914yu Aug 22, 2025
e1aed99
sdk package
c121914yu Aug 22, 2025
45729e5
refactor: create llm response (#5499)
francismiko Aug 23, 2025
74add9d
feat: llm request function
c121914yu Aug 23, 2025
e0c37aa
fix: ts
c121914yu Aug 23, 2025
660e353
fix: ts
c121914yu Aug 23, 2025
97ad35b
fix: ahook ts
c121914yu Aug 23, 2025
037fd8d
fix: variable name
c121914yu Aug 23, 2025
f27258c
update lock
c121914yu Aug 23, 2025
cd1f564
ts version
c121914yu Aug 23, 2025
37d17dd
doc
c121914yu Aug 23, 2025
d4f9740
remove log
c121914yu Aug 23, 2025
4e1bc8a
fix: translation type
c121914yu Aug 23, 2025
f36bf4d
perf: workflow status check
c121914yu Aug 25, 2025
a30533b
fix: ts
c121914yu Aug 25, 2025
2117625
fix: prompt tool call
c121914yu Aug 25, 2025
dd29d56
fix: fix missing plugin interact window & make tag draggable (#5527)
xqvvu Aug 25, 2025
aea797d
fix: incorrect select quick apps state; filter apps type (#5528)
xqvvu Aug 25, 2025
57786c1
fix: usesafe translation
c121914yu Aug 25, 2025
b84f8bb
perf: add quickapp modal
c121914yu Aug 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .claude/agents/unit-test-generator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: unit-test-generator
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>
model: inherit
color: yellow
---

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.

When analyzing code for testing, you will:

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.

2. **Design Comprehensive Test Cases**: Create test cases that cover:
- All conditional branches (if/else, switch cases, ternary operators)
- Loop iterations (empty, single item, multiple items)
- Error conditions and exception handling
- Boundary conditions (null, undefined, empty strings, zero, negative numbers, maximum values)
- Valid input scenarios across different data types
- Integration points with external dependencies

3. **Follow Testing Best Practices**:
- Use descriptive test names that clearly state what is being tested
- Follow the Arrange-Act-Assert pattern
- Mock external dependencies appropriately
- Test behavior, not implementation details
- Ensure tests are isolated and independent
- Use appropriate assertions for the testing framework

4. **Generate Framework-Appropriate Code**: Based on the project context (FastGPT uses Vitest), write tests using:
- Proper import statements for the testing framework
- Correct syntax for the identified testing library
- Appropriate mocking strategies (vi.mock for Vitest, jest.mock for Jest)
- Proper setup and teardown when needed

5. **Ensure Complete Coverage**: Verify that your test suite covers:
- Happy path scenarios
- Error scenarios
- Edge cases and boundary conditions
- All public methods/functions
- Different component states (for React components)
- User interactions (for UI components)

6. **Optimize Test Structure**: Organize tests logically using:
- Descriptive describe blocks for grouping related tests
- Clear test descriptions that explain the scenario
- Shared setup in beforeEach/beforeAll when appropriate
- Helper functions to reduce code duplication
7. **单词代码位置**:
- packages 里的单测,写在 FastGPT/text 目录下。
- projects/app 里的单测,写在 FastGPT/projects/app/test 目录下。

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.
4 changes: 3 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if command -v npx >/dev/null 2>&1; then
if command -v pnpm >/dev/null 2>&1; then
pnpm lint-staged
elif command -v npx >/dev/null 2>&1; then
npx lint-staged
fi
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"editor.mouseWheelZoom": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.prettierPath": "node_modules/prettier",
"typescript.preferences.includePackageJsonAutoImports": "on",
"typescript.tsdk": "node_modules/typescript/lib",
"i18n-ally.localesPaths": [
"packages/web/i18n",
Expand Down
19 changes: 13 additions & 6 deletions document/content/docs/upgrading/4-12/4122.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ description: 'FastGPT V4.12.2 更新说明'
## 🚀 新增内容

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

## ⚙️ 优化

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

## 🐛 修复

1. 独立对话页部分 UI 异常。
2. 多选选择器导致的页面崩溃。
3. 移动端,分享链接,异常加载了登录态对话页的导航。
4. 用户同步可能出现写冲突问题。
5. 无法完全关闭系统套餐,会存在空对象默认值,导致鉴权异常。
6. 工作流,添加团队应用,搜索无效。
7. 应用版本,ref 字段错误,导致无法正常使用。
2. 独立对话页无法渲染插件交互。
3. 多选选择器导致的页面崩溃。
4. 移动端,分享链接,异常加载了登录态对话页的导航。
5. 用户同步可能出现写冲突问题。
6. 无法完全关闭系统套餐,会存在空对象默认值,导致鉴权异常。
7. 工作流,添加团队应用,搜索无效。
8. 应用版本,ref 字段错误,导致无法正常使用。

## 🔨 工具更新

Expand Down
2 changes: 1 addition & 1 deletion document/content/docs/upgrading/4-12/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "4.12.x",
"description": "",
"pages": ["4121", "4120"]
"pages": ["4122", "4121", "4120"]
}
2 changes: 1 addition & 1 deletion document/data/doc-last-modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"document/content/docs/upgrading/4-11/4111.mdx": "2025-08-07T22:49:09+08:00",
"document/content/docs/upgrading/4-12/4120.mdx": "2025-08-12T22:45:19+08:00",
"document/content/docs/upgrading/4-12/4121.mdx": "2025-08-15T22:53:06+08:00",
"document/content/docs/upgrading/4-12/4122.mdx": "2025-08-22T10:18:24+08:00",
"document/content/docs/upgrading/4-12/4122.mdx": "2025-08-25T14:44:42+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
Expand Down
Loading