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>
This commit is contained in:
Sk Akram
2026-02-13 07:47:25 +05:30
committed by GitHub
parent 89503e1451
commit 7cbf607a8f
4 changed files with 5 additions and 4 deletions
+1
View File
@@ -9,6 +9,7 @@ Docs: https://docs.openclaw.ai
- CLI/Plugins: add `openclaw plugins uninstall <id>` with `--dry-run`, `--force`, and `--keep-files` options, including safe uninstall path handling and plugin uninstall docs. (#5985) Thanks @JustasMonkev. - CLI/Plugins: add `openclaw plugins uninstall <id>` 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. - CLI: add `openclaw logs --local-time` to display log timestamps in local timezone. (#13818) Thanks @xialonglee.
- Telegram: render blockquotes as native `<blockquote>` tags instead of stripping them. (#14608) - Telegram: render blockquotes as native `<blockquote>` 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. - 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. - Config: avoid redacting `maxTokens`-like fields during config snapshot redaction, preventing round-trip validation failures in `/config`. (#14006) Thanks @constansino.
+1 -1
View File
@@ -409,9 +409,9 @@ function buildChatCommands(): ChatCommandDefinition[] {
}), }),
defineChatCommand({ defineChatCommand({
key: "compact", key: "compact",
nativeName: "compact",
description: "Compact the session context.", description: "Compact the session context.",
textAlias: "/compact", textAlias: "/compact",
scope: "text",
category: "session", category: "session",
args: [ args: [
{ {
+1 -1
View File
@@ -39,7 +39,7 @@ describe("commands registry", () => {
expect(specs.find((spec) => spec.name === "stop")).toBeTruthy(); expect(specs.find((spec) => spec.name === "stop")).toBeTruthy();
expect(specs.find((spec) => spec.name === "skill")).toBeTruthy(); expect(specs.find((spec) => spec.name === "skill")).toBeTruthy();
expect(specs.find((spec) => spec.name === "whoami")).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", () => { it("filters commands based on config flags", () => {
+2 -2
View File
@@ -409,7 +409,7 @@ describe("buildStatusMessage", () => {
}); });
describe("buildCommandsMessage", () => { describe("buildCommandsMessage", () => {
it("lists commands with aliases and text-only hints", () => { it("lists commands with aliases and hints", () => {
const text = buildCommandsMessage({ const text = buildCommandsMessage({
commands: { config: false, debug: false }, commands: { config: false, debug: false },
} as OpenClawConfig); } as OpenClawConfig);
@@ -418,7 +418,7 @@ describe("buildCommandsMessage", () => {
expect(text).toContain("/commands - List all slash commands."); expect(text).toContain("/commands - List all slash commands.");
expect(text).toContain("/skill - Run a skill by name."); expect(text).toContain("/skill - Run a skill by name.");
expect(text).toContain("/think (/thinking, /t) - Set thinking level."); 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("/config");
expect(text).not.toContain("/debug"); expect(text).not.toContain("/debug");
}); });