fix(studio): improve chat context, thinking tags, streaming, and tool results
All checks were successful
Beta Release / beta (push) Successful in 39s
All checks were successful
Beta Release / beta (push) Successful in 39s
- Fix cleanThinkingTags to use proper regex instead of naive ReplaceAll - Send conversation history (last 20 messages + summary) to AI instead of single message - Store tool results alongside tool calls so history shows complete execution info - Stream words instead of characters for smoother SSE rendering - Add stop button to cancel in-progress AI requests (AbortController) - Fix markdown rendering: add h2 support, use div for bullets - Add i18n keys for cancel/stop (EN + FR) 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
@@ -136,8 +136,13 @@ func (s *Server) handleShellChatStream(w http.ResponseWriter, orb *orchestrator.
|
||||
content := cleanThinkingTags(choice.Message.Content)
|
||||
|
||||
if content != "" {
|
||||
for _, ch := range strings.Split(content, "") {
|
||||
writeSSE(map[string]interface{}{"content": ch})
|
||||
words := strings.Fields(content)
|
||||
for i, w := range words {
|
||||
chunk := w
|
||||
if i < len(words)-1 {
|
||||
chunk += " "
|
||||
}
|
||||
writeSSE(map[string]interface{}{"content": chunk})
|
||||
}
|
||||
finalContent = content
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user