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
19.46k stars 1.69k forks source link

Jetbrains - RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only #2455

Open bitmario opened 1 month ago

bitmario commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: MacOS 15.0
- Continue: 0.0.71
- IDE: IntelliJ IDEA 2024.2.3

Description

Autocomplete does not work and an IDE error popup is displayed - see stack trace below.

Looks like a new issue in v0.0.71. 0.0.70 does not exhibit this behavior.

To reproduce

Simply type to trigger autocomplete

Log output

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#233,DefaultDispatcher-worker-2,5,main] 1653774253 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#56,AWT-EventQueue-0,6,main] 1075774421
    at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:177)
    at com.intellij.util.concurrency.ThreadingAssertions.softAssertReadAccess(ThreadingAssertions.java:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:915)
    at com.intellij.openapi.editor.impl.CaretImpl.getOffset(CaretImpl.java:661)
    at com.intellij.openapi.editor.CaretModel.getOffset(CaretModel.java:129)
    at com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService.shouldRenderCompletion(AutocompleteService.kt:115)
    at com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService.access$shouldRenderCompletion(AutocompleteService.kt:39)
    at com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService$triggerCompletion$1.invoke(AutocompleteService.kt:97)
    at com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService$triggerCompletion$1.invoke(AutocompleteService.kt:90)
    at com.github.continuedev.continueintellijextension.continue.CoreMessenger.handleMessage(CoreMessenger.kt:104)
    at com.github.continuedev.continueintellijextension.continue.CoreMessenger.access$handleMessage(CoreMessenger.kt:18)
    at com.github.continuedev.continueintellijextension.continue.CoreMessenger$4.invokeSuspend(CoreMessenger.kt:239)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
    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)
Patrick-Erichsen commented 1 month ago

Hi @bitmario , could you try upgrading to 0.0.75 and see if the issue is resolved? That seems to have fixed things for a few users in this thread: https://github.com/continuedev/continue/issues/2457