fix(custom-tools): remove unsafe title fallback in getCustomTool (#2929)

* fix(custom-tools): remove unsafe title fallback in getCustomTool

* fix(custom-tools): restore title fallback in getCustomTool lookup

Custom tools are referenced by title (custom_${title}), not database ID.
The title fallback is required for client-side tool resolution to work.
This commit is contained in:
Waleed
2026-01-21 17:36:10 -08:00
committed by GitHub
parent e2ccefb2f4
commit 5987a6d060

View File

@@ -110,15 +110,16 @@ export function getCustomTools(workspaceId?: string): CustomToolDefinition[] {
}
/**
* Get a specific custom tool from the query cache by ID (for non-React code)
* Get a specific custom tool from the query cache by ID or title (for non-React code)
* Custom tools are referenced by title in the system (custom_${title}), so title lookup is required.
* If workspaceId is not provided, extracts it from the current URL
*/
export function getCustomTool(
toolId: string,
identifier: string,
workspaceId?: string
): CustomToolDefinition | undefined {
const tools = getCustomTools(workspaceId)
return tools.find((tool) => tool.id === toolId) || tools.find((tool) => tool.title === toolId)
return tools.find((tool) => tool.id === identifier || tool.title === identifier)
}
/**