Skip to content

Fix: Clicking the agent's code tool node is prohibited. - #18165

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
cike8899:feat-structure-wiki
Aug 12, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
cike8899:feat-structure-wiki

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

Summary

Fix: Clicking the agent's code tool node is prohibited.

@cike8899
cike8899 requested a review from wangq8 August 12, 2026 08:27
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 12, 2026
@cike8899
cike8899 marked this pull request as draft August 12, 2026 08:28
@cike8899
cike8899 marked this pull request as ready for review August 12, 2026 08:28
@dosubot dosubot Bot added 🐞 bug Something isn't working, pull request that fix bug. 🧰 typescript Pull requests that update Typescript code labels Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 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 Plus

Run ID: e2453415-27ce-462f-9a50-c43faceda481

📥 Commits

Reviewing files that changed from the base of the PR and between eada2f6 and ab16415.

📒 Files selected for processing (2)
  • web/src/pages/agent/canvas/node/tool-node.tsx
  • web/src/pages/agent/form/agent-form/agent-tools.tsx

📝 Walkthrough

Walkthrough

The change makes Code tools non-interactive in the canvas and non-editable in the agent tool form. Other tools retain their existing click and edit behavior.

Changes

Code tool interaction rules

Layer / File(s) Summary
Disable Code tool card interactions
web/src/pages/agent/canvas/node/tool-node.tsx
Code tool cards omit click behavior, cursor styling, and tool data attributes. Other tool cards retain their interaction attributes.
Disable Code tool editing
web/src/pages/agent/form/agent-form/agent-tools.tsx
ActionButton accepts an optional edit handler. Code tool entries omit the edit button, while deletion remains available. Other tools retain editing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit hops past tools in flight,
Code cards now rest, still and light.
No edit nibble, delete stays near,
Other tools remain sincere.
Hop hop! The canvas is clear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: preventing clicks on the agent's code tool node.
Description check ✅ Passed The description includes the required Summary section and clearly states the purpose of the change.

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.

@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.

LGTM. Clean fix with clear rationale.

The approach is correct: since Code has no config form, making its cards non-interactive by stripping data-tool, data-tool-id, and cursor-pointer attributes is the right solution — the node click handler will correctly ignore clicks on Code cards. The edit prop becoming optional in ActionButton and conditionally rendering the pencil icon only when edit is provided is a clean pattern.

One minor note for future cleanup: the setClickedToolId removal from the destructured useGraphStore() call in tool-node.tsx suggests nothing else in that component uses it. Worth a quick check to confirm it is not needed elsewhere in the same component — but from the diff this looks safe.

Nice work.

@wangq8 wangq8 added the ci Continue Integration label Aug 12, 2026
@wangq8
wangq8 merged commit e2cf2fd into infiniflow:main Aug 12, 2026
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:M This PR changes 30-99 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants