Fix: some agent bug (#14829)

### What problem does this PR solve?

fix: 
update null checks to use 'is None' for better clarity
replace RAGFlowSelect with SelectWithSearch in DebugContent
add max height and overflow to DialogContent in ParameterDialog
 remove unused types from DataOperationsForm

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
buua436
2026-05-12 14:41:49 +08:00
committed by GitHub
parent a02b456720
commit e8adc977bd
5 changed files with 7 additions and 12 deletions

View File

@@ -161,7 +161,7 @@ class Message(ComponentBase):
if k in kwargs:
continue
v = v["value"]
if not v:
if v is None:
v = ""
ans = ""
if isinstance(v, partial):

View File

@@ -105,7 +105,7 @@ class StringTransform(Message, ABC):
pass
for k,v in kwargs.items():
if not v:
if v is None:
v = ""
script = re.sub(k, lambda match: v, script)

View File

@@ -1,4 +1,5 @@
import MarkdownContent from '@/components/next-markdown-content';
import { SelectWithSearch } from '@/components/originui/select-with-search';
import { ButtonLoading } from '@/components/ui/button';
import {
Form,
@@ -9,7 +10,6 @@ import {
FormMessage,
} from '@/components/ui/form';
import { Input } from '@/components/ui/input';
import { RAGFlowSelect } from '@/components/ui/select';
import { Switch } from '@/components/ui/switch';
import { Textarea } from '@/components/ui/textarea';
import { IMessage } from '@/interfaces/database/chat';
@@ -147,7 +147,7 @@ const DebugContent = ({
<FormItem className="flex-1">
<FormLabel>{props.label}</FormLabel>
<FormControl>
<RAGFlowSelect
<SelectWithSearch
allowClear
options={
q.options?.map((x) => ({
@@ -156,7 +156,7 @@ const DebugContent = ({
})) ?? []
}
{...field}
></RAGFlowSelect>
></SelectWithSearch>
</FormControl>
<FormMessage />
</FormItem>

View File

@@ -210,7 +210,7 @@ export function ParameterDialog({
return (
<Dialog open onOpenChange={hideModal}>
<DialogContent>
<DialogContent className="max-h-[80vh] overflow-y-auto">
<DialogHeader>
<DialogTitle>{t('flow.variableSettings')}</DialogTitle>
</DialogHeader>

View File

@@ -9,11 +9,7 @@ import { memo } from 'react';
import { useForm, useWatch } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { z } from 'zod';
import {
JsonSchemaDataType,
Operations,
initialDataOperationsValues,
} from '../../constant';
import { Operations, initialDataOperationsValues } from '../../constant';
import { useFormValues } from '../../hooks/use-form-values';
import { useWatchFormChange } from '../../hooks/use-watch-form-change';
import { INextOperatorForm } from '../../interface';
@@ -94,7 +90,6 @@ function DataOperationsForm({ node }: INextOperatorForm) {
<QueryVariableList
tooltip={t('flow.queryTip')}
label={t('flow.query')}
types={[JsonSchemaDataType.Object]}
></QueryVariableList>
<Separator />
<RAGFlowFormItem name="operations" label={t('flow.operations')}>