Skip to content

fix(go-agent-web): correct BGPT canvas form watcher usage - #16682

Merged
yuzhichang merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/agent-BGPT
Jul 7, 2026
Merged

yuzhichang merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/agent-BGPT

Conversation

@Harry-Hz-Zhang

Copy link
Copy Markdown
Contributor

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

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 7, 2026
@Harry-Hz-Zhang Harry-Hz-Zhang added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 70e7ffa2-9f03-4ad7-bb7e-36da33f3a313

📥 Commits

Reviewing files that changed from the base of the PR and between ab5958f and 380c558.

📒 Files selected for processing (1)
  • web/src/pages/agent/form/bgpt-form/index.tsx

📝 Walkthrough

Walkthrough

The useWatchFormChange hook call in BGPTForm was modified to pass node?.id as an additional argument alongside the form instance, changing the hook invocation from a single argument to two arguments.

Changes

BGPT Form Watch Update

Layer / File(s) Summary
Pass node id to watch hook
web/src/pages/agent/form/bgpt-form/index.tsx
useWatchFormChange call updated to include node?.id as the first argument alongside the form instance.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A tiny hop, a single line,
node?.id now joins the form's design,
One rabbit cheer for changes small,
Watching forms that heed the call! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the BGPT canvas form watcher fix.
Description check ✅ Passed The description includes the required Summary section and enough context, root cause, change, and validation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@yuzhichang
yuzhichang merged commit 863b35d into infiniflow:main Jul 7, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants