paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
18.83k stars 1.74k forks source link

Uncaught ValueError in fun.py line 673 #1509

Open geraldthewes opened 1 week ago

geraldthewes commented 1 week ago

Aider version: 0.56.0 Python version: 3.12.4 Platform: Linux-6.8.0-40-generic-x86_64-with-glibc2.35 Python implementation: CPython Virtual environment: No OS: Linux 6.8.0-40-generic (64bit) Git version: git version 2.46.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 558, in main
    if not sanity_check_repo(repo, io):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "main.py", line 304, in sanity_check_repo
    repo.get_tracked_files()
  File "repo.py", line 273, in get_tracked_files
    for blob in commit.tree.traverse():
  File "util.py", line 575, in _traverse
    addToStack(stack, item, branch_first, nd)
  File "util.py", line 535, in addToStack
    lst = self._get_intermediate_items(item)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "tree.py", line 207, in _get_intermediate_items
    return tuple(index_object._iter_convert_to_object(index_object._cache))
                                                      ^^^^^^^^^^^^^^^^^^^
  File "util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "tree.py", line 214, in _set_cache_
    self._cache: List[TreeCacheTup] = tree_entries_from_data(ostream.read())
                                                             ^^^^^^^^^^^^^^
  File "base.py", line 138, in read
    return self[3].read(size)
           ^^^^^^^^^^^^^^^^^^
  File "stream.py", line 487, in read
    bl = self._size - self._br      # bytes left
         ^^^^^^^^^^
  File "util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "stream.py", line 461, in _set_cache_brute_
    apply_delta_data(bbuf, src_size, ddata, len(ddata), tbuf.write)
  File "fun.py", line 673, in apply_delta_data
    raise ValueError("unexpected delta opcode 0")
ValueError: unexpected delta opcode 0

I get this error when launching aider in a git report that has multiple React project

aider --model ollama/deepseek-coder-v2

If I launch it with --no-git, no error

$ aider --no-git --model ollama/deepseek-coder-v2 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Warning for ollama/deepseek-coder-v2: Unknown context window size and costs, using sane defaults. Did you mean one of these?

Proceed anyway? (Y)es/(N)o [Yes]: y
Aider v0.56.0 Model: ollama/deepseek-coder-v2 with whole edit format Git repo: none Repo-map: disabled Use /help for help, run "aider --help" to see cmd line args Note: in-chat filenames are always relative to the git working dir, not the current working dir.

But repo-map is disabled and I want to enable it. Now that issue might be independent.

geraldthewes commented 1 week ago

Sounds like the same issue as ticket #296 from last year

geraldthewes commented 1 week ago

Am I reading #292 correctly that basically aider (because of gitdb) only supports older versions of git and is basically not usable on any modern system? I'm surprised this is not a more important issue or am I missing something?