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

View File

@@ -409,9 +409,9 @@ function buildChatCommands(): ChatCommandDefinition[] {
}),
defineChatCommand({
key: "compact",
nativeName: "compact",
description: "Compact the session context.",
textAlias: "/compact",
scope: "text",
category: "session",
args: [
{

View File

@@ -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", () => {

View File

@@ -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");
});