aider icon indicating copy to clipboard operation
aider copied to clipboard

Repo not mapping (large project)

Open novacoole opened this issue 1 year ago • 1 comments

I understand that with context limitations, only certain sized repos will work with this but just wanted to flag that this is silently erroring:

Tested with the example JS game 2048:

Model: gpt-4
Git repo: .git
Repo-map: universal-ctags using 1024 tokens
Use /help to see in-chat commands.
────────────────────────────────────────────────────────
> what is the repo?

Based on the file structure and content you've provided, it appears that the repository is for a version of the game 2048. The game logic is primarily
handled in JavaScript files, with HTML and CSS for the user interface. The game seems to be a web-based application.

Inside my extremely bloated Rails application:

Model: gpt-4
Git repo: .git
Repo-map: universal-ctags using 1024 tokens
Use /help to see in-chat commands.
────────────────────────────────────────────────────────
> what is the repo?

As an AI, I don't have access to specific repositories. However, I can help you with code changes, improvements, and suggestions based on the
information you provide. Please provide the details of the changes you want to make or the issues you're facing, and I'll do my best to assist you.

I'm guessing the universal-ctags mapping is just failing and so no ctags are being included in the request?

novacoole avatar Jul 06 '23 11:07 novacoole

Thanks for trying aider!

By default, aider only uses 1024 tokens worth of the context window for the repository map. You can try increasing that by using the --map-tokens command line switch.

That might help when you are working with a very large repository.

paul-gauthier avatar Jul 06 '23 14:07 paul-gauthier

Thanks for a quick response, Paul.

I have tried even a very small repo of mine with 4096 tokens with no luck. I'm wondering if there's anything specific about how the git repo is set up that effects whether the ctags are created or not?

I initialised a repo with npx create-react-app which ended up around ~300mb in size, and aider successfully mapped the repo, however when I git cloned reworkd/AgentGPT, which ended up ~60mb, aider failed to map even with 4096 tokens.

novacoole avatar Jul 07 '23 01:07 novacoole

@novacoole perhaps try with https://github.com/universal-ctags/ctags to reduce needed context?

jaobrown avatar Jul 07 '23 13:07 jaobrown

I initialised a repo with npx create-react-app which ended up around ~300mb in size, and aider successfully mapped the repo, however when I git cloned reworkd/AgentGPT, which ended up ~60mb, aider failed to map even with 4096 tokens.

What do you mean "aider failed to map"? Can you be more precise about what output you either got or didn't get that makes you think aider failed to map a repo?

paul-gauthier avatar Jul 07 '23 14:07 paul-gauthier

I had the same issue. A fresh install of Aider and Ctags, getting stuck at the Repo-map step, was timing out the Python script. Today I restarted the Mac, and it is working fine. So some environmental issues are going on. Also, I saved the API key into the said file in my home directory, and it still asked for a key.

darit avatar Jul 07 '23 15:07 darit

Also, I saved the API key into the said file in my home directory, and it still asked for a key.

@darit thank you for reporting this! There was an error in the README, which showed the wrong filename for the conf file. The correct filename for the yaml configuration file is .aider.conf.yml. Hopefully this solves your problem.

paul-gauthier avatar Jul 07 '23 16:07 paul-gauthier

I initialised a repo with npx create-react-app which ended up around ~300mb in size, and aider successfully mapped the repo, however when I git cloned reworkd/AgentGPT, which ended up ~60mb, aider failed to map even with 4096 tokens.

@novacoole just following up again to see if you explain what you mean by "aider failed to map"? Can you be more precise about what output you either get or don't get that makes you think aider failed to map a repo?

paul-gauthier avatar Jul 08 '23 16:07 paul-gauthier

@paul-gauthier Sorry, I just mean that I got the generic response back when asking about the repo:

As an AI, I don't have access to specific repositories. However, I can help you with code changes, improvements, and suggestions based on the information you provide. Please provide the details of the changes you want to make or the issues you're facing, and I'll do my best to assist you.

"failed to map" was probably the wrong language, it's more that the map was not included in the request (i'm guessing). It just seems unusual that the deciding factor on whether or not a repo is recognised is not the size of the repo.

Just to be clear, i'm not having any issues with the environment variable and everything else is working as expected, ChatGPT just has no awareness of certain repos.

novacoole avatar Jul 09 '23 02:07 novacoole

Try asking it about the "code base" instead of "repo". None of the system prompts discuss a git repository, so it may just be a terminology problem.

You can also run aider with --verbose to see a debug level dump of the data being sent to gpt. You should be able to see the repo map data in there.

paul-gauthier avatar Jul 09 '23 02:07 paul-gauthier

@paul-gauthier Thanks Paul, I think it did come down to the terminology in the end, and using --verbose I was able to see my largest application's repo map was just too large.

novacoole avatar Jul 10 '23 03:07 novacoole