-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(tool-input): allow multiple instances of workflow block or kb tools as agent tools #2495
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
…ls as agent tools
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR enables using multiple instances of workflow executor and knowledge base tools in agent blocks. Previously, the UI prevented selecting the same tool twice, but this was overly restrictive since each instance can target a different workflow or knowledge base. The implementation creates unique tool IDs by appending resource IDs (workflowId/knowledgeBaseId) when transforming tools for the LLM, then strips these suffixes during execution to look up the base tool configuration. This allows the LLM to distinguish between instances while the execution layer uses the shared tool definition. Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Tool Input UI
participant Transform as transformBlockTool
participant Agent as Agent Handler
participant LLM as LLM Provider
participant Execute as executeTool
participant Normalize as normalizeToolId
participant Tool as Tool Config
UI->>UI: User adds workflow/KB tool instance
Note over UI: isToolAlreadySelected returns false<br/>for workflow & knowledge blocks
UI->>Transform: tool with workflowId/knowledgeBaseId
Transform->>Transform: Create unique ID<br/>(e.g., workflow_executor_uuid)
Transform-->>Agent: {id: "workflow_executor_uuid", params, ...}
Agent->>LLM: Send tools with unique IDs
LLM->>LLM: Agent decides to call tool
LLM-->>Agent: tool_call: "workflow_executor_uuid"
Agent->>Execute: executeTool("workflow_executor_uuid", params)
Execute->>Normalize: normalizeToolId("workflow_executor_uuid")
Normalize-->>Execute: "workflow_executor"
Execute->>Tool: getTool("workflow_executor")
Tool-->>Execute: Tool config
Execute->>Execute: Execute tool with params
Execute-->>Agent: Tool result
|
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.
5 files reviewed, 1 comment
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
Summary
Type of Change
Testing
Tested manually
Checklist