fix(telegram): keep plugin slash commands on native path

This commit is contained in:
Ayaan Zaidi
2026-05-14 15:05:14 +05:30
parent 23cfc81bcd
commit 23ed804657
3 changed files with 19 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ Docs: https://docs.openclaw.ai
- Security/sandbox: include Windows `USERPROFILE` in the sandbox blocked home roots so credential-bearing binds (such as `.codex`, `.openclaw`, or `.ssh` under the Windows user profile) are denied even when `HOME` points at a different shell home. (#63074) Thanks @luoyanglang.
- Gateway/OpenAI-compatible HTTP: parse shared JSON endpoint paths without trusting malformed Host headers, avoiding 500s before `/v1/chat/completions`, `/v1/responses`, and `/v1/embeddings` request handling.
- Telegram: keep Bot API polling alive during main event-loop stalls by moving ingress to an isolated worker with a durable local spool. Fixes #81132. (#81746) Thanks @joshavant.
- Telegram: resolve plugin native commands with the active runtime config so commands like `/codex ...` stay on the native command path.
- Telegram: preserve rendered HTML formatting through lazy cron announce delivery so Markdown links stay clickable instead of falling back to literal anchor tags. Fixes #81742. (#81758)
- Voice-call webhooks: parse webhook and realtime upgrade paths without trusting malformed Host headers, avoiding 500s before provider signature checks or path rejection.
- Media store: reject malformed redirect `Location` headers as media-download failures instead of letting URL parsing escape the async response callback.

View File

@@ -284,6 +284,23 @@ describe("registerTelegramNativeCommands", () => {
expect(registeredHandlers).not.toContain("export-session");
});
it("resolves plugin commands with the Telegram runtime config", () => {
const cfg: OpenClawConfig = {
commands: { native: true },
channels: {
telegram: {
dmPolicy: "open",
},
},
};
registerTelegramNativeCommands(createNativeCommandTestParams(cfg));
expect(pluginCommandMocks.getPluginCommandSpecs).toHaveBeenCalledWith("telegram", {
config: cfg,
});
});
it("registers only Telegram-safe command names across native, custom, and plugin sources", async () => {
const setMyCommands = vi.fn().mockResolvedValue(undefined);

View File

@@ -732,7 +732,7 @@ export const registerTelegramNativeCommands = ({
const pluginCommandSpecs =
(
telegramDeps.getPluginCommandSpecs ?? defaultTelegramNativeCommandDeps.getPluginCommandSpecs
)?.("telegram") ?? [];
)?.("telegram", { config: cfg }) ?? [];
const existingCommands = new Set(
[
...nativeCommands.map((command) => normalizeTelegramCommandName(command.name)),