From 2aaa17dc6f20701751a1e3c7da5d5491af5a2e5a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 14 Apr 2026 18:53:14 +0100 Subject: [PATCH] fix(ci): restore main typecheck --- extensions/telegram/src/bot-handlers.runtime.ts | 15 ++++++--------- .../shared/channel-legacy-config-migrate.test.ts | 5 ++++- .../doctor/shared/channel-plugin-blockers.test.ts | 2 +- .../outbound/message-action-runner.media.test.ts | 3 +++ src/plugins/sdk-alias.test.ts | 11 +++++++++-- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/extensions/telegram/src/bot-handlers.runtime.ts b/extensions/telegram/src/bot-handlers.runtime.ts index 7447b696164..5d7bdd9d41b 100644 --- a/extensions/telegram/src/bot-handlers.runtime.ts +++ b/extensions/telegram/src/bot-handlers.runtime.ts @@ -14,11 +14,7 @@ import { updateSessionStore, } from "openclaw/plugin-sdk/config-runtime"; import type { DmPolicy } from "openclaw/plugin-sdk/config-runtime"; -import type { - TelegramDirectConfig, - TelegramGroupConfig, - TelegramTopicConfig, -} from "openclaw/plugin-sdk/config-runtime"; +import type { TelegramGroupConfig, TelegramTopicConfig } from "openclaw/plugin-sdk/config-runtime"; import { applyModelOverrideToSessionEntry } from "openclaw/plugin-sdk/config-runtime"; import { buildPluginBindingResolvedText, @@ -304,7 +300,7 @@ export const registerTelegramHandlers = ({ senderId?: string | number; }): { agentId: string; - sessionEntry: ReturnType[string] | undefined; + sessionEntry: ReturnType["existing"]; sessionKey: string; model?: string; } => { @@ -836,8 +832,9 @@ export const registerTelegramHandlers = ({ // for reactions, we cannot determine if the reaction came from a topic, so block all // reactions if requireTopic is enabled for this DM. if (!isGroup) { - const requireTopic = (eventAuthContext.groupConfig) - ?.requireTopic; + const requireTopic = ( + eventAuthContext.groupConfig as { requireTopic?: boolean } | undefined + )?.requireTopic; if (requireTopic === true) { logVerbose( `Blocked telegram reaction in DM ${chatId}: requireTopic=true but topic unknown for reactions`, @@ -1535,7 +1532,7 @@ export const registerTelegramHandlers = ({ } return; } - const models = [...modelSet].toSorted(); + const models = [...modelSet].toSorted((left, right) => left.localeCompare(right)); const pageSize = getModelsPageSize(); const totalPages = calculateTotalPages(models.length, pageSize); const safePage = Math.max(1, Math.min(page, totalPages)); diff --git a/src/commands/doctor/shared/channel-legacy-config-migrate.test.ts b/src/commands/doctor/shared/channel-legacy-config-migrate.test.ts index 6786d7ceb0d..ec54560ccc7 100644 --- a/src/commands/doctor/shared/channel-legacy-config-migrate.test.ts +++ b/src/commands/doctor/shared/channel-legacy-config-migrate.test.ts @@ -71,7 +71,10 @@ describe("bundled channel legacy config migrations", () => { expect(applyPluginDoctorCompatibilityMigrations).not.toHaveBeenCalled(); expect(loadBundledChannelDoctorContractApi).toHaveBeenCalledWith("slack"); - expect(result.next.channels?.slack).toMatchObject({ + const nextChannels = (result.next.channels ?? {}) as { + slack?: Record; + }; + expect(nextChannels.slack).toMatchObject({ streaming: true, normalizedByBundledContract: true, }); diff --git a/src/commands/doctor/shared/channel-plugin-blockers.test.ts b/src/commands/doctor/shared/channel-plugin-blockers.test.ts index 406d4a04f77..69943353764 100644 --- a/src/commands/doctor/shared/channel-plugin-blockers.test.ts +++ b/src/commands/doctor/shared/channel-plugin-blockers.test.ts @@ -41,7 +41,7 @@ describe("channel plugin blockers", () => { }, ], diagnostics: [], - } as ReturnType); + } as unknown as ReturnType); const hits = scanConfiguredChannelPluginBlockers({ plugins: { diff --git a/src/infra/outbound/message-action-runner.media.test.ts b/src/infra/outbound/message-action-runner.media.test.ts index 82fd485d520..cc524e53111 100644 --- a/src/infra/outbound/message-action-runner.media.test.ts +++ b/src/infra/outbound/message-action-runner.media.test.ts @@ -648,6 +648,9 @@ describe("runMessageAction media behavior", () => { }); expect(result.kind).toBe("send"); + if (result.kind !== "send") { + throw new Error("expected send result"); + } expect(result.sendResult).toMatchObject({ channel: "profile-demo", }); diff --git a/src/plugins/sdk-alias.test.ts b/src/plugins/sdk-alias.test.ts index e9feca30634..c3b91ff1ce6 100644 --- a/src/plugins/sdk-alias.test.ts +++ b/src/plugins/sdk-alias.test.ts @@ -185,12 +185,19 @@ function writePluginEntry(root: string, relativePath: string) { } function createUserInstalledPluginSdkAliasFixture() { - const { fixture, sourceRootAlias } = createPluginSdkAliasTargetFixture(); + const { fixture, sourceRootAlias, sourceChannelRuntimePath } = + createPluginSdkAliasTargetFixture(); const externalPluginRoot = path.join(makeTempDir(), ".openclaw", "extensions", "demo"); const externalPluginEntry = path.join(externalPluginRoot, "index.ts"); mkdirSafeDir(externalPluginRoot); fs.writeFileSync(externalPluginEntry, 'export const plugin = "demo";\n', "utf-8"); - return { externalPluginEntry, externalPluginRoot, fixture, sourceRootAlias }; + return { + externalPluginEntry, + externalPluginRoot, + fixture, + sourceRootAlias, + sourceChannelRuntimePath, + }; } function resolvePluginSdkAlias(params: {