Skip to content

Feat: Configure the relevant pipeline parameters on the dataset configuration page. - #17100

Merged
wangq8 merged 8 commits into
infiniflow:mainfrom
cike8899:feat-pipeline-dataset-config
Jul 20, 2026
Merged

wangq8 merged 8 commits into
infiniflow:mainfrom
cike8899:feat-pipeline-dataset-config

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

Summary

Feat: Configure the relevant pipeline parameters on the dataset configuration page.

@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jul 20, 2026
@cike8899 cike8899 added the ci Continue Integration label Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a dataset “next configuration” page with pipeline and built-in parser selection, operator-specific forms, data-source linking, embedding and permission fields, persistence hooks, new API helpers, and backend-dependent navigation. Existing operator forms now support change callbacks and hidden outputs.

Changes

Dataset pipeline configuration

Layer / File(s) Summary
Pipeline API and data contracts
web/src/hooks/use-agent-request.ts, web/src/hooks/use-knowledge-request.ts, web/src/interfaces/database/agent.ts, web/src/services/agent-service.ts, web/src/utils/api.ts
Adds built-in pipeline types, API methods, query hooks, pipeline DSL loading, and pipeline-aware parser configuration serialization.
Operator form integration
web/src/components/auto-keywords-form-field.tsx, web/src/pages/agent/form/*, web/src/pages/agent/hooks/use-form-change-callback.ts, web/src/pages/agent/interface.ts, web/src/pages/agent/utils.ts
Adds extractor settings, form value callbacks, optional output hiding, backend-specific parser transformations, and exported transformation helpers.
Dataset operator model and persistence
web/src/pages/dataset/setting/form-schema.ts, web/src/pages/dataset/setting/utils.ts, web/src/pages/dataset/setting/hooks.ts, web/src/pages/dataset/setting/index.tsx, web/src/pages/dataset/setting/pipeline-operator-*.tsx, web/src/pages/dataset/setting/embedding-model-form-field.tsx, web/src/pages/dataset/setting/general-form.tsx, web/src/pages/dataset/setting/permission-form-field.tsx
Adds validation, API/form configuration conversion, ordered DSL operator construction, dataset loading and saving, embedding handling, and tabbed operator forms.
Data source and built-in selector UI
web/src/pages/dataset/dataset-setting/configuration/common-item.tsx, web/src/pages/dataset/setting/components/*
Adds built-in pipeline selection and data-source linking, filtering, editing, rebuilding, unlinking, and auto-parse controls.
Dataset navigation and creation wiring
web/src/routes.tsx, web/src/pages/dataset/sidebar/index.tsx, web/src/pages/datasets/dataset-creating-dialog.tsx, web/src/locales/en.ts, web/src/locales/zh.ts
Adds the next settings route, backend-dependent sidebar entries, built-in parser field handling, and translations.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: 💞 feature, 🧰 typescript

Suggested reviewers: magicbook1108, dcc123456

Poem

A rabbit hops through pipelines bright,
With sliders tuned just right.
DSLs unfold, sources link,
Forms change faster than you think.
“Next configuration!” sings the hare—
With carrots cached everywhere.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: configuring pipeline parameters on the dataset configuration page.
Description check ✅ Passed The description matches the required Summary section and clearly states the PR’s purpose.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cike8899
cike8899 marked this pull request as draft July 20, 2026 07:41
@cike8899
cike8899 marked this pull request as ready for review July 20, 2026 07:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Nitpick comments (5)
web/src/pages/datasets/dataset-creating-dialog.tsx (1)

101-103: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer using the submitted data.parseType.

Instead of relying on the parseType state variable returned by useWatch, it is safer to use data.parseType from the validated form payload during submission. This guarantees the submitted value is perfectly in sync.

♻️ Proposed refactor
-      parseType === ParseType.BuiltIn
+      data.parseType === ParseType.BuiltIn
         ? omit(data, ['pipeline_id'])
         : omit(data, [ChunkMethodName]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/datasets/dataset-creating-dialog.tsx` around lines 101 - 103,
Update the submission payload selection to branch on the validated form
payload’s data.parseType instead of the useWatch-derived parseType state, while
preserving the existing omit behavior for BuiltIn and other parse types.
web/src/pages/agent/form/extractor-form/index.tsx (1)

76-76: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use watch instead of getValues for reactive rendering.

form.getValues() does not trigger component re-renders when the value changes. Although useFormChangeCallback happens to trigger a re-render currently because it uses useWatch on the entire form, relying on this side effect for isToc's reactivity is fragile. Use form.watch('field_name') to explicitly subscribe to this field.

♻️ Proposed refactor
-  const isToc = form.getValues('field_name') === 'toc';
+  const isToc = form.watch('field_name') === 'toc';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/extractor-form/index.tsx` at line 76, Update the
isToc computation in the extractor form component to use
form.watch('field_name') instead of form.getValues('field_name'), explicitly
subscribing to field_name so rendering updates when the field changes.
web/src/pages/dataset/setting/components/link-data-source-modal.tsx (1)

30-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove leftover debug console.log; unused values param.

handleFormSubmit logs values and selectedList but never uses values otherwise, and the button click handler doesn't pass meaningful form values — this looks like a debug artifact left in before merge. As per coding guidelines, debug artifacts and stale code should be removed rather than kept for compatibility.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/components/link-data-source-modal.tsx` around
lines 30 - 33, Remove the debug console.log from handleFormSubmit and eliminate
the unused values parameter, updating its callers as needed while preserving the
existing onSubmit?.(list) behavior.

Source: Coding guidelines

web/src/pages/dataset/setting/embedding-model-form-field.tsx (1)

40-66: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Stale oldValue capture across repeated changes.

oldValue is a useMemo keyed on [form, name], computed once via form.getValues(...) at mount/name-change time; it never recomputes when field.value itself changes. If the embedding model is changed and reverted (failed checkEmbedding) more than once in a session, subsequent reverts fall back to the stale, originally-mounted value instead of the value prior to the latest failed change.

🔧 Proposed fix — capture the previous value at change time
-  const oldValue = useMemo(() => {
-    const embdStr = form.getValues(name || 'embedding_model');
-    return embdStr || '';
-  }, [form, name]);
   const [loading, setLoading] = useState(false);
   return (
     <Spin ...>
       <ModelTreeSelect
         modelTypes={ModelTypeMap.embd_id}
         onChange={async (value) => {
+          const oldValue = field.value || '';
           field.onChange(value);
           if (isEdit && disabled) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/embedding-model-form-field.tsx` around lines 40
- 66, Remove the mount-time oldValue useMemo and capture the current field value
immediately before applying each change in ModelTreeSelect’s onChange handler.
When handleChange returns a nonzero code, restore that captured previous value;
preserve the existing loading and successful-change behavior.
web/src/pages/dataset/setting/components/added-source-card.tsx (1)

65-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove leftover debug console.log.

As per coding guidelines, **/* should have "Remove dead tests, commented-out code, stale documentation" and debug artifacts cleaned up before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/components/added-source-card.tsx` around lines
65 - 68, Remove the leftover debug console.log from the onClick handler in the
added-source card, while preserving the existing onCheck(item) invocation and
click behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/hooks/use-agent-request.ts`:
- Around line 1159-1162: Replace the inline [AgentApiAction.FetchPipelineNodes,
pipelineId] query key in the useQuery call with a domain factory such as
AgentPipelineKeys.detail(pipelineId). Add or extend the appropriate existing
factory to return the key as an as const tuple, while preserving the
BuiltinPipelineKeys.detail branch.

