paul-gauthier / aider

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

Uncaught BadObject in base.py line 197 #1457

Closed derrickpersson closed 1 week ago

derrickpersson commented 1 week ago

Was calling /reset on a session that had been opened for awhile.

Aider version: 0.55.0 Python version: 3.12.3 Platform: macOS-14.4.1-arm64-arm-64bit Python implementation: CPython Virtual environment: No OS: Darwin 23.4.0 (64bit) Git version: git version 2.39.3 (Apple Git-146)

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 694, in main
    coder.run()
  File "base_coder.py", line 729, in run
    user_message = self.get_input()
                   ^^^^^^^^^^^^^^^^
  File "base_coder.py", line 745, in get_input
    self.get_addable_relative_files(),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1656, in get_addable_relative_files
    all_files = set(self.get_all_relative_files())
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1641, in get_all_relative_files
    files = self.repo.get_tracked_files()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repo.py", line 266, 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 213, in _set_cache_
    ostream = self.repo.odb.stream(self.binsha)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base.py", line 213, in stream
    return self._db_query(sha).stream(sha)
           ^^^^^^^^^^^^^^^^^^^
  File "base.py", line 197, in _db_query
    raise BadObject(sha)
gitdb.exc.BadObject: BadObject: b'f6dc5c3690ea470e36a7ba353c8fdf1aee192d96'
paul-gauthier commented 1 week ago

Thanks for trying aider and filing this issue.

The fix is available in the main branch. You can get it by installing the latest version from github:

aider --install-main-branch

# or...

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, let me know if it works better for you.