Comments (14)
如果只是上述的代码,我测试了一下,应该只会执行一次。估计,可能受什么代码影响 —— Agent 回传。
from auto-dev.
应该还是执行多次导致的,能提交一个复现的步骤吗。我这边除非手动点多次执行,要不无法复现。
from auto-dev.
我目前測試起來,一樣的prompt,一樣的agent
剛開啟intellij的時候,就只寫一次
接著再跑一次相同的agent,就會重複寫了(這時候為了好分辨,我是把產生檔案的內容清空,再跳個幾行,比較清楚辨認)
感覺起來就像是前一次的資料還留著
跑第一次,就出現一次內容
跑第二次,會出現兩次內容
跑第三次,會出現三次內容
...
from auto-dev.
应该是重复多次,执行的缘故。
from auto-dev.
目前看起來是這樣,寫入資料的時候,intellij他會跳出 Writing to file:xxxx 的訊息
的確是執行多次就會跳出多次
from auto-dev.
重複測試了一下,這應該就原本就有的問題
只是我加上了L1-L2這樣才比較明顯出現
原本沒有設定L1-L2,其實也是有重複執行,但是它就是取代整個檔案,所以就沒有感覺到重複的問題
但是intellij會跳出多個 Writing to file: 的訊息視窗,這其實就表示 WriteInsCommand 被執行多次
from auto-dev.
估计有可能是之前那个处理 Agent 返回继续处理引起的
from auto-dev.
追蹤起來,好像是DevInsProgramRunner的
override fun runFinish(string: String, event: ProcessEvent, scriptPath: String) {
environment.project.service<DevInsProcessProcessor>().process(string, event, scriptPath)
}
被執行好幾次....
這跟Agent的調整有關係嗎??
from auto-dev.
调用的地方应该是 DevInsRunConfigurationProfileState
,看上去 processTerminated
被调用了多次?
from auto-dev.
DevInsRunConfigurationProfileState的processTerminated只送了一次message
但是DevInsProgramRunner的connection.subscribe那邊收到多次message
因此觸發寫多次的寫入
我加了一個追蹤的參數來確認,DevInsProgramRunner收到的多次message都是由DevInsRunConfigurationProfileState發出來
ProcessEvent都是同一個...
from auto-dev.
你清空一下右下角的 idea 告警试试,我本地会出现一个错误:
java.lang.Exception: error when processing com.intellij.execution.process.ProcessEvent[source={processTerminatedListener=com.intellij.execution.process.ProcessTerminatedListener@325de1f6}] by class cc.unitmesh.devti.language.run.DevInsRunConfigurationProfileState$execute$1
at com.intellij.execution.process.ProcessHandler$2.processTerminated(ProcessHandler.java:268)
at com.intellij.execution.process.ProcessHandler.lambda$notifyTerminated$2(ProcessHandler.java:207)
at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:325)
at com.intellij.execution.process.ProcessHandler.notifyTerminated(ProcessHandler.java:190)
at com.intellij.execution.process.ProcessHandler.notifyProcessTerminated(ProcessHandler.java:186)
at cc.unitmesh.devti.language.run.DevInsProcessHandler.detachProcessImpl(DevInsProcessHandler.kt:9)
at com.intellij.execution.process.ProcessHandler.lambda$detachProcess$1(ProcessHandler.java:143)
at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:325)
at com.intellij.execution.process.ProcessHandler.detachProcess(ProcessHandler.java:140)
at cc.unitmesh.devti.language.run.DevInsRunConfigurationProfileState$agentRun$1$1.invokeSuspend(DevInsRunConfigurationProfileState.kt:152)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
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)
Caused by: java.lang.RuntimeException: Cannot invoke (class=, method=runFinish, topic=DevInsRunListener)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:677)
at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:423)
at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:402)
at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:461)
at jdk.proxy32/jdk.proxy32.$Proxy343.runFinish(Unknown Source)
at cc.unitmesh.devti.language.run.DevInsRunConfigurationProfileState$execute$1.processTerminated(DevInsRunConfigurationProfileState.kt:57)
at com.intellij.execution.process.ProcessHandler$2.processTerminated(ProcessHandler.java:262)
from auto-dev.
复现了,应该是 topic 没有 unsubscribe 导致的,只有多次执行 agent 才会出现。
from auto-dev.
對 我剛剛也測試到這段,我是加了一個是否已經subscribe的判斷
如果有subscribe就不做原有的動作
from auto-dev.
哦,那我就不改了,你直接来 PR ?
from auto-dev.
Related Issues (20)
- Broken Links in Readme.md HOT 3
- AI-Powered rename command
- 在远程开发模式下无法使用,需要"Git4Idea"插件 HOT 16
- 在远程开发模式下无法使用,需要"Git4Idea"插件 HOT 1
- XingHuo LLM配置,显示2个星火API密钥 HOT 3
- 本地构建报错 HOT 4
- You LLM server Key is empty HOT 2
- 为什么我的idea 安装了AutoDev 在AutoDev Chat下没有看到Create SQL HOT 2
- Allow customization of initial system prompt HOT 4
- 启用 AutoDev插件后会影响代码的方法悬浮显示
- Batch Custom Prompts
- AutoTest embedded custom agents contexts as variable HOT 1
- Batch Genenerate test
- 请教:为何 AutoDevEditorListener 始终无法触发自动补全 HOT 5
- Gen HTTP API Test
- 测试此代码功能报错 HOT 4
- 实现快速的相似度搜索 HOT 3
- 进入Tool 配置时报错,idea版本2022.3.2 HOT 1
- Refactor context URL parse
- 聊天支持发送图片 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-dev.