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

[Bug]: Exception when deleting messages #1851

Closed
2 tasks done
frankxu2004 opened this issue May 16, 2024 · 1 comment
Closed
2 tasks done

[Bug]: Exception when deleting messages #1851

frankxu2004 opened this issue May 16, 2024 · 1 comment
Labels
bug Something isn't working severity:low Minor issues, code cleanup, etc

Comments

@frankxu2004
Copy link
Collaborator

Is there an existing issue for the same bug?

Describe the bug

Randomly if the session restarts or disconnects, delete_messages will be called and the following appears in the logs:

INFO:     127.0.0.1:36072 - "GET /api/agents HTTP/1.1" 200 OK
INFO:     127.0.0.1:36086 - "DELETE /api/messages HTTP/1.1" 200 OK
13:19:45 - opendevin:INFO: msg_stack.py:95 - Deleting messages...
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-18' coro=<MessageStack._del_messages() done, defined at /projects/ogma3/fangzhex/OpenDevin/opendevin/server/session/msg_stack.py:94> exception=TypeError('Object of type Message is not JSON serializable')>
Traceback (most recent call last):
  File "/projects/ogma3/fangzhex/OpenDevin/opendevin/server/session/msg_stack.py", line 107, in _del_messages
    json.dump(new_data, file)
  File "/home/fangzhex/miniconda3/lib/python3.11/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/home/fangzhex/miniconda3/lib/python3.11/json/encoder.py", line 432, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/home/fangzhex/miniconda3/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
    yield from chunks
  File "/home/fangzhex/miniconda3/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
    yield from chunks
  File "/home/fangzhex/miniconda3/lib/python3.11/json/encoder.py", line 439, in _iterencode
    o = _default(o)
        ^^^^^^^^^^^
  File "/home/fangzhex/miniconda3/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Message is not JSON serializable

Current Version

main branch

Installation and Configuration

make run

Model and Agent

No response

Reproduction Steps

No response

Logs, Errors, Screenshots, and Additional Context

No response

@frankxu2004 frankxu2004 added the bug Something isn't working label May 16, 2024
@SmartManoj SmartManoj added the severity:low Minor issues, code cleanup, etc label May 18, 2024
@neubig
Copy link
Contributor

neubig commented May 18, 2024

Fixed by #1871

@neubig neubig closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity:low Minor issues, code cleanup, etc
Projects
None yet
Development

No branches or pull requests

3 participants