Skip to content
Source
Sign inSign up
TanStack/ai

@tanstack/ai: Lazy tool execution returns error even when the requested tool is already discovered #788

Send to my agent
Closedmanish-baghel(GitHub profile, opens in a new tab) opened this issue 0 comments

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?

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

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. AlemTuzlak closed this

Sign in to join this conversation.