In `@web/src/hooks/use-knowledge-request.ts`:
- Around line 268-275: Update isPipelineParserConfig to explicitly reject array
values before checking parserConfig keys, while preserving the existing false
result for undefined, null, and non-object inputs and the colon-key detection
for plain object configurations.

In `@web/src/pages/agent/hooks/use-form-change-callback.ts`:
- Around line 10-14: Update the use-form-change-callback hook to store the
latest onValuesChange callback in a useRef, updating that ref when the callback
changes, and remove onValuesChange from the value-change effect’s dependencies.
Keep the effect dependent on values so it invokes the current callback without
rerunning solely because the parent recreates its function reference.

In `@web/src/pages/dataset/setting/components/added-source-card.tsx`:
- Around line 41-47: Update onCheck to safely handle an undefined selectedList
in both branches, and when adding an unchecked item, strip the UI-only checked
property before storing it. Keep selectedList entries shaped as
IDataSourceBase/IConnector objects while preserving the existing removal
behavior.

In `@web/src/pages/dataset/setting/components/link-data-source.tsx`:
- Around line 56-63: Guard the dataSourceInfo lookup in the connector list
render before accessing name, using the same optional-chaining and fallback
pattern already used by the pipelineNode memo. Preserve the existing display
behavior for known sources while preventing unknown source keys from crashing
rendering.

In `@web/src/pages/dataset/setting/form-schema.ts`:
- Around line 33-41: Update the superRefine callback in
web/src/pages/dataset/setting/form-schema.ts lines 33-41 to add a BuiltIn-mode
branch requiring parser_id, mirroring the existing pipeline_id validation and
using the same required-selection issue pattern. No direct change is needed in
web/src/pages/dataset/dataset-setting/configuration/common-item.tsx lines
128-135; its required label will align once the schema validation is added.
- Around line 21-31: Rename the misspelled ststus field to status in the
connectors schema so zodResolver preserves the connector status populated by
useFetchDatasetSettingOnMount and forwards it through useSaveDatasetSetting.
- Around line 11-13: The validation message for the name field in the schema
incorrectly references a username and a two-character minimum; update the
message in the name z.string().min(1) rule to describe the dataset name and its
actual one-character minimum.

In `@web/src/pages/dataset/setting/general-form.tsx`:
- Around line 72-101: Remove the description null-normalization and
form.setValue side effect from the FormField render callback. Normalize null or
undefined description values to an empty string when constructing formValues for
useFetchDatasetSettingOnMount’s form.reset call, preserving the existing input
behavior without updates during render.

In `@web/src/pages/dataset/setting/hooks.ts`:
- Around line 143-176: Update useSaveDatasetSetting.handleSave to apply
transformFormConfigToApi only when parser_config is pipeline-mode, using the
same hasPipelineKeys-style detection as useFetchDatasetSettingOnMount. Preserve
BuiltIn parser_config as flat field values, including falsy values, and continue
applying the existing per-operator transformation for pipeline configurations.

In `@web/src/pages/dataset/setting/utils.ts`:
- Around line 311-345: Add cycle protection to the traversal in
buildPipelineOperatorNodes by tracking visited node IDs and stopping when
currentId has already been visited. Preserve the existing ordered node
collection and mapping behavior for acyclic pipelines, while ensuring malformed
cyclic graphs terminate safely.

