Skip to content

Repository map token limit not respected #752

Description

@hzappen

Issue

I am using aider to work on a "larger" git repository.
I noticed very high input token usage when sending queries to claude-3.5-sonnet.
Further investigations lead me to believe that aider is currently not respecting the repository map token limit.
Consider the below snippet, in which i call aider explicitly with "--map-tokens 1024", however the "/tokens" command still reports it to use over 16.000 tokens for the repository map.
The value reported is consistent with the API usage reports i get from the Anthropic API console.
I tried deleting the ".aider.tags.cache.v3" directory within the repository folder.
This lets aider regenerate the repository map cache, however the token usage stays the same.
Setting the map-tokens config key in the ".aider.conf.yml" file in my homedir also does not change the behavior.
Another symptom possibly related is the very slow autocomplete when adding files to the chat. Sometimes it takes several seconds before the list with the suggestions is generated.

PS C:\Data\repos\MyLargeProject> aider --map-tokens 1024
Aider v0.40.6
Models: claude-3-5-sonnet-20240620 with diff edit format, weak model claude-3-haiku-20240307
Git repo: .git with 552 files
Repo-map: using 1024 tokens
Use /help to see in-chat commands, run with --help to see cmd line args
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> /tokens

Approximate context window usage, in tokens:

$ 0.0034    1,133 system messages
$ 0.0493   16,419 repository map  use --map-tokens to resize
==================
$ 0.0527   17,552 tokens total
          182,448 tokens remaining in context window
          200,000 tokens max context window size
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>

Version and model info

Aider v0.40.6
Models: claude-3-5-sonnet-20240620 with diff edit format, weak model claude-3-haiku-20240307
Git repo: .git with 552 files

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions