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
The bug is confirmed: tool scanning uses
getDeclaredMethods(), which does not include inherited methods. Let me look at the other affected spots. - Assistant
Now let me check how
Utilsis structured and find existing tests for these classes. - Assistant
Now add the utility method to
Utils, right aftergetAnnotatedMethod: - Assistant
Now update
ToolSpecificationsin core: - Assistant
Now
ToolService.findTools: - Assistant
Now add tests. Let me look at the existing test files:
- Assistant
Now add tests. First to
ToolSpecificationsTest(core): - Assistant
Now
ToolServiceTest: - Assistant
APIs match. Now build and run the tests:
- Assistant
Core tests pass (19/19). Now the
langchain4jmodule — install core first, then run the tool tests: - Assistant
Test compilation doesn't retain parameter names here. Adjust the test arguments:
- Assistant
All targeted tests pass. Now run the full unit test suites of both modules to catch regressions:
- Assistant
While tests run, check for any other
@Toolscanning spots I may have missed: - Assistant
While waiting, let me review the full diff:
- Assistant
Two concurrent Maven runs are competing over the same
targetdirectory. Kill the older duplicate and let the newer one finish: - Assistant
Process bookkeeping got tangled with duplicate runs. Let me clean up and run once, cleanly:
- Assistant
Clean. Now run the full suite once in the foreground:
- Assistant
The full suite is done: 1384 tests, 0 failures, 1 error, 2 skipped — and the single error is , which fails with trying to fetch a document from an external URL. That's a network restriction of this environment, unrelated to the change (it touches document loading, not tools).
- Assistant
That's the stale monitor from the earlier duplicate run timing out — no action needed. The suite was already verified in the final foreground run: 1384 tests, with the only error being the pre-existing, network-dependent
UrlDocumentLoaderTest(external URL timeout in this sandbox). The fix and its tests all pass.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.