From 7cbf607a8f4b75be6773f49e4134fb8d853b4307 Mon Sep 17 00:00:00 2001 From: Sk Akram Date: Fri, 13 Feb 2026 07:47:25 +0530 Subject: [PATCH] feat: expose /compact command in Telegram native menu (openclaw#10352) thanks @akramcodez Verified: - pnpm build - pnpm check - pnpm test Co-authored-by: akramcodez <179671552+akramcodez@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> --- CHANGELOG.md | 1 + src/auto-reply/commands-registry.data.ts | 2 +- src/auto-reply/commands-registry.test.ts | 2 +- src/auto-reply/status.test.ts | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b939b40936..f960c49bb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Docs: https://docs.openclaw.ai - CLI/Plugins: add `openclaw plugins uninstall ` with `--dry-run`, `--force`, and `--keep-files` options, including safe uninstall path handling and plugin uninstall docs. (#5985) Thanks @JustasMonkev. - CLI: add `openclaw logs --local-time` to display log timestamps in local timezone. (#13818) Thanks @xialonglee. - Telegram: render blockquotes as native `
` tags instead of stripping them. (#14608) +- Telegram: expose `/compact` in the native command menu. (#10352) Thanks @akramcodez. - Discord: add role-based allowlists and role-based agent routing. (#10650) Thanks @Minidoracat. - Config: avoid redacting `maxTokens`-like fields during config snapshot redaction, preventing round-trip validation failures in `/config`. (#14006) Thanks @constansino. diff --git a/src/auto-reply/commands-registry.data.ts b/src/auto-reply/commands-registry.data.ts index 076541d98a..9a8c02cfa5 100644 --- a/src/auto-reply/commands-registry.data.ts +++ b/src/auto-reply/commands-registry.data.ts @@ -409,9 +409,9 @@ function buildChatCommands(): ChatCommandDefinition[] { }), defineChatCommand({ key: "compact", + nativeName: "compact", description: "Compact the session context.", textAlias: "/compact", - scope: "text", category: "session", args: [ { diff --git a/src/auto-reply/commands-registry.test.ts b/src/auto-reply/commands-registry.test.ts index 87fc8cd6ab..9deb7dcf72 100644 --- a/src/auto-reply/commands-registry.test.ts +++ b/src/auto-reply/commands-registry.test.ts @@ -39,7 +39,7 @@ describe("commands registry", () => { expect(specs.find((spec) => spec.name === "stop")).toBeTruthy(); expect(specs.find((spec) => spec.name === "skill")).toBeTruthy(); expect(specs.find((spec) => spec.name === "whoami")).toBeTruthy(); - expect(specs.find((spec) => spec.name === "compact")).toBeFalsy(); + expect(specs.find((spec) => spec.name === "compact")).toBeTruthy(); }); it("filters commands based on config flags", () => { diff --git a/src/auto-reply/status.test.ts b/src/auto-reply/status.test.ts index 69fe129448..ac1fc8082d 100644 --- a/src/auto-reply/status.test.ts +++ b/src/auto-reply/status.test.ts @@ -409,7 +409,7 @@ describe("buildStatusMessage", () => { }); describe("buildCommandsMessage", () => { - it("lists commands with aliases and text-only hints", () => { + it("lists commands with aliases and hints", () => { const text = buildCommandsMessage({ commands: { config: false, debug: false }, } as OpenClawConfig); @@ -418,7 +418,7 @@ describe("buildCommandsMessage", () => { expect(text).toContain("/commands - List all slash commands."); expect(text).toContain("/skill - Run a skill by name."); expect(text).toContain("/think (/thinking, /t) - Set thinking level."); - expect(text).toContain("/compact [text] - Compact the session context."); + expect(text).toContain("/compact - Compact the session context."); expect(text).not.toContain("/config"); expect(text).not.toContain("/debug"); });