Fix: In the agent loop, if the await response is selected as the variable, the operator cannot be selected. #12656 (#12657)

### What problem does this PR solve?

Fix: In the agent loop, if the await response is selected as the
variable, the operator cannot be selected. #12656

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2026-01-16 16:49:48 +08:00
committed by GitHub
parent 045314a1aa
commit 99dae3c64c
4 changed files with 21 additions and 6 deletions

View File

@ -53,10 +53,7 @@ module.exports = {
],
},
],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'check-file/filename-naming-convention': [
'error',

View File

@ -1075,3 +1075,13 @@ export enum WebhookStatus {
Live = 'live',
Stopped = 'stopped',
}
// Map BeginQueryType to TypesWithArray
export const BeginQueryTypeMap = {
[BeginQueryType.Line]: TypesWithArray.String,
[BeginQueryType.Paragraph]: TypesWithArray.String,
[BeginQueryType.Options]: TypesWithArray.ArrayString,
[BeginQueryType.File]: 'File',
[BeginQueryType.Integer]: TypesWithArray.Number,
[BeginQueryType.Boolean]: TypesWithArray.Boolean,
};

View File

@ -96,7 +96,7 @@ function ParameterForm({
},
[],
);
}, []);
}, [t]);
const type = useWatch({
control: form.control,

View File

@ -18,6 +18,7 @@ import {
AgentVariableType,
BeginId,
BeginQueryType,
BeginQueryTypeMap,
JsonSchemaDataType,
Operator,
VariableType,
@ -463,7 +464,14 @@ export function useGetVariableLabelOrTypeByValue({
const getType = useCallback(
(val?: string) => {
return getItem(val)?.type || findAgentStructuredOutputTypeByValue(val);
const currentType =
getItem(val)?.type || findAgentStructuredOutputTypeByValue(val);
if (currentType && currentType in BeginQueryTypeMap) {
return BeginQueryTypeMap[currentType as BeginQueryType];
}
return currentType;
},
[findAgentStructuredOutputTypeByValue, getItem],
);