Untitled conversation
- User
[BUG] Duplicate
activate_skilltool definition error when usingAgenticServices.createAgenticSystem()Describe the bug When creating an agentic system withAgenticServices.createAgenticSystem(), even with a single agent, the application throws anIllegalConfigurationException: Duplicated definition for tool: activate_skillduring execution, caused by multiple registrations of non-dynamicToolProviderinstances.Log and Stack trace
codeCaused by: dev.langchain4j.service.IllegalConfigurationException: Duplicated definition for tool: activate_skill at dev.langchain4j.service.tool.ToolService.addTools(ToolService.java:398) at dev.langchain4j.service.tool.ToolService.lambda$createContextFromStaticToolsAndProviders$0(ToolService.java:378) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at dev.langchain4j.service.tool.ToolService.createContextFromStaticToolsAndProviders(ToolService.java:371) at dev.langchain4j.service.tool.ToolService.createContext(ToolService.java:338) at dev.langchain4j.service.DefaultAiServices$1.invoke(DefaultAiServices.java:260) at dev.langchain4j.service.DefaultAiServices$1.invoke(DefaultAiServices.java:154) at jdk.proxy2/jdk.proxy2.$Proxy5.test(Unknown Source) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ... 5 moreTo Reproduce
java - Assistant
I’ll trace the agentic-system construction and existing tool-provider tests, then patch the registration logic and add a focused regression test for non-dynamic providers.
- Assistant
rgisn’t installed in this checkout, so I’m using the repository’s available search tools and first checking local contribution guidance and the working tree before editing. - Assistant
The duplication is broader than
Skills:AgentBuilderapplies declarative suppliers in its constructor, andcreateAgenticSystemapplies the entire declarative configuration a second time. I’m narrowing the second pass to the default model plus user configurator, preserving directagentBuilder(...)behavior and avoiding repeat supplier invocation altogether. - Assistant
The regression test now reproduces the reported
activate_skillcollision path with a local stub model. The implementation change is in place; I’m running the focused module test, then I’ll run nearby declarative-agent tests to catch configuration regressions. - Assistant
The build wrapper attempted remote snapshot resolution, so I stopped it and switched Maven to offline mode to honor the no-network constraint. The source-level regression remains fully local.
- Assistant
The offline reactor compiled all affected production and test sources successfully. Test execution itself is blocked because the local Maven cache lacks Surefire’s JUnit Platform provider; I’m doing a final compatibility/format pass and checking whether an already-cached runner can execute the regression without network access.
- Assistant
The regression now executes successfully against the compiled local classes: the agent returns normally and the supplier is invoked exactly once. I found and corrected a test visibility issue during that run; I’m also tightening the internal API change so existing callers of the general declarative configurator retain their prior semantics.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.