Skip to content

Commit ed1623b

Browse files
authored
fix bugs (#6074)
* fix bugs * doc
1 parent 2dd48af commit ed1623b

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

document/content/docs/upgrading/4-14/4144.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4144' \
5454
7. 模型测试时,如果模型未启动,会导致无法被测试。
5555
8. MCP header 中带特殊内容时,会抛错。
5656
9. 工作流引用其他 Agent 时,切换版本号后未及时更新 UI。
57+
10. http 节点使用值为空字符串的全局变量时,值会被替换为 null。
58+
11. 判断器节点折叠时,连线断开。
59+
12. 节点调试时,单选和多选类型的变量无法展示选项。
5760

5861
## 插件
5962

document/data/doc-last-modified.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"document/content/docs/introduction/development/openapi/chat.mdx": "2025-11-14T13:21:17+08:00",
3535
"document/content/docs/introduction/development/openapi/dataset.mdx": "2025-09-29T11:34:11+08:00",
3636
"document/content/docs/introduction/development/openapi/intro.mdx": "2025-09-29T11:34:11+08:00",
37-
"document/content/docs/introduction/development/openapi/share.mdx": "2025-12-09T12:18:15+08:00",
37+
"document/content/docs/introduction/development/openapi/share.mdx": "2025-12-09T23:33:32+08:00",
3838
"document/content/docs/introduction/development/proxy/cloudflare.mdx": "2025-07-23T21:35:03+08:00",
3939
"document/content/docs/introduction/development/proxy/http_proxy.mdx": "2025-07-23T21:35:03+08:00",
4040
"document/content/docs/introduction/development/proxy/nginx.mdx": "2025-07-23T21:35:03+08:00",
@@ -89,7 +89,7 @@
8989
"document/content/docs/introduction/guide/plugins/google_search_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
9090
"document/content/docs/introduction/guide/plugins/searxng_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
9191
"document/content/docs/introduction/guide/plugins/upload_system_tool.mdx": "2025-11-04T16:58:12+08:00",
92-
"document/content/docs/introduction/guide/team_permissions/customDomain.mdx": "2025-12-09T18:14:22+08:00",
92+
"document/content/docs/introduction/guide/team_permissions/customDomain.mdx": "2025-12-09T23:33:32+08:00",
9393
"document/content/docs/introduction/guide/team_permissions/invitation_link.mdx": "2025-07-23T21:35:03+08:00",
9494
"document/content/docs/introduction/guide/team_permissions/team_roles_permissions.mdx": "2025-07-23T21:35:03+08:00",
9595
"document/content/docs/introduction/index.en.mdx": "2025-07-23T21:35:03+08:00",
@@ -102,7 +102,7 @@
102102
"document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00",
103103
"document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00",
104104
"document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00",
105-
"document/content/docs/toc.mdx": "2025-12-09T18:14:22+08:00",
105+
"document/content/docs/toc.mdx": "2025-12-09T23:33:32+08:00",
106106
"document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00",
107107
"document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00",
108108
"document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00",
@@ -119,7 +119,7 @@
119119
"document/content/docs/upgrading/4-14/4141.mdx": "2025-11-19T10:15:27+08:00",
120120
"document/content/docs/upgrading/4-14/4142.mdx": "2025-11-18T19:27:14+08:00",
121121
"document/content/docs/upgrading/4-14/4143.mdx": "2025-11-26T20:52:05+08:00",
122-
"document/content/docs/upgrading/4-14/4144.mdx": "2025-12-08T21:45:21+08:00",
122+
"document/content/docs/upgrading/4-14/4144.mdx": "2025-12-09T23:33:32+08:00",
123123
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
124124
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
125125
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
@@ -199,6 +199,6 @@
199199
"document/content/docs/use-cases/external-integration/feishu.mdx": "2025-07-24T14:23:04+08:00",
200200
"document/content/docs/use-cases/external-integration/official_account.mdx": "2025-08-05T23:20:39+08:00",
201201
"document/content/docs/use-cases/external-integration/openapi.mdx": "2025-09-29T11:34:11+08:00",
202-
"document/content/docs/use-cases/external-integration/wecom.mdx": "2025-12-09T20:03:29+08:00",
202+
"document/content/docs/use-cases/external-integration/wecom.mdx": "2025-12-09T23:33:32+08:00",
203203
"document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00"
204204
}

packages/global/core/workflow/runtime/utils.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,26 @@ export const valueTypeFormat = (value: any, valueType?: WorkflowIOValueTypeEnum)
6666
return false;
6767
};
6868

