IDE error when trying to reference specific files
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- developer-experience
Research direction
Start with PromptTextFieldLookupManager.kt, especially showSearchResultsLookup, and follow the lookup refresh path through PromptTextField.kt. Reproduce the file-reference lookup in the IntelliJ plugin and confirm that the editor selection is read on the correct thread using IntelliJ's read-action APIs. Done means the lookup no longer throws an EDT read-access error, newly searched files remain available, and selecting a suggestion no longer removes all context files.
Written by the indexing model from the issue text.
Description
What happened?
Steps I did:
- Tried adding X files to my prompt in ProxyAI
- When adding one of the files, I got an IntelliJ IDE error toast message.
After this, the file search in the ProxyAI chat window stopped working (or only showed files it had cached before)
Also interesting: I tried opening the file I wanted to mention in IntelliJ, then just clicking on the suggestion in the chat window to add it to the context, but clicking that just removed ALL files from the context with another error.
Relevant log output or stack trace
Error showing lookup: com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#44,AWT-EventQueue-0,10,main] 1045165094 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#44,AWT-EventQueue-0,10,main] 1045165094 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:248)
at com.intellij.util.concurrency.ThreadingAssertions.assertReadAccess(ThreadingAssertions.java:138)
at com.intellij.openapi.editor.impl.EditorThreading.assertInteractionAllowed(EditorThreading.kt:30)
at com.intellij.openapi.editor.impl.CaretImpl.hasSelection(CaretImpl.java:1019)
at com.intellij.openapi.editor.SelectionModel.hasSelection(SelectionModel.java:133)
at com.intellij.openapi.editor.SelectionModel.hasSelection(SelectionModel.java:122)
at com.intellij.codeInsight.lookup.impl.LookupOffsets.getPivotOffset(LookupOffsets.java:72)
at com.intellij.codeInsight.lookup.impl.LookupOffsets.calculateStartOffset(LookupOffsets.java:124)
at com.intellij.codeInsight.lookup.impl.LookupOffsets.checkMinPrefixLengthChanges(LookupOffsets.java:113)
at com.intellij.codeInsight.lookup.impl.LookupImpl.updateList(LookupImpl.java:505)
at com.intellij.codeInsight.lookup.impl.LookupImpl.refreshUi(LookupImpl.java:1307)
at ee.carlrobert.codegpt.ui.textarea.PromptTextFieldLookupManager.showSearchResultsLookup(PromptTextFieldLookupManager.kt:99)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField.showGlobalSearchResults(PromptTextField.kt:212)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField.access$showGlobalSearchResults(PromptTextField.kt:58)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField$updateLookupWithSearchResults$2.invokeSuspend(PromptTextField.kt:628)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField$updateLookupWithSearchResults$2.invoke(PromptTextField.kt)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField$updateLookupWithSearchResults$2.invoke(PromptTextField.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:44)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:166)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField.updateLookupWithSearchResults(PromptTextField.kt:627)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField.access$updateLookupWithSearchResults(PromptTextField.kt:58)
at ee.carlrobert.codegpt.ui.textarea.PromptTextField$updateLookupWithSearchResults$1.invokeSuspend(PromptTextField.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:225)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:595)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)
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)
Steps to reproduce
See description above
CodeGPT version
3.6.8-241.1
Operating System
Windows
- Dominant language
- Kotlin
- Stars
- 1.9k
- Forks
- 401
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from carlrobertoh/ProxyAI
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlrobertoh/ProxyAI#1250 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
carlrobertoh/ProxyAI#1233 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlrobertoh/ProxyAI#1203 · 1 reaction ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
carlrobertoh/ProxyAI#1160 · 2 reactions ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlrobertoh/ProxyAI#1068 ·
All issues in carlrobertoh/ProxyAI
Similar issues
-
Location search keeps showing stale "Open-Meteo can't find ..." message after clearing search queryOpenBug Needs review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
breezy-weather/breezy-weather#3082 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
wangzan101/Mika#1033 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
commons-app/apps-android-commons#7486 ·
Maintainers usually reply within 1 day
-
area: ci area: local-media area: startup area: ui platform: bilibili platform: netease platform: youtube status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cwuom/NeriPlayer#794 ·
Maintainers usually reply within 1 day
-
area:android area:ui bug priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
meraxes89/streamify-apk#449 ·
Maintainers usually reply within 1 day