Fix: Unable to copy category node. #12607 (#12609)

### What problem does this PR solve?

Fix: Unable to copy category node. #12607

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2026-01-14 11:45:31 +08:00
committed by GitHub
parent f72a35188d
commit d32fa02d97

View File

@ -362,14 +362,30 @@ function transformRequestSchemaToJsonschema(
function transformBeginParams(params: BeginFormSchemaType) {
if (params.mode === AgentDialogueMode.Webhook) {
const nextSecurity: Record<string, any> = {
...params.security,
const security = params.security;
const nextSecurity: Omit<
NonNullable<BeginFormSchemaType['security']>,
'ip_whitelist' | 'jwt'
> & {
ip_whitelist?: string[];
jwt?: Omit<
NonNullable<BeginFormSchemaType['security']>['jwt'],
'required_claims'
> & {
required_claims?: string[];
};
} = {
...((security ?? {}) as Omit<
NonNullable<BeginFormSchemaType['security']>,
'ip_whitelist' | 'jwt'
>),
ip_whitelist: params.security?.ip_whitelist.map((x) => x.value),
};
if (params.security?.auth_type === WebhookSecurityAuthType.Jwt) {
nextSecurity.jwt = {
...nextSecurity.jwt,
required_claims: nextSecurity.jwt?.required_claims.map((x) => x.value),
...security?.jwt,
required_claims: security?.jwt?.required_claims.map((x) => x.value),
};
}
return {
@ -463,8 +479,8 @@ export const buildDslGlobalVariables = (
return { globals: dsl.globals, variables: dsl.variables || {} };
}
let globalVariablesTemp: Record<string, any> = {};
let globalSystem: Record<string, any> = {};
const globalVariablesTemp: Record<string, any> = {};
const globalSystem: Record<string, any> = {};
Object.keys(dsl.globals)?.forEach((key) => {
if (key.indexOf('sys') > -1) {
globalSystem[key] = dsl.globals[key];
@ -633,9 +649,9 @@ export const duplicateNodeForm = (nodeData?: RAGFlowNodeType['data']) => {
// Delete the downstream node corresponding to the to field of the Categorize operator
if (nodeData?.label === Operator.Categorize) {
form.category_description = Object.keys(form.category_description).reduce<
Record<string, Record<string, any>>
>((pre, cur) => {
form.category_description = Object.keys(
form?.category_description ?? {},
).reduce<Record<string, Record<string, any>>>((pre, cur) => {
pre[cur] = {
...form.category_description[cur],
to: undefined,