69-
// 1. any值,忽略格式化
70-
if (value === undefined || value === null) return value;
71-
if (!valueType || valueType === WorkflowIOValueTypeEnum.any) return value;
69+
// Handle null/undefined, return default value by type
70+
if (value === undefined || value === null) {
71+
if (!valueType || valueType === WorkflowIOValueTypeEnum.any) return value;
72+
73+
// Default value map (use function to ensure new reference each time)
74+
const defaultValueMap: Partial<Record<WorkflowIOValueTypeEnum, () => any>> = {
75+
[WorkflowIOValueTypeEnum.string]: () => '',
76+
[WorkflowIOValueTypeEnum.number]: () => 0,
77+
[WorkflowIOValueTypeEnum.boolean]: () => false,
78+
[WorkflowIOValueTypeEnum.arrayString]: () => [],
79+
[WorkflowIOValueTypeEnum.arrayNumber]: () => [],
80+
[WorkflowIOValueTypeEnum.arrayBoolean]: () => [],
81+
[WorkflowIOValueTypeEnum.arrayObject]: () => [],
82+
[WorkflowIOValueTypeEnum.arrayAny]: () => [],
83+
[WorkflowIOValueTypeEnum.object]: () => ({})
84+
};
85+
86+
const getDefaultValue = defaultValueMap[valueType];
87+
return getDefaultValue ? getDefaultValue() : value;
88+
}
7289

7390
// Password check
7491
if (valueType === WorkflowIOValueTypeEnum.string && isSecretValue(value)) return value;
@@ -78,7 +95,7 @@ export const valueTypeFormat = (value: any, valueType?: WorkflowIOValueTypeEnum)
7895
(valueType === WorkflowIOValueTypeEnum.string && typeof value === 'string') ||
7996
(valueType === WorkflowIOValueTypeEnum.number && typeof value === 'number') ||
8097
(valueType === WorkflowIOValueTypeEnum.boolean && typeof value === 'boolean') ||
81-
(valueType.startsWith('array') && Array.isArray(value)) ||
98+
(valueType?.startsWith('array') && Array.isArray(value)) ||
8299
(valueType === WorkflowIOValueTypeEnum.object && typeof value === 'object') ||
83100
(valueType === WorkflowIOValueTypeEnum.chatHistory &&
84101
(Array.isArray(value) || typeof value === 'number')) ||
@@ -117,7 +134,7 @@ export const valueTypeFormat = (value: any, valueType?: WorkflowIOValueTypeEnum)
117134
}
118135

119136
// 4.4 数组类型(这里 value 不是数组类型)(TODO: 嵌套数据类型转化)
120-
if (valueType.startsWith('array')) {
137+
if (valueType?.startsWith('array')) {
121138
if (isObjectString(value)) {
122139
try {
123140
return json5.parse(value);
@@ -132,7 +149,7 @@ export const valueTypeFormat = (value: any, valueType?: WorkflowIOValueTypeEnum)
132149
WorkflowIOValueTypeEnum.datasetQuote,
133150
WorkflowIOValueTypeEnum.selectDataset,
134151
WorkflowIOValueTypeEnum.selectApp
135-
].includes(valueType)
152+
].includes(valueType as any)
136153
) {
137154
if (isObjectString(value)) {
138155
try {

projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/hooks/useDebug.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ export const useDebug = () => {
265265
<Box display={currentTab === TabEnum.node ? 'block' : 'none'}>
266266
{renderInputs.map((item) => (
267267
<LabelAndFormRender
268+
{...item}
268269
key={item.key}
269270
label={item.label}
270271
required={item.required}
@@ -279,6 +280,7 @@ export const useDebug = () => {
279280
<Box display={currentTab === TabEnum.global ? 'block' : 'none'}>
280281
{customVar.map((item) => (
281282
<LabelAndFormRender
283+
{...item}
282284
key={item.key}
283285
label={item.label}
284286
required={item.required}
@@ -291,6 +293,7 @@ export const useDebug = () => {
291293
))}
292294
{internalVar.map((item) => (
293295
<LabelAndFormRender
296+
{...item}
294297
key={item.key}
295298
label={item.label}
296299
required={item.required}
@@ -303,6 +306,7 @@ export const useDebug = () => {
303306
))}
304307
{filteredVar.map((item) => (
305308
<LabelAndFormRender
309+
{...item}
306310
key={item.key}
307311
label={item.label}
308312
required={item.required}

projects/app/src/pageComponents/app/detail/WorkflowComponents/context/workflowInitContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ const WorkflowInitContextProvider = ({
153153
version: node.data.version,
154154
versionLabel: node.data.versionLabel,
155155
isLatestVersion: node.data.isLatestVersion,
156+
isFolded: node.data.isFolded,
156157
inputs: node.data.inputs.map((input) => {
157158
return {
158159
key: input.key,

projects/app/src/pageComponents/app/tool/SecretInputModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ const SecretInputModal = ({
230230
{showInput ? (
231231
<Input
232232
bg={'myGray.50'}
233+
placeholder={item.description}
233234
{...register(inputKey, {
234235
required: item.required
235236
})}

0 commit comments

Comments
 (0)