refactor: route channel activity through channel runtime

This commit is contained in:
Peter Steinberger
2026-03-28 02:52:16 +00:00
parent 684a1565a9
commit 491969efb0
11 changed files with 22 additions and 11 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -5,12 +5,12 @@ import {
resolveInboundSessionEnvelopeContext,
toLocationContext,
} from "openclaw/plugin-sdk/channel-inbound";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import {
recordInboundSession,
resolvePinnedMainDmOwnerFromAllowlist,
} from "openclaw/plugin-sdk/conversation-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import type { HistoryEntry } from "openclaw/plugin-sdk/reply-history";
import { finalizeInboundContext } from "openclaw/plugin-sdk/reply-runtime";
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
+1 -1
View File
@@ -59,7 +59,7 @@ vi.mock("./channel-access-token.js", () => ({
resolveLineChannelAccessToken: resolveLineChannelAccessTokenMock,
}));
vi.mock("openclaw/plugin-sdk/infra-runtime", () => ({
vi.mock("openclaw/plugin-sdk/channel-runtime", () => ({
recordChannelActivity: recordChannelActivityMock,
}));
+1 -1
View File
@@ -1,6 +1,6 @@
import { messagingApi } from "@line/bot-sdk";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
import { loadConfig, type OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import { resolveLineAccount } from "./accounts.js";
import { resolveLineChannelAccessToken } from "./channel-access-token.js";
@@ -5,10 +5,10 @@ import {
type StatusReactionController,
} from "openclaw/plugin-sdk/channel-feedback";
import { logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
import { loadConfig } from "openclaw/plugin-sdk/config-runtime";
import type { TelegramDirectConfig, TelegramGroupConfig } from "openclaw/plugin-sdk/config-runtime";
import { ensureConfiguredBindingRouteReady } from "openclaw/plugin-sdk/conversation-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { deriveLastRoutePolicy } from "openclaw/plugin-sdk/routing";
import { DEFAULT_ACCOUNT_ID, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
+1 -1
View File
@@ -6,9 +6,9 @@ import type {
} from "@grammyjs/types";
import { type ApiClientOptions, Bot, HttpError } from "grammy";
import * as grammy from "grammy";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
import { loadConfig } from "openclaw/plugin-sdk/config-runtime";
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/config-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { isDiagnosticFlagEnabled } from "openclaw/plugin-sdk/infra-runtime";
import { formatUncaughtError } from "openclaw/plugin-sdk/infra-runtime";
import { createTelegramRetryRunner } from "openclaw/plugin-sdk/infra-runtime";
+1 -1
View File
@@ -1,7 +1,7 @@
import type { AnyMessageContent, proto, WAMessage } from "@whiskeysockets/baileys";
import { DisconnectReason, isJidGroup } from "@whiskeysockets/baileys";
import { createInboundDebouncer, formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
import { saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
import { logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
@@ -3,8 +3,8 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
const recordChannelActivity = vi.hoisted(() => vi.fn());
let createWebSendApi: typeof import("./send-api.js").createWebSendApi;
vi.mock("openclaw/plugin-sdk/infra-runtime", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/infra-runtime")>();
vi.mock("openclaw/plugin-sdk/channel-runtime", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/channel-runtime")>();
return {
...actual,
recordChannelActivity: (...args: unknown[]) => recordChannelActivity(...args),
+1 -1
View File
@@ -1,5 +1,5 @@
import type { AnyMessageContent, WAPresence } from "@whiskeysockets/baileys";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
import { toWhatsappJid } from "openclaw/plugin-sdk/text-runtime";
import type { ActiveWebSendOptions } from "../active-listener.js";
+1
View File
@@ -11,6 +11,7 @@ export * from "../channels/plugins/normalize/whatsapp.js";
export * from "../channels/plugins/outbound/interactive.js";
export * from "../channels/plugins/whatsapp-heartbeat.js";
export * from "../polls.js";
export { recordChannelActivity } from "../infra/channel-activity.js";
export {
isWhatsAppGroupJid,
isWhatsAppUserTarget,