continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
17.69k stars 1.37k forks source link

IntelliJ IDEA-Plugin not working on Windows 11 Enterprise Machines #1670

Open MarcoNiemann opened 3 months ago

MarcoNiemann commented 3 months ago

Before submitting your bug report

Relevant environment info

- OS: Windows 11 Enterprise (10.0.22631 Build 22631)
- Continue: 0.0.50 (also tested 0.0.47 and 0.0.51)
- IDE: IntelliJ IDEA 2024.1.4 (Ultimate Edition)
- Model: *cannot select model due to the bug*
- config.json:

{
    "models": [
        {
            "title": "Speed",
            "model": "speed",
            "provider": "openai",
            "apiBase": "https://{{our-domain}}/api/generic/openai/v1",
            "useLegacyCompletionsEndpoint": false,
            "apiKey": "hidden",
            "requestOptions": {
                "headers": {
                    "X-Authentication-Mode": "TemporaryApiKey"
                }
            }
        },
        ...
    ],
    "allowAnonymousTelemetry": false,
    "disableIndexing": false,
    "slashCommands": [
        ...
    ],
    "customCommands": [
        ...
    ],
    "contextProviders": [
        ...
    ]
}

Description

Overall Situation Currently we are unable to use the continue-Plugin with JetBrains IntelliJ. Whenever we start continue it is unable to locate any models listed in our config.json - which at the same time works perfectly fine in VS Code.

The following observation has been made by multiple people, all working on the same OS setup (Windows 11 Enterprise).

However, the same config.json seems to work fine using Windows 10 Enterprise.

Additional Information

To reproduce

https://github.com/continuedev/continue/assets/9252676/433ec7cb-79c7-4cd1-b2dd-01e89583a9c3

Log output

not existing (as described above)
Hakenadu commented 3 months ago

Some additional infos (based on Continue 0.0.51 for Jetbrains IntelliJ IDEA) from the IntelliJ Logs:

Exception 1

The Plugin crashes when trying to perform inline edits in the state @MarcoNiemann described. (there are models in the config.json - vscode loads them correctly)

2024-07-06 13:23:59,958 [  64161] SEVERE - #c.i.i.p.PluginManager - setSelectedIndex: 0 out of bounds
java.lang.IllegalArgumentException: setSelectedIndex: 0 out of bounds
    at java.desktop/javax.swing.JComboBox.setSelectedIndex(JComboBox.java:652)
    at com.github.continuedev.continueintellijextension.editor.CustomPanel.<init>(InlineEditAction.kt:271)
    at com.github.continuedev.continueintellijextension.editor.InlineEditAction.makePanel(InlineEditAction.kt:214)
    at com.github.continuedev.continueintellijextension.editor.InlineEditAction.actionPerformed(InlineEditAction.kt:128)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:304)
    at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$actionProcessor$1.performAction(IdeKeyEventDispatcher.kt:495)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4$lambda$3(IdeKeyEventDispatcher.kt:844)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4(IdeKeyEventDispatcher.kt:844)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1166)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.kt:321)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:842)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:571)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:508)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:447)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:440)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:302)
    at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:623)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:585)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:585)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Exception 2

Another Exception that happened after the one above when trying to perform inline edits

2024-07-06 13:24:11,144 [  75347] SEVERE - #c.i.i.p.PluginManager - Cannot invoke "com.intellij.openapi.Disposable.dispose()" because the return value of "com.intellij.openapi.util.Ref.get()" is null
java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.Disposable.dispose()" because the return value of "com.intellij.openapi.util.Ref.get()" is null
    at com.github.continuedev.continueintellijextension.editor.InlineEditAction$actionPerformed$diffStreamHandler$1.invoke(InlineEditAction.kt:112)
    at com.github.continuedev.continueintellijextension.editor.InlineEditAction$actionPerformed$diffStreamHandler$1.invoke(InlineEditAction.kt:111)
    at com.github.continuedev.continueintellijextension.editor.DiffStreamHandler.reject(DiffStreamHandler.kt:158)
    at com.github.continuedev.continueintellijextension.editor.DiffStreamService.register(DiffStreamService.kt:12)
    at com.github.continuedev.continueintellijextension.editor.InlineEditAction.actionPerformed(InlineEditAction.kt:117)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:304)
    at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$actionProcessor$1.performAction(IdeKeyEventDispatcher.kt:495)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4$lambda$3(IdeKeyEventDispatcher.kt:844)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4(IdeKeyEventDispatcher.kt:844)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1166)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.kt:321)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:842)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:571)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:508)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:447)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:440)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:302)
    at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:623)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:585)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:585)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2024-07-06 13:24:11,145 [  75348] SEVERE - #c.i.i.p.PluginManager - IntelliJ IDEA 2024.1.4  Build #IU-241.18034.62
