Repository navigation
Fix: The operator field of the compiler operator is a required field. - #18212
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe compilation template field is now required in the UI and form schema. English and Chinese validation messages were added. The schema now uses a translation-aware hook. ChangesCompilation template validation
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to The compiler operator form enforces a non-empty operator field while retaining localized validation and required-field wiring; no actionable merge-blocking risk remains beyond normal checks. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
wangq8
left a comment
There was a problem hiding this comment.
Makes the compiler operator field required — reasonable and matches the intent. The new compilationTemplateRequired key is correctly placed under knowledgeConfiguration (next to compilationTemplate), and the useFormSchema hook resolves it via useTranslation() in the right namespace. A few notes:
-
Merge conflict with #18216. Both PRs rewrite
FormSchemainweb/src/pages/agent/form/compilation-form/index.tsxand touch the same locale blocks (en.ts/zh.ts). This PR keepsplan, #18216 replacesplanwithmode. Coordinate merge order; the second one to land will need a rebase. -
FormSchemarecreated every render. Moving it intouseFormSchema()means a new schema (andzodResolver) is built on each render. Functionally fine with react-hook-form, but consider wrapping inuseMemoto avoid churn. -
Hardcoded
requiredonCompilationTemplateFormField. It's currently only used incompilation-form(verified), so this is fine today — but if the component is ever reused for an optional field, the unconditionalrequiredwill be wrong. Consider making it a prop defaulting tofalse. -
Minor: the
zh.ts/en.tsdiff also carries unrelated formatter reformats (missing_name,ttsTip), harmless noise.
LGTM once the merge-order conflict with #18216 is acknowledged.
Summary
Fix: The operator field of the compiler operator is a required field.