Extensions: stabilize telegram registry contracts

This commit is contained in:
Gustavo Madeira Santana
2026-03-29 21:41:41 -04:00
parent e92440e9f4
commit f44174cf61
4 changed files with 23 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ import path from "node:path";
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { loadBundledPluginTestApiSync } from "../../../src/test-utils/bundled-plugin-public-surface.js";
import { importFreshModule } from "../../../test/helpers/import-fresh.js";
import {
__testing,
@@ -172,6 +173,14 @@ describe("telegram thread bindings", () => {
);
});
it("exposes the reset helper through the bundled test api", async () => {
const { resetTelegramThreadBindingsForTests } = loadBundledPluginTestApiSync<{
resetTelegramThreadBindingsForTests: () => Promise<void>;
}>("telegram");
await expect(resetTelegramThreadBindingsForTests()).resolves.toBeUndefined();
});
it("does not persist lifecycle updates when manager persistence is disabled", async () => {
stateDirOverride = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-telegram-bindings-"));
process.env.OPENCLAW_STATE_DIR = stateDirOverride;