-
Notifications
You must be signed in to change notification settings - Fork 6.9k
fix some bugs #6210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix some bugs #6210
Conversation
TestGru AssignmentSummary
Files
Tip You can |
Preview sandbox Image: |
Preview mcp_server Image: |
Docs Preview:🚀 FastGPT Document Preview Ready! |
Preview fastgpt Image: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request addresses multiple bugs related to workflow execution, interactive components, and custom feedback handling. The fixes primarily focus on improving data flow consistency, fixing state management issues, and resolving database write conflicts.
Key Changes:
- Refactored custom feedback collection to batch feedbacks at workflow level instead of individual node-level writes
- Removed sessionStorage-based form state persistence that caused issues with multiple interactive nodes
- Fixed code copilot to use real-time inputs/outputs instead of fetching from node state
- Moved variable type conversions and interactive request detection to appropriate locations in the execution flow
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| projects/app/src/pages/api/v2/chat/completions.ts | Moved isInteractiveRequest calculation earlier before workflow dispatch |
| projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeCode/index.tsx | Passed real-time inputs/outputs to NodeCopilot component |
| projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeCode/Copilot.tsx | Updated to use passed inputs/outputs instead of fetching from node state |
| projects/app/src/components/core/chat/components/Interactive/InteractiveComponents.tsx | Removed sessionStorage persistence logic for form data |
| projects/app/src/components/core/chat/components/AIResponseBox.tsx | Removed chatItemDataId parameter and sessionStorage handling |
| packages/service/core/workflow/dispatch/utils.ts | Added file variable handling to convert URL strings to file objects |
| packages/service/core/workflow/dispatch/type.d.ts | Added customFeedbacks field to DispatchFlowResponse |
| packages/service/core/workflow/dispatch/tools/runUpdateVar.ts | Removed file URL to object conversion and cloneVariables usage |
| packages/service/core/workflow/dispatch/tools/customFeedback.ts | Simplified to return feedback in response instead of immediate database write |
| packages/service/core/workflow/dispatch/plugin/run.ts | Added customFeedbacks collection from plugin workflow |
| packages/service/core/workflow/dispatch/loop/runLoop.ts | Added customFeedbacks collection from loop iterations |
| packages/service/core/workflow/dispatch/index.ts | Added batch custom feedback write logic and responseChatItemId resolution |
| packages/service/core/workflow/dispatch/child/runApp.ts | Added customFeedbacks propagation from child app |
| packages/service/core/chat/controller.ts | Simplified addCustomFeedbacks function and added proper appId type conversion |
| packages/global/core/workflow/runtime/type.d.ts | Removed cloneVariables from ChatDispatchProps and added customFeedbacks to result |
| packages/global/core/workflow/runtime/constants.ts | Added customFeedbacks enum value |
| document/data/doc-last-modified.json | Updated modification timestamps for documentation files |
| document/content/docs/upgrading/4-14/4145.mdx | Added bug fix descriptions for version 4.14.5 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else if (item.type === VariableInputEnum.file) { | ||
| copyVariables[item.key] = cloneVariables[item.key]; | ||
| const currentValue = copyVariables[item.key]; | ||
|
|
||
| copyVariables[item.key] = currentValue | ||
| .map((url: string) => { | ||
| try { | ||
| const urlObj = new URL(url); | ||
| // Extract key: remove bucket prefix (e.g., "/fastgpt-private/") | ||
| const key = decodeURIComponent(urlObj.pathname.replace(/^\/[^/]+\//, '')); | ||
| const filename = path.basename(key) || 'file'; | ||
| const extname = path.extname(key).toLowerCase(); // includes the dot, e.g., ".jpg" | ||
|
|
||
| // Check if it's an image type | ||
| const isImage = extname && imageFileType.includes(extname); | ||
|
|
||
| return { | ||
| id: path.basename(key, path.extname(key)), // filename without extension | ||
| key, | ||
| name: filename, | ||
| type: isImage ? ChatFileTypeEnum.image : ChatFileTypeEnum.file | ||
| }; | ||
| } catch { | ||
| return null; | ||
| } | ||
| }) | ||
| .filter((file: any) => file !== null); |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code assumes currentValue is always an array of strings, but there's no validation to check if currentValue exists or is an array. If currentValue is undefined, null, or not an array, this will throw a runtime error when calling .map(). Consider adding a guard check like: if (!Array.isArray(currentValue)) continue; or return an empty array.
* refactor: fastgpt object storage & global proxy (#6155) * feat: migrate to fastgpt storage sdk * chore: rename env variable * chore: move to sdk dir * docs: object storage * CHORE * chore: storage mocks * chore: update docker-compose * fix: global proxy agent * fix: update COS proxy * refactor: use fetch instead of http.request * fix: axios request base url * fix: axios proxy request behavior * fix: bumps axios * fix: patch axios for proxy * fix: replace axios with proxied axios * fix: upload txt file encoding * clean code * fix: use "minio" for minio adapter (#6205) * fix: use minio client to delete files when using minio vendor (#6206) * doc * feat: filter citations and add response button control (#6170) * feat: filter citations and add response button control * i18n * fix * fix test * perf: chat api code * fix: workflow edge overlap and auto-align in folded loop nodes (#6204) * fix: workflow edge overlap and auto-align in folded loop nodes * sort * fix * fix edge * fix icon * perf: s3 file name * perf: admin get app api * perf: catch user error * fix: refactor useOrg hook to use debounced search key (#6180) * chore: comment minio adapter (#6207) * chore: filename with suffix random id * perf: s3 storage code * fix: encode filename when copy object --------- Co-authored-by: archer <[email protected]> * fix: node card link * json * perf: chat index; * index * chat item soft delete (#6216) * chat item soft delete * temp * fix * remove code * perf: delete chat item --------- Co-authored-by: archer <[email protected]> * feat: select wheather filter sensitive info when export apps (#6222) * fix some bugs (#6210) * fix v4.14.5 bugs * type * fix * fix * custom feedback * fix * code * fix * remove invalid function --------- Co-authored-by: archer <[email protected]> * perf: test * fix file default local upload (#6223) * docs: improve object storage introduction (#6224) * doc --------- Co-authored-by: roy <[email protected]> Co-authored-by: heheer <[email protected]> Co-authored-by: Finley Ge <[email protected]>
移除了自动将文件 URL 字符串数组转换为对象数组的逻辑,避免下游节点接收到错误的数据格式。
移除了基于 sessionStorage 的表单缓存机制,改为直接使用 defaultValues,解决多个表单节点相互覆盖导致默认值不显示的问题。
将 Copilot 组件改为使用实时传入的节点数据,避免缓存延迟导致 AI 读取到旧的语言配置。
将自定义反馈从各节点独立异步写入改为统一收集后集中写入,解决并发冲突和时序依赖问题。