-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Feature] exclude tools from agent #1440
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: dac5f80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
No issues found across 6 files
Greptile SummaryThis PR adds support for excluding specific tools from agent execution via the Key changes:
Issues found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant AgentHandler as V3AgentHandler
participant Validator as validateExperimentalFeatures
participant PromptBuilder as buildAgentSystemPrompt
participant ToolsFactory as createAgentTools
participant FilterTools as filterTools
participant LLM as Language Model
User->>AgentHandler: execute({instruction, excludeTools: ["screenshot", "extract"]})
AgentHandler->>Validator: validateExperimentalFeatures(excludeTools)
alt CUA Mode
Validator-->>AgentHandler: Error: excludeTools not supported in CUA
else Experimental disabled
Validator-->>AgentHandler: Error: requires experimental: true
else Valid
Validator-->>AgentHandler: ✓ Validation passed
end
AgentHandler->>PromptBuilder: buildAgentSystemPrompt({excludeTools})
PromptBuilder->>PromptBuilder: buildToolsSection(mode, hasSearch, excludeTools)
Note over PromptBuilder: Filter tools from<br/>system prompt description
PromptBuilder-->>AgentHandler: System prompt (without excluded tools)
AgentHandler->>ToolsFactory: createTools(excludeTools)
ToolsFactory->>ToolsFactory: Create all tools
ToolsFactory->>FilterTools: filterTools(allTools, mode, excludeTools)
Note over FilterTools: 1. Filter by mode (dom/hybrid)<br/>2. Delete excluded tools
FilterTools-->>ToolsFactory: Filtered toolset
ToolsFactory-->>AgentHandler: Available tools
AgentHandler->>LLM: generateText({tools, systemPrompt})
Note over LLM: Agent only sees and can use<br/>non-excluded tools
LLM-->>AgentHandler: Result
AgentHandler-->>User: AgentResult
|
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, 2 comments
| { name: "close", description: "Mark the task as complete or failed" }, | ||
| ]; | ||
|
|
||
| const baseTools = isHybridMode ? hybridTools : domTools; |
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.
nice rearrangement, we could also centralize some of the commonly shared tools (goto, close..) to extend with the custom hybrid/dom ones
miguelg719
left a comment
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.
lgtm we should add a couple unit tests. Also should there be tools that cannot be disabled (i.e close)?
why
Allow users to exclude specific tools from agent
what changed
excludeToolsoption toagent.execute()that accepts an array of tool names to excludetest plan
Summary by cubic
Adds an excludeTools option to agent.execute so you can disable specific tools per run. Excluded tools are removed from both the available toolset and the system prompt to reduce unwanted calls.
Written for commit dac5f80. Summary will update automatically on new commits.