carlrobertoh / CodeGPT

The leading open-source AI copilot for JetBrains. Connect to any model in any environment, and customize your coding experience in any way you like.
https://codegpt.ee
Apache License 2.0
1.1k stars 231 forks source link

Using OpenAi o1-preview generate an exception in IntelliJ #746

Closed tleveque23 closed 2 weeks ago

tleveque23 commented 3 weeks ago

What happened?

I selected the o1-preview model in the setting. Ask a question and got no response. Only an error in the "IDE Internal Errors" window. Using another model work fine.

Relevant log output or stack trace

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'com.shuzijun.markdown.editor.DevtoolsAction' must override `getActionUpdateThread()` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.shuzijun.markdown-editor]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
    at com.intellij.diagnostic.PluginException.reportDeprecatedUsage(PluginException.java:125)
    at com.intellij.openapi.actionSystem.ActionUpdateThreadAware.getActionUpdateThread(ActionUpdateThreadAware.java:21)
    at com.intellij.openapi.actionSystem.AnAction.getActionUpdateThread(AnAction.java:201)

Steps to reproduce

No response

CodeGPT version

2.12.0-241.1

Operating System

macOS

kulievvitaly commented 3 weeks ago

The same issue

carlrobertoh commented 3 weeks ago

The error seems to be related to the com.shuzijun.markdown-editor plugin. Could you try disabling it to see if it has any effect?

tleveque23 commented 2 weeks ago

The error seems to be related to the com.shuzijun.markdown-editor plugin. Could you try disabling it to see if it has any effect?

I did. And now I have the following error: java.util.NoSuchElementException: No value present at java.base/java.util.Optional.orElseThrow(Optional.java:377) at ee.carlrobert.codegpt.completions.CompletionRequestService.getChatCompletion(CompletionRequestService.java:186) at ee.carlrobert.codegpt.completions.CompletionRequestService$1.run(CompletionRequestService.java:159) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221) at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249) at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:501) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:464) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732) at java.base/java.lang.Thread.run(Thread.java:1583)

carlrobertoh commented 2 weeks ago

It looks like the errors cannot be deserialized properly. Just to be sure, do you have access to o1 models?

carlrobertoh commented 2 weeks ago

I have improved the error handling for non-streaming chat completions. Please reopen the ticket if the issue persists.