From 863b35db7f7d6c3902d3de91d37a90c4fd59cc90 Mon Sep 17 00:00:00 2001 From: Hz_ Date: Tue, 7 Jul 2026 11:08:50 +0800 Subject: [PATCH] fix(go-agent-web): correct BGPT canvas form watcher usage (#16682) ## Summary Fixes a page crash when opening the BGPT node configuration in the canvas. ## Root Cause BGPT was using the tool-form watcher call pattern in a normal canvas component form. Tool forms use: useWatchFormChange(form) Canvas component forms use: useWatchFormChange(node?.id, form) Tool is not equal to component. The BGPT canvas component imported the component-level hook but called it like a tool-form hook, so the form argument became undefined and React Hook Form tried to read control from a null context. ## Change Updated the BGPT canvas form to pass the node id and form instance correctly. ## Validation Ran ESLint for the changed file: npx eslint src/pages/agent/form/bgpt-form/index.tsx image --- web/src/pages/agent/form/bgpt-form/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/agent/form/bgpt-form/index.tsx b/web/src/pages/agent/form/bgpt-form/index.tsx index fa9f672369..c57f81fae9 100644 --- a/web/src/pages/agent/form/bgpt-form/index.tsx +++ b/web/src/pages/agent/form/bgpt-form/index.tsx @@ -81,7 +81,7 @@ function BGPTForm({ node }: INextOperatorForm) { resolver: zodResolver(FormSchema), }); - useWatchFormChange(form); + useWatchFormChange(node?.id, form); return (