Skip to content

Commit d49b2c0

Browse files
committed
fix(CustomAgentChatProcessor): handle response actions more robustly and add logging #51
1 parent f2c708b commit d49b2c0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,14 @@ class CustomAgentChatProcessor(val project: Project) {
5454

5555
CustomAgentResponseAction.Stream -> {
5656
ui.addMessage(AutoDevBundle.message("autodev.loading"))
57+
var msg = ""
5758
LLMCoroutineScope.scope(project).launch {
58-
ui.updateMessage(response)
59+
msg = ui.updateMessage(response)
5960
}
61+
62+
llmProvider.appendLocalMessage(msg, ChatRole.Assistant)
63+
ui.hiddenProgressBar()
64+
ui.updateUI()
6065
}
6166

6267
CustomAgentResponseAction.TextChunk -> {
@@ -75,7 +80,7 @@ class CustomAgentChatProcessor(val project: Project) {
7580
}
7681

7782
CustomAgentResponseAction.Flow -> {
78-
TODO()
83+
logger.error("will not support flow response for now")
7984
}
8085

8186
CustomAgentResponseAction.WebView -> {
@@ -85,7 +90,7 @@ class CustomAgentChatProcessor(val project: Project) {
8590
sb.append(it)
8691
}
8792
}
88-
// TODO: add decode support
93+
8994
val content = sb.toString()
9095
llmProvider.appendLocalMessage(content, ChatRole.Assistant)
9196

0 commit comments

Comments
 (0)