In `@web/src/services/agent-service.ts`:
- Around line 131-134: Update the getBuiltinPipeline URL configuration to wrap
getBuiltinPipeline with a function that extracts the expected string id from the
provided config object before invoking it; leave the HTTP method unchanged.

---

Nitpick comments:
In `@web/src/pages/agent/form/extractor-form/index.tsx`:
- Line 76: Update the isToc computation in the extractor form component to use
form.watch('field_name') instead of form.getValues('field_name'), explicitly
subscribing to field_name so rendering updates when the field changes.

In `@web/src/pages/dataset/setting/components/added-source-card.tsx`:
- Around line 65-68: Remove the leftover debug console.log from the onClick
handler in the added-source card, while preserving the existing onCheck(item)
invocation and click behavior.

In `@web/src/pages/dataset/setting/components/link-data-source-modal.tsx`:
- Around line 30-33: Remove the debug console.log from handleFormSubmit and
eliminate the unused values parameter, updating its callers as needed while
preserving the existing onSubmit?.(list) behavior.

In `@web/src/pages/dataset/setting/embedding-model-form-field.tsx`:
- Around line 40-66: Remove the mount-time oldValue useMemo and capture the
current field value immediately before applying each change in ModelTreeSelect’s
onChange handler. When handleChange returns a nonzero code, restore that
captured previous value; preserve the existing loading and successful-change
behavior.

In `@web/src/pages/datasets/dataset-creating-dialog.tsx`:
- Around line 101-103: Update the submission payload selection to branch on the
validated form payload’s data.parseType instead of the useWatch-derived
parseType state, while preserving the existing omit behavior for BuiltIn and
other parse types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e895bda4-350f-40a4-af9c-f79bbc17a4c2

📥 Commits

Reviewing files that changed from the base of the PR and between 624b4b0 and c9932eb.

📒 Files selected for processing (34)
  • web/src/components/auto-keywords-form-field.tsx
  • web/src/hooks/use-agent-request.ts
  • web/src/hooks/use-dataflow-request.ts
  • web/src/hooks/use-knowledge-request.ts
  • web/src/interfaces/database/agent.ts
  • web/src/locales/en.ts
  • web/src/locales/zh.ts
  • web/src/pages/agent/constant/pipeline.tsx
  • web/src/pages/agent/form/extractor-form/index.tsx
  • web/src/pages/agent/form/parser-form/index.tsx
  • web/src/pages/agent/form/title-chunker-form/index.tsx
  • web/src/pages/agent/form/token-chunker-form/index.tsx
  • web/src/pages/agent/form/tokenizer-form/index.tsx
  • web/src/pages/agent/hooks/use-form-change-callback.ts
  • web/src/pages/agent/interface.ts
  • web/src/pages/agent/utils.ts
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx
  • web/src/pages/dataset/setting/components/added-source-card.tsx
  • web/src/pages/dataset/setting/components/link-data-source-modal.tsx
  • web/src/pages/dataset/setting/components/link-data-source.tsx
  • web/src/pages/dataset/setting/embedding-model-form-field.tsx
  • web/src/pages/dataset/setting/form-schema.ts
  • web/src/pages/dataset/setting/general-form.tsx
  • web/src/pages/dataset/setting/hooks.ts
  • web/src/pages/dataset/setting/index.tsx
  • web/src/pages/dataset/setting/permission-form-field.tsx
  • web/src/pages/dataset/setting/pipeline-operator-form.tsx
  • web/src/pages/dataset/setting/pipeline-operator-tabs.tsx
  • web/src/pages/dataset/setting/utils.ts
  • web/src/pages/dataset/sidebar/index.tsx
  • web/src/pages/datasets/dataset-creating-dialog.tsx
  • web/src/routes.tsx
  • web/src/services/agent-service.ts
  • web/src/utils/api.ts
💤 Files with no reviewable changes (1)
  • web/src/hooks/use-dataflow-request.ts

