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

推荐订阅源

The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
D
Docker
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
IT之家
IT之家
MyScale Blog
MyScale 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
fix(doctor): warn routed agents missing message tool · op...
stainlu · 2026-05-11 · via Recent Commits to openclaw:main

@@ -1,12 +1,18 @@

1+

import { resolveAgentConfig, resolveDefaultAgentId } from "../../../agents/agent-scope-config.js";

12

import { pickSandboxToolPolicy } from "../../../agents/sandbox-tool-policy.js";

23

import { isToolAllowedByPolicies } from "../../../agents/tool-policy-match.js";

34

import { mergeAlsoAllowPolicy, resolveToolProfilePolicy } from "../../../agents/tool-policy.js";

5+

import { listRouteBindings } from "../../../config/bindings.js";

6+

import type { AgentRouteBinding } from "../../../config/types.agents.js";

47

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

58

import type { AgentToolsConfig, ToolsConfig } from "../../../config/types.tools.js";

9+

import { normalizeAgentId } from "../../../routing/session-key.js";

610

import { createLazyImportLoader } from "../../../shared/lazy-promise.js";

711812

type ChannelDoctorModule = typeof import("./channel-doctor.js");

91314+

const CHANNELS_CONFIG_META_KEYS = new Set(["defaults", "modelByChannel"]);

15+1016

const channelDoctorModuleLoader = createLazyImportLoader<ChannelDoctorModule>(

1117

() => import("./channel-doctor.js"),

1218

);

@@ -27,6 +33,21 @@ function hasChannels(cfg: OpenClawConfig): boolean {

2733

return hasRecord(cfg.channels);

2834

}

293536+

function listConfiguredChannelIds(cfg: OpenClawConfig): string[] {

37+

if (!hasRecord(cfg.channels)) {

38+

return [];

39+

}

40+

return Object.entries(cfg.channels)

41+

.filter(([id, value]) => {

42+

if (CHANNELS_CONFIG_META_KEYS.has(id)) {

43+

return false;

44+

}

45+

return !(hasRecord(value) && value.enabled === false);

46+

})

47+

.map(([id]) => id)

48+

.toSorted();

49+

}

50+3051

function hasPlugins(cfg: OpenClawConfig): boolean {

3152

return hasRecord(cfg.plugins);

3253

}

@@ -191,6 +212,70 @@ export function collectVisibleReplyToolPolicyWarnings(cfg: OpenClawConfig): stri

191212

return warnings;

192213

}

193214215+

function formatChannelList(channels: string[]): string {

216+

if (channels.length <= 2) {

217+

return channels.map((channel) => `"${channel}"`).join(" and ");

218+

}

219+

return `${channels

220+

.slice(0, 2)

221+

.map((channel) => `"${channel}"`)

222+

.join(", ")}, and ${channels.length - 2} more`;

223+

}

224+225+

function collectBoundChannelTargets(cfg: OpenClawConfig): Array<{

226+

agentId: string;

227+

channels: string[];

228+

}> {

229+

const byAgent = new Map<string, Set<string>>();

230+

const add = (agentId: string, channel: string) => {

231+

const normalizedAgentId = normalizeAgentId(agentId);

232+

const trimmedChannel = channel.trim();

233+

if (!normalizedAgentId || !trimmedChannel) {

234+

return;

235+

}

236+

let channels = byAgent.get(normalizedAgentId);

237+

if (!channels) {

238+

channels = new Set<string>();

239+

byAgent.set(normalizedAgentId, channels);

240+

}

241+

channels.add(trimmedChannel);

242+

};

243+244+

const routeBindings: AgentRouteBinding[] = listRouteBindings(cfg);

245+

for (const binding of routeBindings) {

246+

add(binding.agentId, binding.match.channel);

247+

}

248+249+

if (routeBindings.length === 0) {

250+

const defaultAgentId = resolveDefaultAgentId(cfg);

251+

for (const channel of listConfiguredChannelIds(cfg)) {

252+

add(defaultAgentId, channel);

253+

}

254+

}

255+256+

return Array.from(byAgent.entries())

257+

.map(([agentId, channels]) => ({

258+

agentId,

259+

channels: Array.from(channels).toSorted(),

260+

}))

261+

.filter((target) => target.channels.length > 0)

262+

.toSorted((a, b) => a.agentId.localeCompare(b.agentId));

263+

}

264+265+

export function collectChannelBoundMessageToolPolicyWarnings(cfg: OpenClawConfig): string[] {

266+

return collectBoundChannelTargets(cfg).flatMap((target) => {

267+

const agentTools = resolveAgentConfig(cfg, target.agentId)?.tools;

268+

if (resolveMessageToolAvailability({ globalTools: cfg.tools, agentTools })) {

269+

return [];

270+

}

271+

return [

272+

`- Agent "${target.agentId}" is routed from channel ${formatChannelList(

273+

target.channels,

274+

)}, but the message tool is unavailable for that agent; explicit channel actions such as sendAttachment, upload-file, thread-reply, or reply can fail. Add "message" to the agent tool allowlist, add "group:messaging", or switch the agent to a profile that includes messaging tools.`,

275+

];

276+

});

277+

}

278+194279

export async function collectDoctorPreviewWarnings(params: {

195280

cfg: OpenClawConfig;

196281

doctorFixCommand: string;

@@ -202,6 +287,7 @@ export async function collectDoctorPreviewWarnings(params: {

202287

const hasPluginConfig = hasPlugins(params.cfg);

203288204289

warnings.push(...collectVisibleReplyToolPolicyWarnings(params.cfg));

290+

warnings.push(...collectChannelBoundMessageToolPolicyWarnings(params.cfg));

205291206292

const channelPluginRuntime =

207293

hasChannelConfig && hasExplicitChannelPluginBlockerConfig(params.cfg)