Skip to content

4761 Fix nested AI agent tool connection resolution#4762

Merged
ivicac merged 3 commits intomasterfrom
4761
Apr 14, 2026
Merged

4761 Fix nested AI agent tool connection resolution#4762
ivicac merged 3 commits intomasterfrom
4761

Conversation

@ivicac
Copy link
Copy Markdown
Contributor

@ivicac ivicac commented Apr 14, 2026

Resolve cluster elements recursively so tools nested inside an AI agent
tool (e.g. hubspot_1 inside aiAgent_tool_1) are found by both option and
display-condition facades.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Resolve cluster elements recursively so tools nested inside an AI agent
tool (e.g. hubspot_1 inside aiAgent_tool_1) are found by both option and
display-condition facades.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes resolution of cluster elements nested inside other cluster elements (notably tools nested inside an AI Agent tool) so they can be discovered consistently by facades that rely on cluster-element lookup.

Changes:

  • Added recursive nested lookup to ClusterElementMap.getClusterElement(...) so nested cluster elements can be resolved by workflow node name.
  • Updated option resolution to include input-parameter evaluation for nested cluster elements (so options can resolve dependencies across nested tools).
  • Added unit tests for nested resolution in ClusterElementMap and wired the API module’s test dependency needed for the new test.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.../WorkflowNodeParameterFacadeImpl.java Adjusts cluster element map resolution to traverse nested CLUSTER_ELEMENTS recursively.
.../WorkflowNodeOptionFacadeImpl.java Recursively aggregates evaluated parameters for nested cluster elements.
.../ClusterElementMapTest.java Adds tests covering direct and nested cluster element resolution + missing element behavior.
.../ClusterElementMap.java Implements recursive nested search for cluster elements within cluster element extensions.
.../platform-configuration-api/build.gradle.kts Adds test-support dependency required by the new API test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ivicac ivicac requested a review from marko-kriskovic April 14, 2026 19:21
@marko-kriskovic
Copy link
Copy Markdown
Collaborator

marko-kriskovic commented Apr 14, 2026

bug in question is fixed. it leads us to the next one :).

When initiating chat and telling it to call the nested tool I get this error:
org.springframework.ai.tool.execution.ToolExecutionException: ExecutionException{entityClass=interface com.bytechef.component.definition.ClusterElementDefinition, errorKey=104, errorMessageArguments=null, inputParameters=ParameterMapImpl{map={toolDescription=helps find hubspot tools, conversationId=n8js0fhtb2po7z05u7sfnsx1ervo07vj, response={responseFormat=TEXT}, userPrompt=Find HubSpot user with ID 757086160081 and return their details (name, email, role, status, and teams if available)., format=SIMPLE, toolName=hubspotTools}}} com.bytechef.exception.ExecutionException: Unsupported cluster element type: com.bytechef.component.ai.agent.tool.AiAgentChatTool$$Lambda/0x000000006f508460
at org.springframework.ai.tool.function.FunctionToolCallback.callMethod(FunctionToolCallback.java:120)
at org.springframework.ai.tool.function.FunctionToolCallback.call(FunctionToolCallback.java:105)
at com.bytechef.component.ai.agent.action.AbstractAiAgentChatAction$2.lambda$call$1(AbstractAiAgentChatAction.java:387)
at com.bytechef.component.ai.agent.action.AbstractAiAgentChatAction$2.observeAndCall(AbstractAiAgentChatAction.java:406)
at com.bytechef.component.ai.agent.action.AbstractAiAgentChatAction$2.call(AbstractAiAgentChatAction.java:387)
at org.springframework.ai.tool.augment.AugmentedToolCallback.call(AugmentedToolCallback.java:112)
at org.springframework.ai.model.tool.DefaultToolCallingManager.lambda$executeToolCall$3(DefaultToolCallingManager.java:228)
at io.micrometer.observation.Observation.observe(Observation.java:634)
Caused by: ExecutionException{entityClass=interface com.bytechef.component.definition.ClusterElementDefinition, errorKey=104, errorMessageArguments=null, inputParameters={toolDescription=helps find hubspot tools, conversationId=n8js0fhtb2po7z05u7sfnsx1ervo07vj, response={responseFormat=TEXT}, userPrompt=Find HubSpot user with ID 757086160081 and return their details (name, email, role, status, and teams if available)., format=SIMPLE, toolName=hubspotTools}} com.bytechef.exception.ExecutionException: ExecutionException{entityClass=interface com.bytechef.component.definition.ClusterElementDefinition, errorKey=104, errorMessageArguments=null, inputParameters=ParameterMapImpl{map={toolDescription=helps find hubspot tools, conversationId=n8js0fhtb2po7z05u7sfnsx1ervo07vj, response={responseFormat=TEXT}, userPrompt=Find HubSpot user with ID 757086160081 and return their details (name, email, role, status, and teams if available)., format=SIMPLE, toolName=hubspotTools}}} com.bytechef.exception.ExecutionException: Unsupported cluster element type: com.bytechef.component.ai.agent.tool.AiAgentChatTool$$Lambda/0x000000006f508460
at com.bytechef.platform.component.service.ClusterElementDefinitionServiceImpl.doExecuteTool(ClusterElementDefinitionServiceImpl.java:462)
at com.bytechef.platform.component.service.ClusterElementDefinitionServiceImpl.executeTool(ClusterElementDefinitionServiceImpl.java:204)
Caused by: ExecutionException{entityClass=interface com.bytechef.component.definition.ClusterElementDefinition, errorKey=104, errorMessageArguments=null, inputParameters=ParameterMapImpl{map={toolDescription=helps find hubspot tools, conversationId=n8js0fhtb2po7z05u7sfnsx1ervo07vj, response={responseFormat=TEXT}, userPrompt=Find HubSpot user with ID 757086160081 and return their details (name, email, role, status, and teams if available)., format=SIMPLE, toolName=hubspotTools}}} com.bytechef.exception.ExecutionException: Unsupported cluster element type: com.bytechef.component.ai.agent.tool.AiAgentChatTool$$Lambda/0x000000006f508460
at com.bytechef.platform.component.service.ClusterElementDefinitionServiceImpl.doExecuteTool(ClusterElementDefinitionServiceImpl.java:455)

@sonarqubecloud
Copy link
Copy Markdown

@ivicac ivicac merged commit b2eb3ed into master Apr 14, 2026
7 checks passed
@ivicac ivicac deleted the 4761 branch April 14, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: connection in tools of nested ai agent not recognized

3 participants