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

[Windows][Jetbrains]Intellij IDE plugin can't read and refresh config.json file #3691

Closed
1 of 3 tasks
AfterStories opened this issue Jan 11, 2025 · 11 comments
Closed
1 of 3 tasks
Assignees
Labels
area:configuration Relates to configuration options ide:jetbrains Relates specifically to JetBrains extension kind:bug Indicates an unexpected problem or unintended behavior

Comments

@AfterStories
Copy link

AfterStories commented Jan 11, 2025

Before submitting your bug report

Relevant environment info

- OS:WIN 10
- Continue version:Main branch
- IDE version: ideaIU-2024.3.1.1.win
- Model: default code 
- config.json:
  
  "models": [
    {
      "model": "claude-3-5-sonnet-latest",
      "provider": "anthropic",
      "apiKey": "test",
      "title": "Claude 3.5 Sonnet"
    }
  ],

Description

When I use Intellij to the debug [ Run Continue ] task to start the plugin, a new Intellij window pops up, it cannot read the default config.json file and content, and gets an error message:

Error handling message of type fileExists: java.lang.IllegalArgumentException: URI has an authority component

image

To reproduce

  1. I cloned the code of the Main branch
  2. The only file I modified was binary\build.js
    I use Windows, so I commented out the compile for other systems , and run .\scripts\install-dependencies.ps1
let targets = [
  // "darwin-x64",
  // "darwin-arm64",
  // "linux-x64",
  // "linux-arm64",
  "win32-x64",
];

3 .Use the latest version of Intellij 2024.3.1 and start Run Continue
image

  1. Four tasks were auto started, but Prompts Logs reported an error that the syntax of the execution command was incorrect and it did not start. I think this does not affect the startup of Continue, it just records the chat log, right?

image

  1. A new Intellij window popped up, and Intellij show an error message:

Error handling message of type fileExists: java.lang.IllegalArgumentException: URI has an authority component
image

I guess maybe there is some problem in the communication between intellIJ and webivew ?

And I checked that the extensions\.continue-debug\config.json file was indeed generated, not because the file does not exist

image

  1. When I try to add a model manually, I see that the configuration file content is updated, but I get the error again, and the plugin interface cannot display the model name in config.json , it still show "select model"

image
image
image
image

  1. I found some people who seem to have the same problem as me
    Continue Plugin Model Refresh Issue on Windows 7 with IntelliJ IDEA 2023.1.7 #3651
    After version 0.0.84 is installed, clicking the configuration button cannot open the configuration file, resulting in unusable status. #3545

And, you mentioned that you fixed a problem about couldn't open the config file when clicking the settings icon:
#3608

But the problems I'm facing now are somewhat similar. Continue can't read the default config when startup and can't refresh the config when modifying the model

You mentioned: was attempting to open a path with ide.openFile rather than a URI
so I guess when starting the continue plugin in IntelliJ, is it true that the logic of automatically reading config.json still uses URI, resulting in failure to automatically read the default configuration?

8. But there will be no problem in Vscode:
Using the same code, I launched it with Vscode and it worked perfectly, reading the default config on the first launch,
and it auto refreshed when I changed the model name in config.josn file

image

Log output

The following is the log displayed in the Run Extension debug window when Intellijs starts continue
At the top of the log you see a message:
Cannot resolve the latest Gradle IntelliJ Plugin version
But continue can still be started in the new intllij window, I think it's just because of the network problem that it can't check the latest gradle version, but I'm already using gradle 8.3

Run Extension Log.txt

@sestinj sestinj self-assigned this Jan 11, 2025
@dosubot dosubot bot added area:configuration Relates to configuration options ide:jetbrains Relates specifically to JetBrains extension kind:bug Indicates an unexpected problem or unintended behavior labels Jan 11, 2025
@AfterStories AfterStories changed the title Intellij IDE plugin cannot read config.json file Intellij IDE plugin can't read and refresh config.json file Jan 11, 2025
@AfterStories
Copy link
Author

AfterStories commented Jan 11, 2025

Maybe the same problem as me :

#3651
#3545
#3669

And I actually found some guys reporting the same issue in the [-help] channel on discord:

  1. https://discord.com/channels/1108621136150929458/1324478157985677404
  2. https://discord.com/channels/1108621136150929458/1326895095848505374
  3. https://discord.com/channels/1108621136150929458/1326558135330148402

