Feature: Enhanced Tool Management, New Agent Tools, and LLM Retry Options#360
Feature: Enhanced Tool Management, New Agent Tools, and LLM Retry Options#360szmania wants to merge 0 commit intocecli-dev:mainfrom
Conversation
|
So I am not going to merge this as is (it's simply way to much code, features, and enmeshment) and there are a few issues that I have with it and a few things here that I like for subsequent, more-focused PRs. Tool Calls/Tool CreatorIssues/ThoughtsI don't think tool creation is an omnipresent need/primary action of the system and as such should not have the space devoted to it in the system prompt that it has. I also think the file loader logic is very much overcomplicated. I am already working on a generic file based plugin import system with this as the core: https://medium.com/@david.bonn.2010/dynamic-loading-of-python-code-2617c04e5f3f using importlib.util as my north star on allowing user-defined files into the system. Once this is added, creating a tool will be more about creating something that properly extends BaseTool and after @gopar's changes in: are finished, reloading the MCP server with new tool definitions to support tool commands will be much more straightforward. RecommendationsThe tool command API makes sense and should be refactored to work with the generic plugin loader I'll add in the next version and @gopar's changes when he finishes them. We should definitely keep these commands: /tools: List available standard and user-defined tools. Context ManagementIssues/ThoughtsSo, first, we actually already have a ContextManager tool now as of 0.92.0: For the addition/removal of in context files. I also don't really think agent controlled, percentage-based context compaction will work since, a decent amount of the time, the agent will remove context it actually needs and then need to re-find it all again. RecommendationsReview the existing context compaction logic (e.g. what happens when The opportunity for extension is adding a file content size check variant to this logic. Compaction (really truncation in this instance) is probably best done by injecting a user message in the stream or modifying the final reminders message (view Retry SettingsRecommendationsI generally like these changes but they are likely to need work to merge cleanly with @chrisnestrud's changes to models.py with the ModelProviderManager. They may be orthogonal but I wouldn't be surprised if they aren't. My only real issue is that it adds to the command line sprawl. I would prefer new, related settings be implemented much closer to how and lookup retries:
timeout: <number>
backoff-factor: <number>
retry-on-unavailable: <boolean>And this nested structure can be extended more or less indefinitely as long as we set defaults for all options when not present at parse time. Really, the compaction logic can almost certainly also be placed into unified structure like this. Eventually, this will make settings documentation much more straightforward as all of these blocks will be independently configurable |
How do you envision users to create new tools in this plugin loader? |
Also curious how you will handle external dependencies for custom tools with this new plugin loader. Say a new tool requires duckduckgo search or something. |
|
To answer your questions: Based on: A generalized file based importer than can be made to read from files and directories and can directly insert tools into a centralized registry of tools. I see creating custom tools being the full responsibility of the user. LLMs can absolutely be used at their discretion to create something that complies with the base class and can be placed really where ever the user wants it to be. If a user needs specific external dependencies, I am going to assume they are python advanced enough to configure Per my previous comment, adding the commands that allow for the management/addition/removal of these things at run time is a good next step |
|
Ok i'll start breaking out the things from this PR into smaller PRs that are not blocked by pre-requisites. |
This pull request introduces several significant enhancements to Aider-CE, focusing on tool management, agent capabilities, and robust LLM interactions.
Key Changes:
1. Enhanced Tool Management (
/tools*commands)A new suite of commands has been introduced to manage custom tools directly from the chat interface:
Other improvements to tool management include:
Tool Scopes
Tools in Aider-CE are categorized into three scopes:
.aider/tools/directory within your project's repository and are only available for that project.~/.aider/tools/directory in your home folder.2. New Agent Tools
Two powerful new tools have been added to the AgentCoder's registry:
keep_percentsupport) and removing unneeded files.3. LLM Retry Options
Added new command-line arguments to
args.pyto improve reliability during intermittent API issues:--retry-timeout: Set the timeout for retrying LLM calls.--retry-backoff-factor: Configure the exponential backoff factor for retries.--retry-on-unavailable: Enable automatic retries on service unavailable errors.4. Other Improvements
--add-gitignore-files.fzfsupport for session commands and improved session name completions.This PR compiles changes from over 100 commits since tag v0.90.6, providing a more robust and extensible foundation for Aider-CE.