Comment on lines +1159 to +1162
const { data: dsl, isFetching: loading } = useQuery({
queryKey: isBuiltin
? BuiltinPipelineKeys.detail(pipelineId!)
: [AgentApiAction.FetchPipelineNodes, pipelineId],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Extract raw query key into a domain factory.

As per coding guidelines, never write raw React Query queryKey arrays inline. Use a domain query-key factory returning as const tuples instead.

Please extract [AgentApiAction.FetchPipelineNodes, pipelineId] into a factory (e.g., AgentPipelineKeys.detail(pipelineId) or add it to an existing factory) and reference it here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/hooks/use-agent-request.ts` around lines 1159 - 1162, Replace the
inline [AgentApiAction.FetchPipelineNodes, pipelineId] query key in the useQuery
call with a domain factory such as AgentPipelineKeys.detail(pipelineId). Add or
extend the appropriate existing factory to return the key as an as const tuple,
while preserving the BuiltinPipelineKeys.detail branch.

Source: Coding guidelines

Comment on lines +268 to +275
function isPipelineParserConfig(
parserConfig: Record<string, any> | undefined,
): boolean {
if (!parserConfig || typeof parserConfig !== 'object') {
return false;
}
return Object.keys(parserConfig).some((key) => key.includes(':'));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add an array check to prevent unintended array processing.

typeof parserConfig === 'object' includes arrays. While an array's keys (indices) won't typically contain a colon (:), it's safer and more consistent with downstream consumers (like useFetchDatasetSettingOnMount) to explicitly exclude arrays.

🐛 Proposed fix
 function isPipelineParserConfig(
   parserConfig: Record<string, any> | undefined,
 ): boolean {
-  if (!parserConfig || typeof parserConfig !== 'object') {
+  if (!parserConfig || typeof parserConfig !== 'object' || Array.isArray(parserConfig)) {
     return false;
   }
   return Object.keys(parserConfig).some((key) => key.includes(':'));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function isPipelineParserConfig(
parserConfig: Record<string, any> | undefined,
): boolean {
if (!parserConfig || typeof parserConfig !== 'object') {
return false;
}
return Object.keys(parserConfig).some((key) => key.includes(':'));
}
function isPipelineParserConfig(
parserConfig: Record<string, any> | undefined,
): boolean {
if (!parserConfig || typeof parserConfig !== 'object' || Array.isArray(parserConfig)) {
return false;
}
return Object.keys(parserConfig).some((key) => key.includes(':'));
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/hooks/use-knowledge-request.ts` around lines 268 - 275, Update
isPipelineParserConfig to explicitly reject array values before checking
parserConfig keys, while preserving the existing false result for undefined,
null, and non-object inputs and the colon-key detection for plain object
configurations.

Comment on lines +10 to +14
useEffect(() => {
if (onValuesChange) {
onValuesChange(values);
}
}, [onValuesChange, values]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Use a stable ref for the callback to prevent latent render loops.

Including onValuesChange in the useEffect dependency array will trigger the effect every time the parent component re-creates the callback reference (e.g., PipelineOperatorTabs dynamically creates it during mapping). If the parent reacts to this change by re-rendering, it will create an infinite loop. Use a useRef to store the latest callback without triggering the effect when the reference changes.

🐛 Proposed fix
+  const onChangeRef = useRef(onValuesChange);
+
+  useEffect(() => {
+    onChangeRef.current = onValuesChange;
+  }, [onValuesChange]);
+
   useEffect(() => {
-    if (onValuesChange) {
-      onValuesChange(values);
+    if (onChangeRef.current) {
+      onChangeRef.current(values);
     }
-  }, [onValuesChange, values]);
+  }, [values]);

Note: Add import { useEffect, useRef } from 'react'; to your imports.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
if (onValuesChange) {
onValuesChange(values);
}
}, [onValuesChange, values]);
const onChangeRef = useRef(onValuesChange);
useEffect(() => {
onChangeRef.current = onValuesChange;
}, [onValuesChange]);
useEffect(() => {
if (onChangeRef.current) {
onChangeRef.current(values);
}
}, [values]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/hooks/use-form-change-callback.ts` around lines 10 - 14,
Update the use-form-change-callback hook to store the latest onValuesChange
callback in a useRef, updating that ref when the callback changes, and remove
onValuesChange from the value-change effect’s dependencies. Keep the effect
dependent on values so it invokes the current callback without rerunning solely
because the parent recreates its function reference.

Comment on lines +41 to +47
const onCheck = (item: IDataSourceBase & { checked: boolean }) => {
if (item.checked) {
setSelectedList(selectedList.filter((i) => i.id !== item.id));
} else {
setSelectedList([...(selectedList || []), item]);
}
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

onCheck missing undefined guard, and pushes an extraneous checked field into selectedList.

Two issues:

  1. Line 43: selectedList.filter(...) has no undefined guard, while the else branch (line 45) does guard with (selectedList || []). If selectedList is briefly undefined (e.g. before the parent modal's sync effect runs), this throws.
  2. Line 45-46: item here originates from the memoized list (line 26-34), which spreads {...item, checked}. Pushing it straight into selectedList propagates a stray checked: true property into the connector objects that eventually reach handleLinkOrEditSubmit in hooks.ts, polluting the saved connector payload with a field not part of IDataSourceBase/IConnector.
🔧 Proposed fix
   const onCheck = (item: IDataSourceBase & { checked: boolean }) => {
+    const { checked, ...rest } = item;
     if (item.checked) {
-      setSelectedList(selectedList.filter((i) => i.id !== item.id));
+      setSelectedList((selectedList || []).filter((i) => i.id !== item.id));
     } else {
-      setSelectedList([...(selectedList || []), item]);
+      setSelectedList([...(selectedList || []), rest]);
     }
   };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const onCheck = (item: IDataSourceBase & { checked: boolean }) => {
if (item.checked) {
setSelectedList(selectedList.filter((i) => i.id !== item.id));
} else {
setSelectedList([...(selectedList || []), item]);
}
};
const onCheck = (item: IDataSourceBase & { checked: boolean }) => {
const { checked, ...rest } = item;
if (item.checked) {
setSelectedList((selectedList || []).filter((i) => i.id !== item.id));
} else {
setSelectedList([...(selectedList || []), rest]);
}
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/components/added-source-card.tsx` around lines
41 - 47, Update onCheck to safely handle an undefined selectedList in both
branches, and when adding an unchecked item, strip the UI-only checked property
before storing it. Keep selectedList entries shaped as
IDataSourceBase/IConnector objects while preserving the existing removal
behavior.

Comment on lines +56 to +63
<div className="flex items-center justify-between gap-1 px-2 h-10 rounded-md border group hover:bg-bg-card">
<div className="flex items-center gap-1">
<div className="w-6 h-6 flex-shrink-0">{icon}</div>
<div className="text-base text-text-primary">
{dataSourceInfo[source].name}
</div>
<div>{name}</div>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Unguarded dataSourceInfo[source] lookup can crash the list render.

If source isn't a key present in dataSourceInfo, dataSourceInfo[source] is undefined and .name throws, breaking the entire connector list. The sibling lookup in this same file (pipelineNode memo, lines 144-146) already guards this with optional chaining and a fallback.

🛡️ Guard the lookup
         <div className="text-base text-text-primary">
-          {dataSourceInfo[source].name}
+          {dataSourceInfo[source as keyof typeof dataSourceInfo]?.name}
         </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="flex items-center justify-between gap-1 px-2 h-10 rounded-md border group hover:bg-bg-card">
<div className="flex items-center gap-1">
<div className="w-6 h-6 flex-shrink-0">{icon}</div>
<div className="text-base text-text-primary">
{dataSourceInfo[source].name}
</div>
<div>{name}</div>
</div>
<div className="flex items-center justify-between gap-1 px-2 h-10 rounded-md border group hover:bg-bg-card">
<div className="flex items-center gap-1">
<div className="w-6 h-6 flex-shrink-0">{icon}</div>
<div className="text-base text-text-primary">
{dataSourceInfo[source as keyof typeof dataSourceInfo]?.name}
</div>
<div>{name}</div>
</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/components/link-data-source.tsx` around lines
56 - 63, Guard the dataSourceInfo lookup in the connector list render before
accessing name, using the same optional-chaining and fallback pattern already
used by the pipelineNode memo. Preserve the existing display behavior for known
sources while preventing unknown source keys from crashing rendering.

Comment on lines +33 to +41
.superRefine((data, ctx) => {
if (data.parse_type === ParseType.Pipeline && !data.pipeline_id) {
ctx.addIssue({
path: ['pipeline_id'],
message: t('common.pleaseSelect'),
code: 'custom',
});
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

parser_id is shown as required but never validated as required. The schema only enforces a required selection for pipeline_id in Pipeline mode; there's no symmetric check for parser_id in BuiltIn mode, even though the UI marks it required.

  • web/src/pages/dataset/setting/form-schema.ts#L33-L41: add a superRefine branch requiring parser_id when data.parse_type === ParseType.BuiltIn, mirroring the existing pipeline_id check.
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx#L128-L135: no change needed once the schema branch above is added; the required label will then match actual validation.
📍 Affects 2 files
  • web/src/pages/dataset/setting/form-schema.ts#L33-L41 (this comment)
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx#L128-L135
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/form-schema.ts` around lines 33 - 41, Update
the superRefine callback in web/src/pages/dataset/setting/form-schema.ts lines
33-41 to add a BuiltIn-mode branch requiring parser_id, mirroring the existing
pipeline_id validation and using the same required-selection issue pattern. No
direct change is needed in
web/src/pages/dataset/dataset-setting/configuration/common-item.tsx lines
128-135; its required label will align once the schema validation is added.

Comment on lines +72 to +101
<FormField
control={form.control}
name="description"
render={({ field }) => {
// null initialize empty string
if (typeof field.value === 'object' && !field.value) {
form.setValue('description', '');
}
return (
<FormItem className="items-center space-y-0">
<div className="flex">
<FormLabel className="text-sm whitespace-nowrap w-1/4">
{t('flow.description')}
</FormLabel>
<FormControl className="w-3/4">
<Input
{...field}
placeholder={t('knowledgeConfiguration.datasetDescription')}
data-testid="ds-settings-basic-description-input"
></Input>
</FormControl>
</div>
<div className="flex pt-1">
<div className="w-1/4"></div>
<FormMessage />
</div>
</FormItem>
);
}}
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Move the description null-normalization out of the render callback.

Calling form.setValue directly inside FormField's render is a side effect during render, which can trigger update-during-render warnings and is not idiomatic for React or react-hook-form. Normalize this in useFetchDatasetSettingOnMount's form.reset(formValues) transform (or a useEffect) instead.

♻️ Suggested fix
       <FormField
         control={form.control}
         name="description"
-        render={({ field }) => {
-          // null initialize empty string
-          if (typeof field.value === 'object' && !field.value) {
-            form.setValue('description', '');
-          }
-          return (
+        render={({ field }) => {
+          return (
             <FormItem className="items-center space-y-0">
               <div className="flex">
                 <FormLabel className="text-sm  whitespace-nowrap w-1/4">
                   {t('flow.description')}
                 </FormLabel>
                 <FormControl className="w-3/4">
                   <Input
-                    {...field}
+                    {...field}
+                    value={field.value ?? ''}
                     placeholder={t('knowledgeConfiguration.datasetDescription')}
                     data-testid="ds-settings-basic-description-input"
                   ></Input>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<FormField
control={form.control}
name="description"
render={({ field }) => {
// null initialize empty string
if (typeof field.value === 'object' && !field.value) {
form.setValue('description', '');
}
return (
<FormItem className="items-center space-y-0">
<div className="flex">
<FormLabel className="text-sm whitespace-nowrap w-1/4">
{t('flow.description')}
</FormLabel>
<FormControl className="w-3/4">
<Input
{...field}
placeholder={t('knowledgeConfiguration.datasetDescription')}
data-testid="ds-settings-basic-description-input"
></Input>
</FormControl>
</div>
<div className="flex pt-1">
<div className="w-1/4"></div>
<FormMessage />
</div>
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="description"
render={({ field }) => {
return (
<FormItem className="items-center space-y-0">
<div className="flex">
<FormLabel className="text-sm whitespace-nowrap w-1/4">
{t('flow.description')}
</FormLabel>
<FormControl className="w-3/4">
<Input
{...field}
value={field.value ?? ''}
placeholder={t('knowledgeConfiguration.datasetDescription')}
data-testid="ds-settings-basic-description-input"
></Input>
</FormControl>
</div>
<div className="flex pt-1">
<div className="w-1/4"></div>
<FormMessage />
</div>
</FormItem>
);
}}
/>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/general-form.tsx` around lines 72 - 101, Remove
the description null-normalization and form.setValue side effect from the
FormField render callback. Normalize null or undefined description values to an
empty string when constructing formValues for useFetchDatasetSettingOnMount’s
form.reset call, preserving the existing input behavior without updates during
render.

Comment on lines +143 to +176
export const useSaveDatasetSetting = () => {
const { saveKnowledgeConfiguration, loading } = useUpdateKnowledge();

const handleSave = useCallback(
async (values: z.infer<typeof formSchema>) => {
const payload = { ...values };

// Apply forward transforms to parser_config if in pipeline mode
if (payload.parser_config) {
const transformedConfig: Record<string, any> = {};
for (const [operatorId, config] of Object.entries(
payload.parser_config,
)) {
const operatorType = getOperatorType(operatorId);
transformedConfig[operatorId] = transformFormConfigToApi(
operatorType,
config as Record<string, any>,
);
}
payload.parser_config = transformedConfig;
}

if (payload.parse_type === ParseType.BuiltIn) {
payload.pipeline_id = undefined;
} else {
payload.parser_id = undefined;
}
return saveKnowledgeConfiguration(payload);
},
[saveKnowledgeConfiguration],
);

return { handleSave, loading };
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

Save transform corrupts built-in mode parser_config values.

useSaveDatasetSetting.handleSave unconditionally runs every parser_config entry through transformFormConfigToApi, regardless of whether the config is in Pipeline mode (operatorId-keyed) or BuiltIn mode (flat field values). Contrast with the fetch-side reverse transform in useFetchDatasetSettingOnMount (lines 80-98), which explicitly checks hasPipelineKeys before applying transformApiConfigToForm.

transformFormConfigToApi (utils.ts) starts with if (!config) return {};. In BuiltIn mode, parser_config fields can be falsy scalars (e.g. delimiter: '', layout_recognize: false, chunk_token_num: 0). Each such field will be silently replaced with {} before being sent to saveKnowledgeConfiguration, corrupting the persisted dataset configuration.

🐛 Proposed fix — guard by pipeline mode
       // Apply forward transforms to parser_config if in pipeline mode
-      if (payload.parser_config) {
+      if (
+        payload.parser_config &&
+        Object.keys(payload.parser_config).some((key) => key.includes(':'))
+      ) {
         const transformedConfig: Record<string, any> = {};
         for (const [operatorId, config] of Object.entries(
           payload.parser_config,
         )) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const useSaveDatasetSetting = () => {
const { saveKnowledgeConfiguration, loading } = useUpdateKnowledge();
const handleSave = useCallback(
async (values: z.infer<typeof formSchema>) => {
const payload = { ...values };
// Apply forward transforms to parser_config if in pipeline mode
if (payload.parser_config) {
const transformedConfig: Record<string, any> = {};
for (const [operatorId, config] of Object.entries(
payload.parser_config,
)) {
const operatorType = getOperatorType(operatorId);
transformedConfig[operatorId] = transformFormConfigToApi(
operatorType,
config as Record<string, any>,
);
}
payload.parser_config = transformedConfig;
}
if (payload.parse_type === ParseType.BuiltIn) {
payload.pipeline_id = undefined;
} else {
payload.parser_id = undefined;
}
return saveKnowledgeConfiguration(payload);
},
[saveKnowledgeConfiguration],
);
return { handleSave, loading };
};
export const useSaveDatasetSetting = () => {
const { saveKnowledgeConfiguration, loading } = useUpdateKnowledge();
const handleSave = useCallback(
async (values: z.infer<typeof formSchema>) => {
const payload = { ...values };
// Apply forward transforms to parser_config if in pipeline mode
if (
payload.parser_config &&
Object.keys(payload.parser_config).some((key) => key.includes(':'))
) {
const transformedConfig: Record<string, any> = {};
for (const [operatorId, config] of Object.entries(
payload.parser_config,
)) {
const operatorType = getOperatorType(operatorId);
transformedConfig[operatorId] = transformFormConfigToApi(
operatorType,
config as Record<string, any>,
);
}
payload.parser_config = transformedConfig;
}
if (payload.parse_type === ParseType.BuiltIn) {
payload.pipeline_id = undefined;
} else {
payload.parser_id = undefined;
}
return saveKnowledgeConfiguration(payload);
},
[saveKnowledgeConfiguration],
);
return { handleSave, loading };
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/hooks.ts` around lines 143 - 176, Update
useSaveDatasetSetting.handleSave to apply transformFormConfigToApi only when
parser_config is pipeline-mode, using the same hasPipelineKeys-style detection
as useFetchDatasetSettingOnMount. Preserve BuiltIn parser_config as flat field
values, including falsy values, and continue applying the existing per-operator
transformation for pipeline configurations.

Comment on lines +311 to +345
export function buildPipelineOperatorNodes(
dsl?: DSL,
pipelineParserConfig: Record<string, any> = {},
): RAGFlowNodeType[] {
if (!dsl?.graph?.nodes || !dsl?.graph?.edges) {
return [];
}

// Build source → target map from edges (pipeline is linear)
const sourceToTarget = new Map<string, string>();
for (const edge of dsl.graph.edges) {
sourceToTarget.set(edge.source, edge.target);
}

// Follow the chain starting from File, collecting node IDs in order
const orderedIds: string[] = [];
let currentId: string | undefined = FileNodeId;
while (currentId) {
orderedIds.push(currentId);
currentId = sourceToTarget.get(currentId);
}

// Build a lookup from node ID → node
const nodeById = new Map<string, RAGFlowNodeType>();
for (const node of dsl.graph.nodes) {
nodeById.set(node.id, node);
}

// Map ordered IDs to nodes, excluding File
return orderedIds
.filter((id) => id !== FileNodeId)
.map((id) => nodeById.get(id))
.filter((node): node is RAGFlowNodeType => node !== undefined)
.map((node) => buildOperatorNode(node, pipelineParserConfig));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Unbounded loop if pipeline graph has a cycle.

buildPipelineOperatorNodes follows sourceToTarget starting at FileNodeId with while (currentId) { orderedIds.push(currentId); currentId = sourceToTarget.get(currentId); } and no visited-set guard. If the DSL graph edges ever contain a cycle (malformed/corrupted pipeline data returned from the API), this loop never terminates and hangs the render thread since this runs inside useMemo in usePipelineOperatorNodes (hooks.ts).

🐛 Proposed cycle guard
   const orderedIds: string[] = [];
+  const visited = new Set<string>();
   let currentId: string | undefined = FileNodeId;
-  while (currentId) {
+  while (currentId && !visited.has(currentId)) {
+    visited.add(currentId);
     orderedIds.push(currentId);
     currentId = sourceToTarget.get(currentId);
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function buildPipelineOperatorNodes(
dsl?: DSL,
pipelineParserConfig: Record<string, any> = {},
): RAGFlowNodeType[] {
if (!dsl?.graph?.nodes || !dsl?.graph?.edges) {
return [];
}
// Build source → target map from edges (pipeline is linear)
const sourceToTarget = new Map<string, string>();
for (const edge of dsl.graph.edges) {
sourceToTarget.set(edge.source, edge.target);
}
// Follow the chain starting from File, collecting node IDs in order
const orderedIds: string[] = [];
let currentId: string | undefined = FileNodeId;
while (currentId) {
orderedIds.push(currentId);
currentId = sourceToTarget.get(currentId);
}
// Build a lookup from node ID → node
const nodeById = new Map<string, RAGFlowNodeType>();
for (const node of dsl.graph.nodes) {
nodeById.set(node.id, node);
}
// Map ordered IDs to nodes, excluding File
return orderedIds
.filter((id) => id !== FileNodeId)
.map((id) => nodeById.get(id))
.filter((node): node is RAGFlowNodeType => node !== undefined)
.map((node) => buildOperatorNode(node, pipelineParserConfig));
}
export function buildPipelineOperatorNodes(
dsl?: DSL,
pipelineParserConfig: Record<string, any> = {},
): RAGFlowNodeType[] {
if (!dsl?.graph?.nodes || !dsl?.graph?.edges) {
return [];
}
// Build source → target map from edges (pipeline is linear)
const sourceToTarget = new Map<string, string>();
for (const edge of dsl.graph.edges) {
sourceToTarget.set(edge.source, edge.target);
}
// Follow the chain starting from File, collecting node IDs in order
const orderedIds: string[] = [];
const visited = new Set<string>();
let currentId: string | undefined = FileNodeId;
while (currentId && !visited.has(currentId)) {
visited.add(currentId);
orderedIds.push(currentId);
currentId = sourceToTarget.get(currentId);
}
// Build a lookup from node ID → node
const nodeById = new Map<string, RAGFlowNodeType>();
for (const node of dsl.graph.nodes) {
nodeById.set(node.id, node);
}
// Map ordered IDs to nodes, excluding File
return orderedIds
.filter((id) => id !== FileNodeId)
.map((id) => nodeById.get(id))
.filter((node): node is RAGFlowNodeType => node !== undefined)
.map((node) => buildOperatorNode(node, pipelineParserConfig));
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/setting/utils.ts` around lines 311 - 345, Add cycle
protection to the traversal in buildPipelineOperatorNodes by tracking visited
node IDs and stopping when currentId has already been visited. Preserve the
existing ordered node collection and mapping behavior for acyclic pipelines,
while ensuring malformed cyclic graphs terminate safely.

Comment on lines +131 to +134
getBuiltinPipeline: {
url: getBuiltinPipeline,
method: 'get',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

Wrap the URL function to extract the string parameter from the config object.

The getBuiltinPipeline function in api.ts expects a string id. However, the registerNextServer wrapper typically invokes the url function with a config object. Passing getBuiltinPipeline directly will cause the config object to be serialized into the URL (e.g., .../pipelines/[object Object]).

🐛 Proposed fix
   getBuiltinPipeline: {
-    url: getBuiltinPipeline,
+    url: (config: { id: string }) => getBuiltinPipeline(config.id),
     method: 'get',
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
getBuiltinPipeline: {
url: getBuiltinPipeline,
method: 'get',
},
getBuiltinPipeline: {
url: (config: { id: string }) => getBuiltinPipeline(config.id),
method: 'get',
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/services/agent-service.ts` around lines 131 - 134, Update the
getBuiltinPipeline URL configuration to wrap getBuiltinPipeline with a function
that extracts the expected string id from the provided config object before
invoking it; leave the HTTP method unchanged.

@wangq8
wangq8 self-requested a review July 20, 2026 08:02

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review — #17100

Title: Feat: Configure the relevant pipeline parameters on the dataset configuration page.
Author: cike8899
Stats: +2078 / -178, 34 files changed


Overview

This PR introduces a new dataset configuration page (/dataset/:id/setting) that allows users to configure pipeline operator parameters directly on the dataset settings page. It refactors several agent operator forms (Parser, TokenChunker, TitleChunker, Tokenizer, Extractor) to be reusable in this new context via onValuesChange and hideOutputs props. It also adds backend-language branching (Go vs Python) and deletes a now-unused use-dataflow-request.ts.


✅ What Looks Good

  1. Clean refactoring of operator forms — Adding onValuesChange and hideOutputs as optional props to the existing forms is a non-breaking, minimal-change approach. Good reuse pattern.
  2. Proper file deletion — use-dataflow-request.ts is cleanly deleted with no remaining imports elsewhere.
  3. Well-organized new module — The new setting/ directory has a clear structure: utils.ts, hooks.ts, form-schema.ts, components, and the main index.tsx.
  4. Backward-compatible route addition — The old /configuration/:id route is preserved under getBackendLanguage() === 'python', while the new /setting/:id route is gated behind getBackendLanguage() === 'go'.
  5. Lossless config transforms — The round-trip transforms (transformApiConfigToForm → transformFormConfigToApi) handle the Parser, Extractor, TokenChunker, TitleChunker, and Tokenizer types correctly.

🚨 Issues to Fix Before Merge

1. Stale console.log statements (4 instances)

These should be removed before landing:

  • web/src/pages/dataset/setting/components/added-source-card.tsx:42 — console.log('item--->', item)
  • web/src/pages/dataset/setting/components/link-data-source-modal.tsx:36 — console.log(values, selectedList)
  • web/src/pages/dataset/setting/components/link-data-source.tsx:97 — console.log('open', open, data)
  • web/src/pages/dataset/setting/components/link-data-source.tsx:107 — console.log('handleLinkOrEditSubmit', data)

2. Typos

  • fileterString → should be filterString (missing 'l') in link-data-source-modal.tsx:20 and its usage throughout.
  • ststus → should be status in form-schema.ts:21 (the connectors schema's field name).
  • "Username must be at least 2 characters." → The name field error message in form-schema.ts is copied from a user form; should be dataset-appropriate, e.g. "Dataset name is required."

3. Potential useEffect dependency issue in hooks.ts:useFetchDatasetSettingOnMount

The useEffect at line ~107 includes form as a dependency. While useForm returns a stable reference, useEffect with form.reset(formValues) could trigger unexpected resets. Consider extracting the reset logic or adding a flag to prevent unnecessary resets after the first mount.

4. getBackendLanguage() check creates a coupling

The sidebar (in sidebar/index.tsx) duplicates the configuration menu items based on getBackendLanguage():

  • Python → /configuration/:id (old page)
  • Go → /setting/:id (new page)

This creates a hard-coded backend-language-driven routing bifurcation. Consider adding a config-level feature flag or route alias instead, so the UI isn't directly tied to backend implementation language.

5. BuiltinPipelineItem uses useFetchBuiltinPipelines with no error handling

The useFetchBuiltinPipelines hook in common-item.tsx calls the API with enabled: true by default. If the API endpoint (/v1/pipelines) is unavailable, the dropdown will silently show no options and the user won't know why. Consider adding a loading state and error feedback.

6. useFormChangeCallback uses any type

export function useFormChangeCallback(
  form: UseFormReturn<any>,
  onValuesChange?: (values: any) => void,
)

Consider typing the generic parameter instead of using any:

export function useFormChangeCallback<TFieldValues>(
  form: UseFormReturn<TFieldValues>,
  onValuesChange?: (values: TFieldValues) => void,
) {

⚠️ Minor Observations / Suggestions

  1. pipeline-operator-form.tsx switch statement — The form switch on operatorType assumes all Operator enum values are covered. If a new operator type is added without updating this switch, it silently returns null. A TypeScript never check in the default branch would catch this at compile time.

  2. gcTime: 0 on queries — Both useFetchBuiltinPipelines and useFetchPipelineDslByPipelineId set gcTime: 0, meaning cache entries are immediately eligible for garbage collection. This causes a refetch on every mount, even if the data hasn't changed. Consider a reasonable cache time (e.g. 5 minutes for pipeline templates).

  3. connectors field in form-schema — The field ststus is a typo. Also, the inline connector schema duplicates what's already typed in IConnector from database/dataset. Consider reusing the existing interface.

  4. The BlockButton type="button" fix — Multiple BlockButton components now have type="button" added. This is a good defensive fix to prevent accidental form submission inside forms.

  5. Import order in extractor-form/index.tsx — The import of useOwnerTenantId was moved down; the original order was fine. Minor style point.


Summary

Category Count
🚨 Must fix before merge 6
⚠️ Should consider 5
✅ Good practices 5

The PR is structurally sound and the feature is well-architected. The main issues are stale console.log statements and typos that should be cleaned up before merge. The backend-language branching approach is pragmatic but could benefit from a more abstract feature-flag mechanism in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants