We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a968e06 commit 9df7dd2Copy full SHA for 9df7dd2
1 file changed
src/store.ts
@@ -143,7 +143,18 @@ export const AgentStore = createContextStore<StoreModel>({
143
abortRequest: action((state) => {
144
state.abortController?.abort()
145
state.abortController = undefined
146
- state.currentAssistantMessage = ""
+
147
+ if (state.currentAssistantMessage.trim()) {
148
+ // Persist what has been generated so far
149
+ state.chatHistory.push({
150
+ type: "message",
151
+ role: "assistant",
152
+ content: state.currentAssistantMessage,
153
+ })
154
155
+ state.currentAssistantMessage = ""
156
+ }
157
158
state.stats = "User aborted the request."
159
state.isProcessing = false
160
}),
0 commit comments