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

推荐订阅源

博客园_首页
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
D
Docker
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
腾讯CDC
P
Proofpoint News Feed
A
About on SuperTechFans
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
MyScale Blog
MyScale Blog
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
G
Google Developers Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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(doctor): validate bundled MCP tool schemas · openclaw...
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -7,12 +7,20 @@ import {

77

} from "../agents/model-catalog.js";

88

import { resolveDefaultModelForAgent } from "../agents/model-selection.js";

99

import { supportsModelTools } from "../agents/model-tool-support.js";

10+

import { createBundleMcpToolRuntime } from "../agents/pi-bundle-mcp-tools.js";

11+

import { applyFinalEffectiveToolPolicy } from "../agents/pi-embedded-runner/effective-tool-policy.js";

12+

import { shouldCreateBundleMcpRuntimeForAttempt } from "../agents/pi-embedded-runner/run/attempt-tool-construction-plan.js";

1013

import { createOpenClawCodingTools } from "../agents/pi-tools.js";

1114

import { normalizeAgentRuntimeTools } from "../agents/runtime-plan/tools.js";

1215

import { buildWorkspaceSkillStatus, type SkillStatusEntry } from "../agents/skills-status.js";

13-

import { inspectRuntimeToolInputSchemas } from "../agents/tool-schema-projection.js";

16+

import {

17+

inspectRuntimeToolInputSchemas,

18+

type RuntimeToolSchemaDiagnostic,

19+

} from "../agents/tool-schema-projection.js";

20+

import type { AnyAgentTool } from "../agents/tools/common.js";

1421

import { collectUnavailableAgentSkills } from "../commands/doctor-skills-core.js";

1522

import type { OpenClawConfig } from "../config/types.openclaw.js";

23+

import { formatErrorMessage } from "../infra/errors.js";

1624

import type { ProviderRuntimeModel } from "../plugins/provider-runtime-model.types.js";

1725

import { getPluginToolMeta } from "../plugins/tools.js";

1826

import type { HealthFinding } from "./health-checks.js";

@@ -56,6 +64,100 @@ function buildDoctorRuntimeModel(params: {

5664

} as ProviderRuntimeModel;

5765

}

586667+

function toolSchemaDiagnosticToFinding(params: {

68+

tools: readonly AnyAgentTool[];

69+

diagnostic: RuntimeToolSchemaDiagnostic;

70+

}): HealthFinding {

71+

const tool = params.tools[params.diagnostic.toolIndex];

72+

const pluginId = tool ? getPluginToolMeta(tool)?.pluginId : undefined;

73+

const owner = pluginId ? ` from plugin ${pluginId}` : "";

74+

const path =

75+

pluginId === "bundle-mcp"

76+

? "mcp.servers"

77+

: pluginId

78+

? `plugins.entries.${pluginId}`

79+

: `tools.${params.diagnostic.toolName}`;

80+

const fixHint =

81+

pluginId === "bundle-mcp"

82+

? "Disable or update the offending MCP server/tool so its parameters are a JSON object schema, then rerun doctor."

83+

: "Disable or update the offending plugin/tool so its parameters are a JSON object schema, then rerun doctor.";

84+

return {

85+

checkId: "core/doctor/runtime-tool-schemas",

86+

severity: "error",

87+

message: `Tool ${params.diagnostic.toolName}${owner} has an unsupported input schema for runtime projection.`,

88+

path,

89+

target: params.diagnostic.toolName,

90+

requirement: params.diagnostic.violations.join(", "),

91+

fixHint,

92+

};

93+

}

94+95+

function collectToolSchemaFindings(tools: readonly AnyAgentTool[]): HealthFinding[] {

96+

return inspectRuntimeToolInputSchemas(tools).map((diagnostic) =>

97+

toolSchemaDiagnosticToFinding({

98+

tools,

99+

diagnostic,

100+

}),

101+

);

102+

}

103+104+

async function collectBundleMcpRuntimeToolSchemaFindings(params: {

105+

cfg: OpenClawConfig;

106+

agentId: string;

107+

workspaceDir: string;

108+

modelRef: { provider: string; model: string };

109+

model: ProviderRuntimeModel;

110+

}): Promise<readonly HealthFinding[]> {

111+

if (

112+

!shouldCreateBundleMcpRuntimeForAttempt({

113+

toolsEnabled: true,

114+

})

115+

) {

116+

return [];

117+

}

118+119+

let bundleRuntime: Awaited<ReturnType<typeof createBundleMcpToolRuntime>> | undefined;

120+

try {

121+

bundleRuntime = await createBundleMcpToolRuntime({

122+

workspaceDir: params.workspaceDir,

123+

cfg: params.cfg,

124+

});

125+

const activeBundleTools = applyFinalEffectiveToolPolicy({

126+

bundledTools: bundleRuntime.tools,

127+

config: params.cfg,

128+

agentId: params.agentId,

129+

modelProvider: params.modelRef.provider,

130+

modelId: params.modelRef.model,

131+

warn: () => {},

132+

});

133+

const normalizedTools = normalizeAgentRuntimeTools({

134+

tools: activeBundleTools,

135+

provider: params.modelRef.provider,

136+

config: params.cfg,

137+

workspaceDir: params.workspaceDir,

138+

env: process.env,

139+

modelId: params.modelRef.model,

140+

modelApi: params.model.api,

141+

model: params.model,

142+

});

143+

return collectToolSchemaFindings(normalizedTools);

144+

} catch (error) {

145+

return [

146+

{

147+

checkId: "core/doctor/runtime-tool-schemas",

148+

severity: "error",

149+

message: "Configured MCP tool schema validation could not load the runtime tool set.",

150+

path: "mcp.servers",

151+

requirement: formatErrorMessage(error),

152+

fixHint:

153+

"Fix or disable the offending MCP server, then rerun doctor before relying on assistant tool startup.",

154+

},

155+

];

156+

} finally {

157+

await bundleRuntime?.dispose();

158+

}

159+

}

160+59161

export async function collectRuntimeToolSchemaFindings(

60162

cfg: OpenClawConfig,

61163

): Promise<readonly HealthFinding[]> {

@@ -97,19 +199,14 @@ export async function collectRuntimeToolSchemaFindings(

97199

modelApi: model.api,

98200

model,

99201

});

100-

return inspectRuntimeToolInputSchemas(normalizedTools).map((diagnostic) => {

101-

const tool = normalizedTools[diagnostic.toolIndex];

102-

const pluginId = tool ? getPluginToolMeta(tool)?.pluginId : undefined;

103-

const owner = pluginId ? ` from plugin ${pluginId}` : "";

104-

return {

105-

checkId: "core/doctor/runtime-tool-schemas",

106-

severity: "error",

107-

message: `Tool ${diagnostic.toolName}${owner} has an unsupported input schema for runtime projection.`,

108-

path: pluginId ? `plugins.entries.${pluginId}` : `tools.${diagnostic.toolName}`,

109-

target: diagnostic.toolName,

110-

requirement: diagnostic.violations.join(", "),

111-

fixHint:

112-

"Disable or update the offending plugin/tool so its parameters are a JSON object schema, then rerun doctor.",

113-

} satisfies HealthFinding;

114-

});

202+

return [

203+

...collectToolSchemaFindings(normalizedTools),

204+

...(await collectBundleMcpRuntimeToolSchemaFindings({

205+

cfg,

206+

agentId,

207+

workspaceDir,

208+

modelRef,

209+

model,

210+

})),

211+

];

115212

}