New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom agent 執行 /write 語法 產生問題 #146
Comments
…nse #146 This commit adds code parsing to ensure the correct language is detected before compiling and introduces a notification system to inform users of the compilation result.
😢😢😢 复现还是有难度,你要不创建个 gist ,把 server 贴上去, |
試試看這樣的設定,打到我的agent server { |
有可能最新版本真的可以:https://github.com/unit-mesh/auto-dev/actions/runs/8647351673
|
先回報一下 windows : 三個版本都測試過,都是一樣的問題 請同事也一起幫忙測試,有結果再來回報 |
請問都已經移除又安裝,甚至使用今天最新版本還是有一樣的問題,是否有建議可以找出問題的方式嗎?? 另外想請問,若是我自己可以怎樣做,來找出可能的問題呢? 例如怎樣可以包出一樣的zip?? |
我再确认一下是从哪里下载的包? 理论上是可以构建出一样的,但是 idea 插件学习成本高 |
我就是直接從github上clone下來的 |
因为要下载各种 IDEA 资源,估计初次构建要 1 小时左右? 详细,可以参考一下 GitHub Action 。 |
我有嘗試過,只是不確定要哪些task 剛剛安裝自己建立的版本後,問題依舊... XD |
2333,主要是我用了你的服务是好的 |
哦,哦,我懂了:意思是不想要 panel 是吧?Panel 的原本意图是用来 debug 用的。 你看是加个配置??或者你自己先改改用?然后我看最后怎么设计? |
因為 我直接寫一個 .devin 檔案 ,內容就是直接寫 /write:test.java 我以為 |
嗯,懂了,那我在 responseAction 是 主要是 Custom Agent 原来的行为都是在 Panel 里方便调试,我晚点想想怎么加个别的 debug 方式。 感谢建议 |
我剛剛加了log看,應該就是你說的原因 這是執行的結果內容,平常 .devin 執行 是直接在結果輸出視窗印出 Writing to file: len/test.java
|
哈哈,要不你直接来个 PR? |
我還不知道要怎樣改 .. @@ 只能先幫忙找出可能性了 第二個問題,沒有產生檔案的問題 對照 143 issue的調整 |
第一个问题的话,如果想把结果返回回去,可以改为: /**
* This function is responsible for running a task with a new script.
* @param newScript The new script to be run.
*/
fun executeTask(newScript: DevInFile) {
val compiledResult = DevInsCompiler(project, newScript).compile()
val prompt = compiledResult.output
if (compiledResult.hasError) {
val llmProvider = LlmFactory().create(project)
val output: Flow<String> = llmProvider.stream(prompt, "", keepHistory = false)
// handle output
}
} 如果要出于 AI Agent 的话,是需要继续对话的,怎么设计就比较痛苦了。不太确定,或者你要的是: if (compiledResult.hasError) {
sendToChatWindow(project, ChatActionType.CHAT) { panel, service ->
service.handlePromptAndResponse(panel, object : ContextPrompter() {
override fun displayPrompt(): String = prompt
override fun requestPrompt(): String = prompt
}, null, true)
} |
第一個 val llmProvider = LlmFactory().create(project) 這個用途不太清楚是啥耶 第二個改法至少是針對你現行程式執行成功不需要出對話視窗,至少是跟原有相同反應,有錯才跳出建議 |
@ymli0215 那你来 PR 吧,哈哈哈哈。难得试了这么多 |
無法產生檔案的問題應該算找到了??? error
太尷尬了 根本不知道要怎樣修正... XD |
按理说,35 行只是找目录,看上去不会报错 Lines 33 to 38 in 9f67671
|
我覺得比較可能是 runWriteAction 本身的問題,不是 runWriteAction {} 內部程式的問題 因為我直接下log去看,val hasChildPath = filepath.contains(pathSeparator) 這行都還沒有執行到就死了 |
那就有点难办了,你用的操作系统是 Windows 还是? |
@ymli0215 我优化了一下 Lines 49 to 64 in 42d1219
|
因為我看了runWriteAction 的應用情境,都是提到UI,然後聯想到你說之前版本測試都是正常的,我卻是都有問題 我猜你是直接透過對話視窗去執行的,直接指定custom agent後去執行,如下圖 但是我是在新增一個 .devin 檔案,在檔案中下 @junit 這樣去執行的,如下圖 我跑去安裝幾天前的版本,如果我是在對話視窗中去跑custom agent的話,的確就是你說的結果,測試都是正常的 我猜我們的差異就是在這邊,但是這邊就變成在流程中就要去判斷是對話視窗或是檔案執行模式了 這應該就是我一直會碰到 IllegalStateException 這種錯誤的原因吧 |
复现了,我晚点修复一下问题 |
…moother execution #146 This commit optimizes the directory creation logic in WriteInsCommand.kt and introduces runInEdt for smoother execution in DevInsProcessProcessor.kt.
@ymli0215 我提交上去了,你可以拉下来代码试试 |
另外問一個情境喔,要請問這是你預期的嗎??? 就是對話視窗這邊選擇custom agent的時候 例如我用agent : junit 他會把內容寫入到 test.java |
回報一下 結果都符合預期了 |
custom agent 默认的场景是基于公司内部知识库 rag 来提供上下文,所以默认第二次不走 agent。期望的是,agent 能一次根据上下文解决 如果有别的需求,可以再提 issue,哈哈哈 |
…r for better error handling and display. #146
依照最新版本以及規格
custom agent設定"responseAction": "DevIns"
agent 回應下方內容
檔案已存在的情境下,可以正常寫入,但是會出現錯誤,以及出現chat panel
error log
如果檔案不存在,預期要能新建檔案
雖然說已經完成,但沒有看到新增的檔案,並且會有錯誤
error log
The text was updated successfully, but these errors were encountered: