mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-09-29 12:22:40 +00:00
🐛 fix: Provision search files for programmatic tool calls
A file_search configured with allowed_callers: ['code_execution'] is reachable only through run_tools_with_code, whose nested tool names never reach the provisioning predicate, so the nested search ran before queued attachments were embedded and silently searched without them. Programmatic tool calls now mark the turn as needing search.
This commit is contained in:
parent
ed2969a27b
commit
b5a274cbb3
1 changed files with 7 additions and 1 deletions
|
|
@ -473,7 +473,13 @@ const initializeClient = async ({
|
|||
toolNames.includes(Constants.EDIT_FILE) ||
|
||||
toolNames.includes(Constants.WRITE_FILE) ||
|
||||
toolNames.includes(Constants.BASH_PROGRAMMATIC_TOOL_CALLING);
|
||||
const needsSearch = toolNames.includes('file_search');
|
||||
/** Programmatic tool calling orchestrates nested tools whose names never reach
|
||||
* this predicate, so a file_search reachable only through PTC would otherwise
|
||||
* run before its attachments were embedded. Provision when PTC is invoked. */
|
||||
const needsSearch =
|
||||
toolNames.includes('file_search') ||
|
||||
toolNames.includes(Constants.PROGRAMMATIC_TOOL_CALLING) ||
|
||||
toolNames.includes(Constants.BASH_PROGRAMMATIC_TOOL_CALLING);
|
||||
|
||||
if (!needsCode && !needsSearch) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue