From 2b92706dcfaabd09ecdb8993f244fe59a586ce63 Mon Sep 17 00:00:00 2001 From: Alex Knight <15041791+amknight@users.noreply.github.com> Date: Sun, 21 Jun 2026 21:28:25 +1000 Subject: [PATCH] feat(mattermost): register /oc_queue as a native slash command Add oc_queue to DEFAULT_COMMAND_SPECS so the native slash-command registrar exposes /oc_queue, mapped (originalName: queue) to the core /queue directive via the existing trigger-map path. Additive; rides the same registration/callback machinery as the other oc_* commands. --- .../mattermost/src/mattermost/slash-commands.test.ts | 9 +++++++++ extensions/mattermost/src/mattermost/slash-commands.ts | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/extensions/mattermost/src/mattermost/slash-commands.test.ts b/extensions/mattermost/src/mattermost/slash-commands.test.ts index 123d79846a5e..182fce74dc48 100644 --- a/extensions/mattermost/src/mattermost/slash-commands.test.ts +++ b/extensions/mattermost/src/mattermost/slash-commands.test.ts @@ -108,6 +108,15 @@ describe("slash-commands", () => { ).toEqual(["oc_model", "oc_models"]); }); + it("registers the queue command mapped to the core /queue directive", () => { + const queueSpec = DEFAULT_COMMAND_SPECS.find((spec) => spec.trigger === "oc_queue"); + expect(queueSpec?.originalName).toBe("queue"); + const triggerMap = new Map([["oc_queue", "queue"]]); + expect(resolveCommandText("oc_queue", " collect drop:summarize ", triggerMap)).toBe( + "/queue collect drop:summarize", + ); + }); + it("normalizes callback path in slash config", () => { const config = resolveSlashCommandConfig({ callbackPath: "api/channels/mattermost/command" }); expect(config.callbackPath).toBe("/api/channels/mattermost/command"); diff --git a/extensions/mattermost/src/mattermost/slash-commands.ts b/extensions/mattermost/src/mattermost/slash-commands.ts index 89a10d51f920..9536c4f1b2ea 100644 --- a/extensions/mattermost/src/mattermost/slash-commands.ts +++ b/extensions/mattermost/src/mattermost/slash-commands.ts @@ -172,6 +172,13 @@ export const DEFAULT_COMMAND_SPECS: MattermostCommandSpec[] = [ autoComplete: true, autoCompleteHint: "[on|off]", }, + { + trigger: "oc_queue", + originalName: "queue", + description: "Adjust active-run queue behavior", + autoComplete: true, + autoCompleteHint: "[steer|followup|collect|interrupt] [debounce:2s] [cap:N] [drop:old|new|summarize]", + }, ]; // ─── Command registration ────────────────────────────────────────────────────