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
18.34k stars 1.49k forks source link

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only #2457

Open tribbloid opened 2 weeks ago

tribbloid commented 2 weeks ago

Before submitting your bug report

Relevant environment info

- OS: Pop OS 22.04
- Continue: 0.71
- IDE: Intellij IDEA Ultimate
- Model: Claude Sonnet 3.5
- config.json: 

cannot provide, contains Anthropic subscription token

Description

including @codebase as context trigger the following error:

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[#313,DefaultDispatcher-worker-3,5,main] 1672689358 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#108,AWT-EventQueue-0,6,main] 546178754
    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)

To reproduce

Log output

No response

tribbloid commented 2 weeks ago

BTW, how to enable plugin telemetry & remote error reporting?

once enabled we won't have the plaintext token leaking problem

Purg commented 1 week ago

I am also experiencing this issue, though when attempting to make use of the LLM-based autocompletion. I would not be surprised if this has tie-ins to some @codebase functionality. I can share my config due to using local Ollama models only.

Relevant environment info

I observed this issue while using CLion, but I am using the same version of Continue in PyCharm which I'm also not getting auto-completions in, however I am not seeing the above error being raised while in PyCharm under what I think are the same conditions.

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[#193,DefaultDispatcher-worker-3,5,main] 29119011 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#72,AWT-EventQueue-0,6,main] 183590824
    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 week ago

I'm having trouble getting @codebase to even attempt to run in IntelliJ with v0.0.70. Will be digging into this shortly.

@tribbloid , r.e. telemetry, is this what you're looking for? https://docs.continue.dev/telemetry#how-to-opt-out

{
  "allowAnonymousTelemetry": true
}
AlexJ-StL commented 1 week ago

I too am having issues with Autocomplete. The details are different, but the outcome is the same. My ticket was opened here: #2343

Purg commented 1 week ago

I too am having issues with Autocomplete. The details are different, but the outcome is the same. My ticket was opened here: #2343

Yours seems like a different issue where the LLM web service you are using is rate-limiting you. The frequency of requests triggered by autocomplete may be too high a volume for the service you are using. This thread of issues is, I'm interpreting, is more a JetBrains plugin related issue where some background thread is crashing that otherwise would mediate the autocompletion functionality. :shrug:

Purg commented 1 week ago

Updating to JetBrains plugin version 0.0.75 seems to no longer have this issue for me.

Patrick-Erichsen commented 1 week ago

^ If other folks are able to resolve the issue by upgrading to 0.0.75 give this message a 👍