Untitled conversation
- User
[BUG] @Tool methods not inherited from superclas
@Toolmethods not inherited from superclass. I think this is a bug as this is something that should work.I didn't 100% verify this, but my inherited tools weren't being called and the LLM was stating that it didn't know what tool to call. Once I put the tool methods back in the concrete class, things worked, so I'm assuming that this bug report is true.
This should be done in LC4J too if it already doesn't work there.
Interface
No new interfaces are introduced.
- Assistant
I’ll trace how tool methods are discovered, reproduce the inheritance gap with a focused test, then patch and run the relevant module tests.
- Assistant
The discovery code uses
getDeclaredMethods(), which only sees the concrete class. I found the same gap in both the core tool-specification utility and AI-service executable-tool discovery; I’m preserving support for non-public methods declared directly on a tool class while adding inherited public methods. - Assistant
The patch now covers both advertised specifications and actual invocation, and it keeps directly declared package-private/private tools discoverable. I’ve added regression tests that verify an inherited tool appears and executes through the AI-service path.
- Assistant
Compilation is clean. The repository’s configured test runner needs a missing local Maven artifact, so I’m keeping verification offline and invoking the two compiled regression tests directly with the locally cached test/runtime classpath.
- Assistant
One edge case matters here: tool methods are already allowed to be non-public, so limiting inheritance to Java reflection’s public-only view would be inconsistent. I’m tightening discovery to walk superclasses, include inherited package/protected methods, exclude private superclass methods, and avoid re-adding overridden signatures.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.