jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

[v3.0.0rcx] Deleting messages breaks future replies

Open ellisonbg opened this issue 10 months ago • 1 comments
trafficstars

Testing the Jupyter AI 3.0.0.a0 prerelease and the behavior of deleting messages.

Description

There are a couple of issues in how chat works when you delete messages.

First, create a new chat with Jupyter AI configured. It will reply as expected:

Screenshot 2024-12-30 at 10 39 29 AM

Now click the trashcan button in your message to delete it. This deletes both the human message and the AI message following it.

Screenshot 2024-12-30 at 10 39 43 AM

Now reload the page, and you will see that the human message remains deleted, but the AI message has returned:

Screenshot 2024-12-30 at 10 40 01 AM

Now, with a human message in the deleted state, try another chat message to the AI. Jupyter AI throws an exceptions in the chat windows:

Screenshot 2024-12-30 at 10 48 11 AM

The interesting pieces is the last line of the traceback:

botocore.exceptions.EventStreamError: An error occurred (validationException) when calling the InvokeModelWithResponseStream operation: messages.0: all messages must have non-empty content except for the optional final assistant message

Expected behavior

  • As a user, I want to delete AI messages separate from those that I type.
  • As a user, if I delete an AI message, I want it to always be deleted in the future (across opening/closing the document or reloading the page).
  • As a user, I want chat with AI to work, even when humans have deleted messages.

Context

Using the following conda environment:

name: jupyter-ai-testing
dependencies:
  - python
  - pip:
    - jupyterlab==4.2.5
    - jupyter-ai==3.0.0a0
    - langchain-aws

ellisonbg avatar Dec 30 '24 17:12 ellisonbg