2024-07-06 13:24:11,145 [  75348] SEVERE - #c.i.i.p.PluginManager - JDK: 17.0.11; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-07-06 13:24:11,145 [  75348] SEVERE - #c.i.i.p.PluginManager - OS: Windows 11
2024-07-06 13:24:11,145 [  75348] SEVERE - #c.i.i.p.PluginManager - Plugin to blame: Continue version: 0.0.51
2024-07-06 13:24:11,145 [  75348] SEVERE - #c.i.i.p.PluginManager - Last Action: continue.inlineEdit

Exception 3 (resulting in Warnings)

Warnings like this appear very often in the IntelliJ Logs

2024-07-05 15:54:10,201 [  64979]   WARN - #c.i.u.j.JBCefJSQuery - Set the property JBCefClient.Properties.JS_QUERY_POOL_SIZE to use JBCefJSQuery after the browser has been created
java.lang.IllegalStateException
    at com.intellij.ui.jcef.JBCefJSQuery.create(JBCefJSQuery.java:66)
    at com.intellij.ui.jcef.JBCefBrowserJsCall.createQueryWithinScope(JBCefBrowserJsCall.kt:169)
    at com.intellij.ui.jcef.JBCefBrowserJsCall.createResultHandlerQueryWithinScope(JBCefBrowserJsCall.kt:154)
    at com.intellij.ui.jcef.JBCefBrowserJsCall.invoke(JBCefBrowserJsCall.kt:137)
    at com.intellij.ui.jcef.JBCefBrowserJsCallKt.executeJavaScriptAsync(JBCefBrowserJsCall.kt:60)
    at com.github.continuedev.continueintellijextension.toolWindow.ContinueBrowser.sendToWebview(ContinueBrowser.kt:250)
    at com.github.continuedev.continueintellijextension.toolWindow.ContinueBrowser.sendToWebview$default(ContinueBrowser.kt:235)
    at com.github.continuedev.continueintellijextension.toolWindow.ContinueBrowser$1$2.invokeSuspend(ContinueBrowser.kt:140)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Hakenadu commented 3 months ago

and another perhaps helpful addition:

the problem doesn't seem to be limited to windows 11 enterprise devices.

I just tried to get it to run on my private notebook running on: Windows 11 Pro 22631.3737 with IntelliJ IDEA 2023.3.7 (Ultimate Edition)

The default continue config is used in the following example (the .continue folder was created by continue when running the ide)

https://github.com/continuedev/continue/assets/8578769/204aad98-f373-478b-8444-7ae30e249b12

I'll try to update my IntelliJ IDEA Version to 2024.1 and will add additional info, if this happens to change the described behavior.

Edit: same behavior on IntelliJ IDEA 2024.1 (Continue Plugin Version 0.0.50)

Edit 2: inline edits are working on this device. the problem here is limited to the config tool window and the chat session.

MarcoNiemann commented 3 months ago

🔎 More insights Through further analysis by @Hakenadu we could narrow the issue down to the following line: https://github.com/continuedev/continue/blob/main/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt#L229

The admin/infrastructure team of our org uses AppLocker (https://learn.microsoft.com/en-us/windows/security/application-security/application-control/windows-defender-application-control/applocker/applocker-overview) to restrict the usage of executables on employee devices, which causes the bundled .exe-files (continue-binary.exe and esbuild.exe) to fail during startup of the continue plugin. From our experience the inevitable consequence is that you either need an exemption folder and migrate your plugin files there (see: https://intellij-support.jetbrains.com/hc/en-us/articles/207240985-Changing-IDE-default-directories-used-for-config-plugins-and-caches-storage) or to convince your org to lift AppLocker restrictions for you.

⚠️Implications From my point of view this has the following implications:

jaypif commented 2 months ago

Hi

Thank you @MarcoNiemann.

Just to update, it seams the indexation issue can also occur on VS Code with some Antivus such as Microsoft Defender. As suggested by Marco, updating the Troubleshooting guide with the suggested workaround could help (for both JetBrains and VS Code).