Skip to content

Commit 214eb79

Browse files
committed
Revert "refactor(custom-agent): improve response action handling and add removeLastMessage function #51"
This reverts commit 3f2b4a6.
1 parent 3f2b4a6 commit 214eb79

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/main/kotlin/cc/unitmesh/devti/counit/CustomAgentChatProcessor.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
package cc.unitmesh.devti.counit
22

3+
import cc.unitmesh.devti.AutoDevBundle
34
import cc.unitmesh.devti.counit.model.CustomAgentConfig
45
import cc.unitmesh.devti.counit.model.CustomAgentState
56
import cc.unitmesh.devti.counit.model.ResponseAction
67
import cc.unitmesh.devti.gui.chat.ChatCodingPanel
78
import cc.unitmesh.devti.gui.chat.ChatContext
89
import cc.unitmesh.devti.provider.ContextPrompter
10+
import cc.unitmesh.devti.util.LLMCoroutineScope
911
import com.intellij.openapi.components.Service
1012
import com.intellij.openapi.diagnostic.logger
1113
import com.intellij.openapi.project.Project
14+
import kotlinx.coroutines.launch
1215
import kotlinx.coroutines.runBlocking
1316

1417
@Service(Service.Level.PROJECT)
@@ -42,6 +45,13 @@ class CustomAgentChatProcessor(val project: Project) {
4245
ui.updateUI()
4346
}
4447

48+
ResponseAction.Stream -> {
49+
ui.addMessage(AutoDevBundle.message("autodev.loading"))
50+
LLMCoroutineScope.scope(project).launch {
51+
// ui.updateMessage(response)
52+
}
53+
}
54+
4555
ResponseAction.TextChunk -> {
4656
val sb = StringBuilder()
4757
runBlocking {

src/main/kotlin/cc/unitmesh/devti/counit/model/AgentResponseAction.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ enum class ResponseAction {
1313
*/
1414
Direct,
1515

16+
/**
17+
* Stream response
18+
*/
19+
Stream,
20+
1621
/**
1722
* Text splitting result
1823
*/

src/main/kotlin/cc/unitmesh/devti/gui/chat/ChatCodingPanel.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,6 @@ class ChatCodingPanel(private val chatCodingService: ChatCodingService, val disp
255255
progressBar.isVisible = false
256256
}
257257

258-
/**
259-
* Remove the last message from the list and update the UI.
260-
*
261-
* @return void
262-
*/
263258
fun removeLastMessage() {
264259
if (myList.componentCount > 0) {
265260
myList.remove(myList.componentCount - 1)

0 commit comments

Comments
 (0)