Merge pull request #323 from mx1700/feat/stop-command

feat: add /stop command to abort agent generation on external channels
This commit is contained in:
zhangxx
2026-04-08 01:25:09 +08:00
committed by GitHub
parent 8d5c38f0e5
commit 8c4e9e218e
4 changed files with 105 additions and 11 deletions
+2 -1
View File
@@ -112,7 +112,8 @@ func NewHandler(
// the regular resource-group dispatch (e.g. in the channel inbound
// processor which has the required routing context).
var topLevelCommands = map[string]string{
"new": "Start a new conversation (resets session context)",
"new": "Start a new conversation (resets session context)",
"stop": "Stop the current generation",
}
// IsCommand reports whether the text contains a slash command.
+2 -1
View File
@@ -81,7 +81,8 @@ func (r *Registry) GlobalHelp() string {
var b strings.Builder
b.WriteString("Available commands:\n\n")
b.WriteString("/help - Show this help message\n")
b.WriteString("/new - Start a new conversation (resets session context)\n\n")
b.WriteString("/new - Start a new conversation (resets session context)\n")
b.WriteString("/stop - Stop the current generation\n\n")
for i, name := range r.order {
if i > 0 {
b.WriteByte('\n')