TanStack AI version#
v0.29.0
Framework/Library version#
Describe the bug and the steps to reproduce it#
__lazy__tool__discovery__ tool checks lazyToolMap but it does not check already discoveredTools
https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/tools/lazy-tool-manager.ts#L221-L239
This can happen if models hallucinate or in long context scenarios just overlook the already discovered tool and request a discovery.
Additionally, can DISCOVERY_TOOL_NAME be exported so that in custom compaction scenarios the const can be used instead of hard-coding the name which might change in future?
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
Not needed
Screenshots or Videos (Optional)#
No response
Do you intend to try to help solve this bug with your own PR?#
No response
Terms & Code of Conduct#