惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
美团技术团队
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
Jina AI
Jina AI
D
Docker
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
perf: reduce discord provider test imports · openclaw/ope...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -24,7 +24,6 @@ import {

2424

import type { OpenClawConfig, ReplyToMode } from "openclaw/plugin-sdk/config-runtime";

2525

import { loadConfig } from "openclaw/plugin-sdk/config-runtime";

2626

import { createConnectedChannelStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";

27-

import { getPluginCommandSpecs } from "openclaw/plugin-sdk/plugin-runtime";

2827

import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";

2928

import {

3029

danger,

@@ -110,9 +109,12 @@ type DiscordVoiceManager = import("../voice/manager.js").DiscordVoiceManager;

110109111110

type DiscordVoiceRuntimeModule = typeof import("../voice/manager.runtime.js");

112111

type DiscordProviderSessionRuntimeModule = typeof import("./provider-session.runtime.js");

112+

type GetPluginCommandSpecs =

113+

typeof import("openclaw/plugin-sdk/plugin-runtime").getPluginCommandSpecs;

113114114115

let discordVoiceRuntimePromise: Promise<DiscordVoiceRuntimeModule> | undefined;

115116

let discordProviderSessionRuntimePromise: Promise<DiscordProviderSessionRuntimeModule> | undefined;

117+

let pluginRuntimePromise: Promise<typeof import("openclaw/plugin-sdk/plugin-runtime")> | undefined;

116118117119

let fetchDiscordApplicationIdForTesting: typeof fetchDiscordApplicationId | undefined;

118120

let createDiscordNativeCommandForTesting: typeof createDiscordNativeCommand | undefined;

@@ -130,7 +132,7 @@ let createClientForTesting:

130132

plugins: ConstructorParameters<typeof Client>[2],

131133

) => Client)

132134

| undefined;

133-

let getPluginCommandSpecsForTesting: typeof getPluginCommandSpecs | undefined;

135+

let getPluginCommandSpecsForTesting: GetPluginCommandSpecs | undefined;

134136

let resolveDiscordAccountForTesting: typeof resolveDiscordAccount | undefined;

135137

let resolveNativeCommandsEnabledForTesting: typeof resolveNativeCommandsEnabled | undefined;

136138

let resolveNativeSkillsEnabledForTesting: typeof resolveNativeSkillsEnabled | undefined;

@@ -155,6 +157,11 @@ async function loadDiscordProviderSessionRuntime(): Promise<DiscordProviderSessi

155157

return await discordProviderSessionRuntimePromise;

156158

}

157159160+

async function loadPluginRuntime() {

161+

pluginRuntimePromise ??= import("openclaw/plugin-sdk/plugin-runtime");

162+

return await pluginRuntimePromise;

163+

}

164+158165

function normalizeBooleanForTesting(value: unknown): boolean | undefined {

159166

if (typeof value === "boolean") {

160167

return value;

@@ -178,17 +185,17 @@ function formatThreadBindingDurationForConfigLabel(durationMs: number): string {

178185

return label === "disabled" ? "off" : label;

179186

}

180187181-

function appendPluginCommandSpecs(params: {

188+

async function appendPluginCommandSpecs(params: {

182189

commandSpecs: NativeCommandSpec[];

183190

runtime: RuntimeEnv;

184-

}): NativeCommandSpec[] {

191+

}): Promise<NativeCommandSpec[]> {

185192

const merged = [...params.commandSpecs];

186193

const existingNames = new Set(

187194

merged.map((spec) => normalizeLowercaseStringOrEmpty(spec.name)).filter(Boolean),

188195

);

189-

for (const pluginCommand of (getPluginCommandSpecsForTesting ?? getPluginCommandSpecs)(

190-

"discord",

191-

)) {

196+

const getPluginCommandSpecs =

197+

getPluginCommandSpecsForTesting ?? (await loadPluginRuntime()).getPluginCommandSpecs;

198+

for (const pluginCommand of getPluginCommandSpecs("discord")) {

192199

const normalizedName = normalizeLowercaseStringOrEmpty(pluginCommand.name);

193200

if (!normalizedName) {

194201

continue;

@@ -740,7 +747,7 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {

740747

})

741748

: [];

742749

if (nativeEnabled) {

743-

commandSpecs = appendPluginCommandSpecs({ commandSpecs, runtime });

750+

commandSpecs = await appendPluginCommandSpecs({ commandSpecs, runtime });

744751

}

745752

const initialCommandCount = commandSpecs.length;

746753

if (nativeEnabled && nativeSkillsEnabled && commandSpecs.length > maxDiscordCommands) {

@@ -749,7 +756,7 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {

749756

cfg,

750757

{ skillCommands: [], provider: "discord" },

751758

);

752-

commandSpecs = appendPluginCommandSpecs({ commandSpecs, runtime });

759+

commandSpecs = await appendPluginCommandSpecs({ commandSpecs, runtime });

753760

runtime.log?.(

754761

warn(

755762

`discord: ${initialCommandCount} commands exceeds limit; removing per-skill commands and keeping /skill.`,

@@ -1201,7 +1208,7 @@ export const __testing = {

12011208

) {

12021209

createClientForTesting = mock;

12031210

},

1204-

setGetPluginCommandSpecs(mock?: typeof getPluginCommandSpecs) {

1211+

setGetPluginCommandSpecs(mock?: GetPluginCommandSpecs) {

12051212

getPluginCommandSpecsForTesting = mock;

12061213

},

12071214

setResolveDiscordAccount(mock?: typeof resolveDiscordAccount) {