-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow the LLM to rename/move files and directories #528
Comments
I think this makes a lot of sense to ask and is probably something aider can and/or should handle. |
Thanks for trying aider and filing this issue. I agree, this is a nice to have capability and I have ideas for how to implement it. |
What are your ideas on how to implement it? I may have done cycles to create a PR. |
I'd like to allow the model to return arbitrary shell commands, which aider will recognize and ask the user if they'd like to run them. This is a pretty general capability, which would solve the move/rename issue here but also serve a host of other purposes, like allowing the LLM to offer to install dependencies, run linters, etc. LLMs are quite good at shell. |
Yes, LLMs are great at shell. When developing on *Nix or OSX the experience is wonderful. Developing on a windows system, unless you are using WSL, can lead to some tricky situations. I've always used Git Bash on windows and it's my preferred terminal in VSCode, and there are a few very particular cases that come up almost every time I have an LLM write a shell script for me:
convert_windows_path_to_unix() {
local path="$1"
if [[ -n "$MINGW_PREFIX" ]]; then
path=$(echo "$path" | sed 's/\\/\//g')
path=$(echo "$path" | sed 's/^\([A-Za-z]\):/\/\L\1/')
fi
echo "$path"
}
# windows C:\backslash to unix /c/forward slash path conversion
echo "Checking $directory..."
if [[ "$directory" =~ ^[A-Za-z]: ]]; then
directory=$(convert_windows_path_to_unix "$directory")
fi
The LLM does not understand this layer, and will 99% of the time write broken shell code under git bash and then flail and die changing the wrong code 100 times until you finally step in and say "this is running under git bash in windows, so you need to convert the file paths" and it still might get half of it wrong because it's really not trained on this layer of platform compatibility. I would strongly advise, similar to how you detect the vscode terminal and adjust output appropriately, that you detect the git bash environment (or more generally any env like MINGW where this may be a *nix system on top of windows -- is cygwin still a thing?) and make sure this is a thing you handle at the prompt engineering layer.
|
Yes, I was planning to sniff the OS/shell environment and prompt accordingly. I'll see if I can make this general enough to handle git bash too. I was also planning to provide a manual config, where you can explicitly specify what shell environment the LLM should target, |
Is there any plan to make aider capable of performing more of the local file maintenance tasks required during development, of moving and renaming files and folders?
Or is this the kind of thing best left to a layer like langgraph or autogen with tools that wrap around aider?
RIght now my experiences go something like this, and sometimes crash when I ask it to move a file.
The text was updated successfully, but these errors were encountered: