



























@@ -1,7 +1,9 @@
1+import { execFile } from "node:child_process";
12import fs from "node:fs/promises";
23import os from "node:os";
34import path from "node:path";
45import { fileURLToPath } from "node:url";
6+import { promisify } from "node:util";
57import { afterEach, describe, expect, it } from "vitest";
68import {
79appendJsonl,
@@ -23,6 +25,8 @@ const CREDENTIAL_SCRIPT_PATH = path.resolve(
2325TEST_DIR,
2426"../../scripts/e2e/npm-telegram-rtt-credentials.mjs",
2527);
28+const CONFIG_SCRIPT_PATH = path.resolve(TEST_DIR, "../../scripts/e2e/npm-telegram-rtt-config.mjs");
29+const execFileAsync = promisify(execFile);
2630const tempDirs: string[] = [];
27312832afterEach(async () => {
@@ -156,6 +160,26 @@ describe("RTT harness", () => {
156160expect(script).toContain("leaseTtlMs: leaseTtlMsFromLease(config, lease)");
157161});
158162163+it("generates final-only Telegram RTT delivery config for release packages", async () => {
164+const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-rtt-config-test-"));
165+tempDirs.push(tempDir);
166+const configPath = path.join(tempDir, "config.json");
167+168+await execFileAsync(process.execPath, [
169+CONFIG_SCRIPT_PATH,
170+configPath,
171+"12345",
172+"-100123",
173+"111:driver-token",
174+"222:sut-token",
175+"2026.5.16-beta.6",
176+]);
177+178+const config = JSON.parse(await fs.readFile(configPath, "utf8"));
179+expect(config.channels.telegram.streaming).toBe(false);
180+expect(config.messages.groupChat.visibleReplies).toBe("automatic");
181+});
182+159183it("extracts RTT values from Telegram QA summaries", async () => {
160184const summary = await readTelegramSummary(FIXTURE_PATH);
161185expect(extractRtt(summary)).toEqual({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。