Although the fixed the issue about couldn't open the config file when clicking the settings icon in #3608, I think the problem still exists when the plugin first load default config and refreshe

@AfterStories AfterStories changed the title Intellij IDE plugin can't read and refresh config.json file [Windows][Jetbrains]Intellij IDE plugin can't read and refresh config.json file Jan 11, 2025
@lkk214
Copy link
Contributor

lkk214 commented Jan 11, 2025

Hey, this was fixed in #3494

@AfterStories
Copy link
Author

AfterStories commented Jan 11, 2025

hi, @lkk214
I checked #3494, it shows that merged on yesterday:
sestinj merged 4 commits into continuedev:main from lkk214:refactor/completion-inlay-rendering

I think I will pull the latest code and try to build again.
In addition, I saw that you forked the shire repo. Do you understand Chinese? I really hope to consult and learn some questions about continue plugin from you. I will be very grateful If you would like to provide any contact information, such as WeChat or email.thanks

@AfterStories
Copy link
Author

AfterStories commented Jan 11, 2025

Hi, @lkk214
I pulled the latest main branch and found that the correct config in config.json can load in the chat box, for example, I customized a model name in config.json. This is really good news !

But I still found new similar problems, I think it is also caused by the same bug, but it has not been fixed:

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

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

Although the model name in config.json cannot be loaded here, the API can be called after sending the question
image

@sestinj Could you please continue to check this issue ,thank you

@AfterStories
Copy link
Author

AfterStories commented Jan 12, 2025

I searched the error message in issues list,and foundthis issue #2952 ,It reported the same error message. It mainly mentioned the shortcut key problem. But now I can currently use the CTTL+ I shortcut key to display the input box above the selected code, but I cannot load the model configuration.

@Patrick-Erichsen
Copy link
Collaborator

Hi @AfterStories , so to confirm, at this point you're able to read/refresh your config.json? And the current issue you are having is the null value being rendered for the inline edit (cmd+i)?

@AfterStories
Copy link
Author

AfterStories commented Jan 14, 2025

@Patrick-Erichsen
Yes, after pulling the latest main branch code and getting @lkk214's changes, I was able to read config.json in the plugin's Chat window.

But when using the CTRL+I function in the code file, the floating bubble shows null, I think I still can't read the content in config.json in this part.
image

And I can see the error message when click the null :

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

But when I enter and send the question, the API call can run, which means it has obtained the model API url information that needs to be called, but the model name cannot be displayed

Also, I could provide some help information from Ikk214
#3494 (comment)

@lkk214
Copy link
Contributor

lkk214 commented Jan 14, 2025

@AfterStories I know that the current version cannot be used, including IDE freezing and this issue about null value. If you just want to learn about continue , it is recommended to build the plugin based on #3494. These are all normal.

@AfterStories
Copy link
Author

AfterStories commented Jan 14, 2025

Thanks you @lkk214

I not only want to learn continue, but also forking and Customizing based on Continue. becasue I'm not familiar with kotlin code, so I use the Continue library, and I have a deadline from my leader to complete my dev tasks. Therefore, I hope that the IntelliJ part can have a relatively stable version so that I can continue customizing development. In fact ,currently all the featues on vscode work well, but most of the problems occur in IntelliJ.

About the problem of can't get the model name in CTRL+I bubble , I think I can lower the priority on my side, because in my design, I only need one model, so I temporarily hard-code the display here as a fixed string. Maybe in the future when I have time, I can try your #3494 PR to build, but at least it is still a problem in the current main branch.

the current IDE freezing issues, I think continue team should fix it as a high priority, at least, let IntelliJ dont to be die...

@lkk214
Copy link
Contributor

lkk214 commented Jan 14, 2025

Um, I discovered this freezing issue when I updated the code the day before yesterday and fixed it locally. It will definitely be fixed in the next version, at least the current version cannot be used.

@AfterStories
Copy link
Author

AfterStories commented Jan 15, 2025

@Patrick-Erichsen
I will close this issue now, It has been fixed.
About the problem that model name can't display in the CTRL+I bubble, I will create a new issue and we can discuss it in #3733.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:configuration Relates to configuration options ide:jetbrains Relates specifically to JetBrains extension kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants