fix: remove task approval from Telegram command surface (qnm)

This commit is contained in:
sam committed 2026-07-29 03:25:19 +10:00
commit 1d85a0b532
3 files changed
+11 -2

No files matched your search

-1
View File
@@ -25,7 +25,6 @@ var gatewayCommandSpecs = []commandSpec{
{Command: "provider", Description: "Choose the provider used for chat", Usage: "/provider"},
{Command: "model", Description: "Show the model selector or switch directly", Usage: "/model [provider/model]"},
{Command: "spawn", Description: "Create a tracked task", Usage: "/spawn [identity=name] [repo=owner/name] [workflow=name] <title>"},
{Command: "approve", Description: "Approve and requeue a waiting task", Usage: "/approve [identity=name] <task-id>"},
{Command: "cancel", Description: "Cancel a queued or waiting task", Usage: "/cancel [identity=name] <task-id>"},
{Command: "restart", Description: "Reload Archie and its configuration", Usage: "/restart"},
{Command: "help", Description: "See what Archie can do", Usage: "/help"},
+8 -1
View File
@@ -156,6 +156,13 @@ func TestVersionReportsBothComponents(t *testing.T) {
}
}
// telegramHiddenCommands lists gateway-local commands that are intentionally
// not advertised in Telegram's menu or help, because they are reserved or
// dangerous and should not be discoverable by casual chat users. Commands in
// this set may still be executable if typed explicitly — they just shouldn't
// appear on Telegram's discoverability surfaces.
var telegramHiddenCommands = map[string]bool{"approve": true}
func TestPublishedCommandsMatchExecutableCommandSurface(t *testing.T) {
executable := make(map[string]bool)
for _, command := range gateway.LocalCommands() {
@@ -171,7 +178,7 @@ func TestPublishedCommandsMatchExecutableCommandSurface(t *testing.T) {
}
for command := range executable {
if !published[command] {
if !published[command] && !telegramHiddenCommands[command] {
t.Errorf("executable /%s command is missing from the menu and help", command)
}
}
+3
View File
@@ -172,6 +172,9 @@ func (r *Router) Route(ctx context.Context, msg Message) (string, error) {
rest := restAfter(text, cmd, r.gatewayName)
return r.handleSpawn(ctx, rest)
case "/approve":
// Reserved for dangerous-command approval (archie-core-alm.6).
// Telegram hides it from its menu/help; other gateways keep it
// wired until the new design is wired up.
return r.handleApprove(ctx, restAfter(text, cmd, r.gatewayName))
case "/cancel":
return r.handleCancel(ctx, restAfter(text, cmd, r.gatewayName))