running and cancel all commands

This commit is contained in:
ari committed 2026-11-01 20:29:39 -05:00
1 parent 917a361370
commit af249326e8
7 files changed
+145 -6

No files matched your search

+4
View File
@@ -36,6 +36,10 @@ var Commands = []SlackCommand{
Help: "Show this container's state, size, node, time unused, idle limit, home folder usage and every node."},
{Name: "sessions", Verb: "sessions", Shows: true,
Help: "List this container's recent sessions (Slack threads), with links."},
{Name: "running", Verb: "running", Shows: true, ReadOnly: true,
Help: "List the replies being worked on right now in this channel or DM, including yours, with links, who asked and how long they've run."},
{Name: "cancel_all", Verb: "cancel all",
Help: "Cancel every other reply being worked on right now in this channel or DM, like pressing Cancel on each. Your own reply carries on, and every session is kept."},
{Name: "nodes", Verb: "nodes", Shows: true,
Help: "List every node with the CPU, RAM and storage free on it, and where this container runs."},
{Name: "permissions", Verb: "permissions", Shows: true,
+5 -1
View File
@@ -18,7 +18,7 @@ func TestEveryCommandIsListed(t *testing.T) {
for _, tool := range s.tools() {
names = append(names, tool.(map[string]any)["name"].(string))
}
for _, want := range []string{"send_file", "status", "sessions", "nodes", "permissions", "stop", "scale", "keep",
for _, want := range []string{"send_file", "status", "sessions", "running", "cancel_all", "nodes", "permissions", "stop", "scale", "keep",
"storage", "move", "listen", "grant", "revoke", "reset_permissions", "dm_permission", "managers"} {
if !strings.Contains(" "+strings.Join(names, " ")+" ", " "+want+" ") {
t.Fatalf("%s missing from %v", want, names)
@@ -85,6 +85,10 @@ func TestCommandCall(t *testing.T) {
if !ok || c.Text(args) != "scale up" {
t.Fatalf("by title: %+v %q %v", c, args, ok)
}
c, args, ok = CommandCall(acp.Update{Kind: "tool_call", Title: "slackerbot: cancel all"})
if !ok || c.Text(args) != "cancel all" || !c.Changes(args) {
t.Fatalf("cancel all by title: %+v %q %v", c, args, ok)
}
if _, _, ok := CommandCall(acp.Update{Kind: "tool_call", ToolName: "slackerbot__send_file"}); ok {
t.Fatal("send_file isn't a command")
}