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

Mistral adapter error handling: Improve object validation and error messages for nested content #3784

Closed
3 tasks done
ingo-eichhorst-ionos opened this issue Jan 20, 2025 · 6 comments
Assignees
Labels
kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority

Comments

@ingo-eichhorst-ionos
Copy link

Before submitting your bug report

Relevant environment info

- OS: MacOS 15.2 (24C101) - M1 (ARM)
- Continue version: 0.9.251
- IDE version: VS Code - Version: 1.96.2 (Universal)
- Model: GPT-4o

- config.json:
  
  "models": [
    {
      "title": "codestral",
      "model": "codestral-latest",
      "provider": "mistral",
      "apiKey": "random_string"
     }  ...
  ]

Description

The Mistral adapter for Codestral (And properly other models as well) is not displaying a proper error.
Instead the not very helpful "Cannot read properties of undefined (reading 'content')" is displayed. IMHO the code should handle deep nested objects more gracefully and e.g. display a JSON stringify of the object if the object nesting is different than expected.

Image

To reproduce

  1. A mistral model like in the config above with a wrong API-Key.
  2. Send any chat request

Log output

##### Completion options #####
{
  "contextLength": 32768,
  "model": "codestral-latest",
  "maxTokens": 4096
}

##### Request options #####
{}

##### Prompt #####
<system>


<user>
@dosubot dosubot bot added kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority labels Jan 20, 2025
@Patrick-Erichsen
Copy link
Collaborator

This was a separate issue with our error logging that I believe has been resolved in latest pre-release. Thanks for the +1 on it though!

@AfterStories
Copy link

AfterStories commented Feb 6, 2025

@Patrick-Erichsen

I encountered this problem again today, and it happened on the computer where the plugin was installed for the first time.

When I used Run Continue to run the plugin locally, it worked well. It was packaged into an installation package and ran well after installation in my conputer. This may be related to the session history that already exists locally.

But I sent the installation package to my colleague, who installed it in IntelliJ for the first time. When he sent the problem, the plug-in window flashed for a while, and no content was displayed. It looks like the streaming request was stopped and not completed.,If sent text multiple times, an error message that the content could not be read would show.

Strangely, when I cloned the latest main code test again in another directory and built it as an installation package, the stream request call was not invalid (the UI flickered and nothing was displayed), and it runs normally now.

But I don’t think it’s because the problem was fixed in the latest code. The previous fix for this problem was #3725

When I pulled the code, the code was #3790

That is to say, my current code already includes the changes of #3725

@AfterStories
Copy link

AfterStories commented Feb 6, 2025

@Patrick-Erichsen
It looks like you guys tried to fix similar issue, I think my current error may have a different reason

After the first request stream was invalid for unknown reasons (nothing was displayed, the window flickered), and then I sent text again, the reading content error message appeared. ( I'll try to record a video later )

It seems that something strange happened when I asked the question for the first time. After that, plugin want to update this history record, but it could not be updated :

In the plugin window after installation, I found the dev tools tool and saw the following error message when the reading content error:
Image

According to the log information, I found the code:
gui\src\redux\slices\sessionSlice.ts

Image

@AfterStories
Copy link

In fact, I had this problem in the earlier 0.83 version: the stream request seemed to be stopped instantly (the UI flickered and nothing was displayed)

Then I changed the directory to clone the code again, and ran it again, and there was no problem. I think this may be related to the running/packaging environment, and it seems not to be a problem with the code itself.

I think I should create a new issue to record this problem detail , because the root cause of the problem may not be that the content cannot be read, but it is just an incidental issue

@ingo-eichhorst-ionos
Copy link
Author

This was a separate issue with our error logging that I believe has been resolved in latest pre-release. Thanks for the +1 on it though!

I tested and the issue no longer occurs. I get a very nice error message now 😃

@ingo-eichhorst-ionos
Copy link
Author

@Patrick-Erichsen Thanks for your support!

@AfterStories Can you please open your comments in another issue, so we keep things nice and clean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority
Projects
None yet
Development

No branches or pull requests

3 participants