feat: Add --map-cache-dir to change the base directory for .aider.tags.cache.v3
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.
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
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...
Maybe something like --map-cache-dir would be more appropriate to avoid ambiguity
Changed the argument name according to a suggestions from @Finndersen to less ambiguous --map-cache-dir
@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
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.
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
Certainly a very much needed improvement, right now I am getting harried by stream of "Unable to use tags cache at" errors for various reasons (likely related to 'bad' default location) - and it looks like the memory cache does not persist between queries at all, Aider is recomputing it for every request.
Fixed merge conflicts to be compatible with v0.81.1 and updated sources with a clean commit.
Hi @paul-gauthier , any chance to get these minor (but important for some environments) enhancements merged? Let me know, if I can help in any way...
fix: moved the --map-root argument into the correct group "Repomap settings"
Can't wait for this to be merged!
Quick question @coredevorg , where would you recommend to configure .aider.tags.cache.v3 path. Would it be your home directory?
I'm using a a directory structure like
Develop/
├── aider-map-cache
│ └── project
│ └── .aider.tags.cache.v4
│ └── cache.db
└── cifs-mount
└── project
├── .aider.chat.history.md
├── .aider.conf.yml
├── .aider.input.history
├── .git
└── .vscode
and an configuration .aider.conf.yml with
map-cache-dir: ~/Develop/aider-map-roots/project
Hi @will-rest , following the suggestion of @Finndersen I changed the argument name to --map-cache-dir and updated the PR with a clean commit. Maybe this will accelerate approval and merge.
Just updated my local 0.84 build with the patch without any problems. @Finndersen / @paul-gauthier : Any chance to get the extension integrated into the aider core? Anything I can do make this happen?
Hey @coredevorg apologies I'm not a formal maintainer of the project so might need someone else to approve
updated patch to resolve merge conflicts with v0.84.1