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

推荐订阅源

B
Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
雷峰网
雷峰网
博客园_首页
WordPress大学
WordPress大学
博客园 - 司徒正美
爱范儿
爱范儿
博客园 - 聂微东
IT之家
IT之家
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
博客园 - Franky
V
V2EX
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志

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
fix(config): cap extension schema payloads · openclaw/ope...
vincentkoc · 2026-05-01 · via Recent Commits to openclaw:main

@@ -138,6 +138,71 @@ export type ChannelUiMetadata = {

138138

configUiHints?: Record<string, ConfigUiHint>;

139139

};

140140141+

const EXTENSION_SCHEMA_MAX_BYTES = 256 * 1024;

142+

const EXTENSION_SCHEMA_TOTAL_MAX_BYTES = 2 * 1024 * 1024;

143+

const EXTENSION_SCHEMA_MAX_ITEMS = 256;

144+145+

function schemaJsonBytes(schema: JsonSchemaNode): number {

146+

try {

147+

return Buffer.byteLength(JSON.stringify(schema), "utf-8");

148+

} catch {

149+

return Number.POSITIVE_INFINITY;

150+

}

151+

}

152+153+

function buildOmittedExtensionConfigSchema(kind: "plugin" | "channel", id: string): JsonSchemaNode {

154+

return {

155+

type: "object",

156+

additionalProperties: true,

157+

description: `${kind} config schema for ${id} was omitted from the full config.schema response because installed extension schemas exceeded the Gateway response budget.`,

158+

};

159+

}

160+161+

function limitExtensionSchemas(params: {

162+

plugins: PluginUiMetadata[];

163+

channels: ChannelUiMetadata[];

164+

}): { plugins: PluginUiMetadata[]; channels: ChannelUiMetadata[] } {

165+

let totalBytes = 0;

166+

let includedItems = 0;

167+168+

const keepSchema = (schema: JsonSchemaNode): boolean => {

169+

const bytes = schemaJsonBytes(schema);

170+

if (

171+

!Number.isFinite(bytes) ||

172+

bytes > EXTENSION_SCHEMA_MAX_BYTES ||

173+

totalBytes + bytes > EXTENSION_SCHEMA_TOTAL_MAX_BYTES ||

174+

includedItems >= EXTENSION_SCHEMA_MAX_ITEMS

175+

) {

176+

return false;

177+

}

178+

totalBytes += bytes;

179+

includedItems += 1;

180+

return true;

181+

};

182+183+

const plugins = params.plugins.map((plugin) => {

184+

if (!plugin.configSchema || keepSchema(plugin.configSchema)) {

185+

return plugin;

186+

}

187+

return {

188+

...plugin,

189+

configSchema: buildOmittedExtensionConfigSchema("plugin", plugin.id),

190+

};

191+

});

192+193+

const channels = params.channels.map((channel) => {

194+

if (!channel.configSchema || keepSchema(channel.configSchema)) {

195+

return channel;

196+

}

197+

return {

198+

...channel,

199+

configSchema: buildOmittedExtensionConfigSchema("channel", channel.id),

200+

};

201+

});

202+203+

return { plugins, channels };

204+

}

205+141206

function collectExtensionHintKeys(

142207

hints: ConfigUiHints,

143208

plugins: PluginUiMetadata[],

@@ -487,8 +552,10 @@ export function buildConfigSchema(params?: {

487552

cache?: boolean;

488553

}): ConfigSchemaResponse {

489554

const base = buildBaseConfigSchema();

490-

const plugins = params?.plugins ?? [];

491-

const channels = params?.channels ?? [];

555+

const { plugins, channels } = limitExtensionSchemas({

556+

plugins: params?.plugins ?? [],

557+

channels: params?.channels ?? [],

558+

});

492559

if (plugins.length === 0 && channels.length === 0) {

493560

return base;

494561

}