Skip to content

1652 Order advisors and wire ToolCallAdvisor in AI agent#4939

Open
ivicac wants to merge 2 commits into
masterfrom
1652
Open

1652 Order advisors and wire ToolCallAdvisor in AI agent#4939
ivicac wants to merge 2 commits into
masterfrom
1652

Conversation

@ivicac
Copy link
Copy Markdown
Contributor

@ivicac ivicac commented May 8, 2026

No description provided.

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 updates the AI Agent component to wire Spring AI tool-calling support via ToolCallingManager/ToolCallAdvisor, and introduces explicit advisor ordering so chat-memory advisors run with a defined precedence.

Changes:

  • Inject ToolCallingManager through the AI Agent component handler/actions and add ToolCallAdvisor to the advisor chain.
  • Define explicit advisor ordering for chat-memory advisors (Prompt/VectorStore variants).
  • Update unit tests to match new constructors/signatures.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/libs/modules/components/ai/agent/src/test/java/com/bytechef/component/chat/AiAgentComponentHandlerTest.java Updates handler construction for the new constructor signature.
server/libs/modules/components/ai/agent/src/test/java/com/bytechef/component/ai/agent/action/AbstractAiAgentChatActionTest.java Adds ToolCallingManager mocking and updates action construction.
server/libs/modules/components/ai/agent/src/main/java/com/bytechef/component/ai/agent/AiAgentComponentHandler.java Injects ToolCallingManager and wires it into chat/stream chat actions.
server/libs/modules/components/ai/agent/src/main/java/com/bytechef/component/ai/agent/action/AiAgentStreamChatAction.java Threads ToolCallingManager into the stream chat action.
server/libs/modules/components/ai/agent/src/main/java/com/bytechef/component/ai/agent/action/AiAgentChatAction.java Threads ToolCallingManager into the chat action and updates factory method signature.
server/libs/modules/components/ai/agent/src/main/java/com/bytechef/component/ai/agent/action/AbstractAiAgentChatAction.java Adds ToolCallAdvisor wiring and adjusts advisor composition around chat memory.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-vectorstore/src/main/java/com/bytechef/component/ai/chat/memory/cluster/VectorStoreChatMemory.java Sets explicit advisor order for vectorstore chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-redis/src/main/java/com/bytechef/component/ai/agent/chat/memory/redis/cluster/RedisChatMemory.java Sets explicit advisor order for redis chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-neo4j/src/main/java/com/bytechef/component/ai/agent/chat/memory/neo4j/cluster/Neo4jChatMemory.java Sets explicit advisor order for neo4j chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-mongodb/src/main/java/com/bytechef/component/ai/agent/chat/memory/mongodb/cluster/MongoDbChatMemory.java Sets explicit advisor order for mongodb chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-jdbc/src/main/java/com/bytechef/component/ai/agent/chat/memory/jdbc/cluster/JdbcChatMemory.java Sets explicit advisor order for jdbc chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-in-memory/src/main/java/com/bytechef/component/ai/agent/chat/memory/memory/cluster/InMemoryChatMemory.java Sets explicit advisor order for in-memory chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-cosmosdb/src/main/java/com/bytechef/component/ai/agent/chat/memory/cosmosdb/cluster/CosmosDbChatMemory.java Sets explicit advisor order for cosmosdb chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-cassandra/src/main/java/com/bytechef/component/ai/agent/chat/memory/cassandra/cluster/CassandraChatMemory.java Sets explicit advisor order for cassandra chat memory advisor.
server/libs/modules/components/ai/agent/chat-memory/chat-memory-builtin/src/main/java/com/bytechef/component/ai/agent/chat/memory/builtin/cluster/ChatMemory.java Sets explicit advisor order for builtin chat memory advisor.

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

@ivicac ivicac requested a review from marko-kriskovic May 8, 2026 14:52
…visor wiring

Standardize (AiAgentToolFacade, ClusterElementDefinitionService, ToolCallingManager)
across AiAgentChatAction.of, AiAgentStreamChatAction.of, their constructors, and
the AiAgentComponentHandler call sites. Add tests asserting ToolCallAdvisor is
present in the advisor list and that disableInternalConversationHistory() is
applied only when a chat-memory advisor is configured.

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

sonarqubecloud Bot commented May 8, 2026

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.

2 participants