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

[Ctrl+I] intellij Edit bubble can‘t display model name #3733

Open
1 of 3 tasks
AfterStories opened this issue Jan 15, 2025 · 6 comments
Open
1 of 3 tasks

[Ctrl+I] intellij Edit bubble can‘t display model name #3733

AfterStories opened this issue Jan 15, 2025 · 6 comments
Assignees
Labels
area:inline-edit Relates to the auto refactor feature ide:jetbrains Relates specifically to JetBrains extension kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority

Comments

@AfterStories
Copy link

Before submitting your bug report

Relevant environment info

No response

Description

When I select a piece of code and use the CTRL+I shortcut key, as shown in the screenshot, you can see that the model name is not displayed, only show a null ,But pressing the Enter key to send the question can call the API successful, so I think it has get the data in config.json, but it just can't display it

image
And at the same time, the log in the Run Extension window:
Error handling message: {"messageType":"config/getSerializedProfileInfo","data":{"result":{"config":{"allowAnonymousTelemetry":false,"models":[{"provider":"anthropic","model":"Gosu Model","title":"Gosu Model"... ....(After here, it's my config. json content)
java.lang.NullPointerException: null cannot be cast to non-null type kotlin.collections.Map<kotlin.String, kotlin.Any>
Registered handler for editor
image

I recorded a demo video:
https://github.com/user-attachments/assets/d33e7f10-45c7-4443-8440-6cd7158eaf73

To reproduce

No response

Log output

Error handling message: {"messageType":"config/getSerializedProfileInfo","data":{"result":{"config":{"allowAnonymousTelemetry":false,"models":[{"provider":"anthropic","model":"Gosu Model","title":"Gosu Model"...
....(After here, it's my config. json content)


java.lang.NullPointerException: null cannot be cast to non-null type kotlin.collections.Map<kotlin.String, kotlin.Any>`
`Registered handler for editor
@AfterStories AfterStories changed the title [Ctrl+I] bubble can‘t display model name [Ctrl+I] intellij Edit bubble can‘t display model name Jan 15, 2025
@dosubot dosubot bot added ide:jetbrains Relates specifically to JetBrains extension kind:bug Indicates an unexpected problem or unintended behavior area:inline-edit Relates to the auto refactor feature priority:medium Indicates medium priority labels Jan 15, 2025
@Patrick-Erichsen
Copy link
Collaborator

@AfterStories can you share your config.json and the version of Continue you are on?

@AfterStories
Copy link
Author

AfterStories commented Jan 16, 2025

@Patrick-Erichsen
I just pulled the latest code from the main branch (latest commit 6c3bbd5). I think the current version is 0.0.85

The only thing I changed in config.json is model ,And based on my custom deve requirements, I need to display the model name as something like Gosu instead of claude, even though I use anthropic model

"Gosu" can be displayed under the input box of the chat webview, but it is displayed as null in the Edit bubble. is it can't display a custom string here?

  "allowAnonymousTelemetry": false,
  "models": [
    {
      "model": "Gosu",
      "provider": "anthropic",
      "apiKey": "my key ",
      "title": "Gosu ",
      "apiBase": "my api url",
      "requestOptions": {
        "verifySsl": false
      }
    }
  ]

@Patrick-Erichsen
Copy link
Collaborator

Ah - I wonder if the space is causing issues? Can you trim the trailing space in your title?

e.g. "title": "Gosu ", -> "title": "Gosu",

@AfterStories
Copy link
Author

AfterStories commented Jan 17, 2025

@Patrick-Erichsen
I accidentally entered a space in that commit,so sorry caused a misunderstanding.
In fact, there is no space in my config.json, and I thinkI found out what caused this problem:

InlineEditAction.kt : Line 130

This is your source code, directly use the response as config :

 continuePluginService.coreMessenger?.request("config/getSerializedProfileInfo", null, null) { response ->
        val config = response as Map<String, Any>
        val models = (config["config"] as Map<String, Any>)["models"] as List<Map<String, Any>>
        modelTitles.addAll(models.map { it["title"] as String })
    }

But the config data is in responese. $$\color{red}{\textbf{result}}$$ .config
After modifying it like this,print some logs,then I can get the config data from the $$\color{red}{\textbf{result}}$$
in the response obtained contains a layer of $$\color{red}{\textbf{result}}$$ , and then the config is obtained from the $$\color{red}{\textbf{result}}$$

Image
Image

And I can successfully get the value of the modelTitles ,and it can be displayed successfully
Image

I don't understand kotlin code, I think maybe my changes are not accurate, so it still need you team as experts to fix the code, thanks~

@AfterStories
Copy link
Author

AfterStories commented Jan 17, 2025

And I also found same problem in CoreMessengerManager.kt: Line 63

 val profileInfo = data?.get("config") as? Map<String, Any>

there is a result layer of in data, so profileInfo cannot directly get config here

Maybe there are similar problems in other files, please check

@Patrick-Erichsen
Copy link
Collaborator

@AfterStories excellent work getting to the bottom of this! Made the fix here: https://github.com/continuedev/continue/pull/3754/files

This will be available in the EAP/pre-release for 0.0.86 we'll be releasing today. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:inline-edit Relates to the auto refactor feature ide:jetbrains Relates specifically to JetBrains extension kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority
Projects
None yet
Development

No branches or pull requests

2 participants