Skip to content
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

feat: Add --map-cache-dir to change the base directory for .aider.tags.cache.v3 #2911

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

coredevorg
Copy link

The patch makes the root directory for .aider.tags.cache.v3 configurable through an additional argument --map-root or AIDER_MAP_ROOTenvironment variable.

This becomes important if your project lives on a CIFS mount and you encounter:

Tags cache error: database is locked
Unable to use tags cache at /mnt/.../.aider.tags.cache.v3, falling back to memory cache
Cache recreation error: [Errno 11] Resource temporarily unavailable: 'cache.db'

With the --map-root parameter, the cache directory can be moved to local device to avoid the problem.

@Finndersen
Copy link

So this is the directory where the map cache DB is stored? might want to make the command more explicit to avoid confusion with the root of the repository map itself, e.g. due to --subtree-only option

@coredevorg
Copy link
Author

Yes, you are right @Finndersen, it's the directory where the repomap cache .aider.tags.cache.v3 is located and has nothing to do with the repository itself. The option is related to an existing option group Repomap settings. So I'm fine with --map-root in this context, but if you have a better name for the option, let me know...

@Finndersen
Copy link

Maybe something like --map-cache-dir would be more appropriate to avoid ambiguity

@coredevorg coredevorg changed the title feat: Add --map-root argument to configure repository map root directory feat: Add --map-cache-dir to change the base directory for .aider.tags.cache.v3 Feb 1, 2025
@coredevorg
Copy link
Author

Changed the argument name according to a suggestions from @Finndersen to less ambiguous --map-cache-dir

…ing conventions in base_coder.py and repomap.py
@Finndersen
Copy link

Finndersen commented Feb 7, 2025

@coredevorg i still think --map-root is misleading because this change is about the map cache file location, not the root directory of the repo map itself.
How about --map-cache-root? Although "root" is often used to refer to a base directory which is expected to contain subdirectories. If it's just a directory for a single file to be located in, then "dir" is probably more appropriate

@coredevorg
Copy link
Author

Sorry for the confusion, @Finndersen. Unfortunately it's not just the name of the argument in args.py and main.py but the variable is used via **kwargs in the other modules. My quick-and-dirty hack to change the name of the argument has broken the patch so I have to revert because I need the patched aider in my environment. If you really want to change the name, it needs a more in depth refactoring and testing. I won't be able to take a closer look at it for at least 2 weeks. And, btw, it's really the root directory for the cache subdirectory .aider.tags.cache.v3 containing the cache.db.

@Finndersen
Copy link

Ok, well I still think the user interface/API design should probably be priority. Would --map-cache-root make sense? Just because theoretically there could be an argument/param for configuring the root of the repo map itself, so I think it would be backing ourselves into a corner if we used --map-root for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants