PR to fix a bug on the AI Agent node when dissabling tools

Hey guys, I believe I saw in a previous thread that @Jon may be the one I need to target for this.

I created a PR that I need looked at, I am not sure on the internal processes when it comes to PRs, but I did not want it to get lost in the ocean you guys have on your hands!

Its a pretty simple PR, the issue we had was with tool heavy AI Agent nodes, if you dissable a tool the agent would call what seems to be random tools, but looking closer I noticed its actually calling one tool up or down from the one that its supposed to.

What happened here was that toolkitConnections excluded the dissabled tools with a filter but parentNodes did not, so this created a index mismatch between the 2 causing the agent to call the wrong tool sourceNodeName.
The PR is just adding the same filter to parentNodes.

Thanks again.

Cheers
Dom

Hi @Dom_T welcome to the n8n community!

for this type of content, it’s better to use the Know issues category; this section is usually for general questions about possible issues or bugs.