refactor: share channel runtime state defaults

This commit is contained in:
Peter Steinberger
2026-03-22 23:11:37 +00:00
parent 023394bc0b
commit 4cc0d05cfb
15 changed files with 52 additions and 109 deletions

View File

@@ -5,6 +5,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { createChatChannelPlugin, type ChannelPlugin } from "openclaw/plugin-sdk/core";
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
import { createRuntimeOutboundDelegates } from "openclaw/plugin-sdk/outbound-runtime";
import { createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
import { buildComputedAccountStatusSnapshot } from "../api.js";
import { tlonChannelConfigSchema } from "./config-schema.js";
import { resolveTlonOutboundSessionRoute } from "./session-route.js";
@@ -109,13 +110,7 @@ export const tlonPlugin = createChatChannelPlugin({
resolveOutboundSessionRoute: (params) => resolveTlonOutboundSessionRoute(params),
},
status: {
defaultRuntime: {
accountId: DEFAULT_ACCOUNT_ID,
running: false,
lastStartAt: null,
lastStopAt: null,
lastError: null,
},
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID),
collectStatusIssues: (accounts) => {
return accounts.flatMap((account) => {
if (!account.configured) {