-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(custom-tools): remove unsafe title fallback in getCustomTool #2929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR restores title-based lookup in The implementation combines ID and title matching into a single Note: The PR title says "remove unsafe title fallback" but the actual change restores it. The commit message correctly describes this as restoring the title lookup. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Client Code
participant Utils as tools/utils.ts
participant Query as custom-tools.ts
participant Cache as React Query Cache
participant DB as Database
Client->>Utils: getTool("custom_myTool")
Utils->>Utils: Extract identifier = "myTool"
Utils->>Query: getCustomTool("myTool")
Query->>Query: Extract workspaceId from URL
Query->>Cache: getQueryData(workspaceId)
alt Cache Hit
Cache-->>Query: Return cached tools[]
Query->>Query: find(tool => tool.id === "myTool" || tool.title === "myTool")
Query-->>Utils: Return matching tool
Utils-->>Client: Return ToolConfig
else Cache Miss
Cache-->>Query: Return undefined/empty
Query-->>Utils: Return undefined
Utils-->>Client: Return undefined
end
Note over Query,DB: Title is unique per workspace<br/>(custom_tools_workspace_title_unique)
|
Custom tools are referenced by title (custom_${title}), not database ID.
The title fallback is required for client-side tool resolution to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
getCustomToolthat could return wrong tool if titles collideType of Change
Testing
Checklist