When running console commands in agent mode, it should display the current path its in

Agent mode is absolutely sick for creating new projects. Im making a new app right now with node. But the frontend is in a subfolder of the root folder, and it accidentally did some npm installs in the root and then installed them in the frontend folder as well.

Then I told it to remove any npm stuff from the root directory and it ran rm -rf node_modules, but it didn’t know it was in the frontend folder and not the root directory. So it almost removed my actual frontend stuff if I didn’t stop it in time. Then it saw that I stopped it and said “Okay let me navigate to the correct folder and remove that one”. So then it ran

cd … && rm -rf node_modules

Which is correct. But this shouldn’t have happened. Either I should see where in the project path it will run the command in, or it should better know that “You are currently in /frontend folder, any commands you run will be ran from here”. I’m on 0.45.11

Yeah this is definitely a bit scary - totally get the concern about destructive commands like rm -rf without clear context of where they’re running

We’ve got a few things in the works to make this safer, but for now you can use the Project Rules feature to help the agent understand your project structure better, especially for nested folders

The agent should definitely be more explicit about which directory it’s in before running commands. I’ll pass this feedback along to the team as it’s a pretty important safety feature we should add

For now, you might want to use the AI rules features so that the Composer to be more explicitly about the actions it is trying to do, so you can tell if it’s suggestions are correct for what it is trying to do.

1 Like