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

推荐订阅源

有赞技术团队
有赞技术团队
G
Google Developers Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
P
Proofpoint News Feed
V
Visual Studio Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 叶小钗
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
H
Help Net Security
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
量子位
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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
refactor: move doctor capabilities to channel manifests ·...
steipete · 2026-04-23 · via Recent Commits to openclaw:main
11

import { getBundledChannelPlugin } from "../../channels/plugins/bundled.js";

22

import { getChannelPlugin } from "../../channels/plugins/index.js";

33

import { normalizeAnyChannelId } from "../../channels/registry.js";

4+

import { findBundledPackageChannelMetadata } from "../../plugins/bundled-package-channel-metadata.js";

5+

import type { PluginPackageChannelDoctorCapabilities } from "../../plugins/manifest.js";

46

import type { AllowFromMode } from "./shared/allow-from-mode.types.js";

5768

export type DoctorGroupModel = "sender" | "route" | "hybrid";

@@ -19,60 +21,46 @@ const DEFAULT_DOCTOR_CHANNEL_CAPABILITIES: DoctorChannelCapabilities = {

1921

warnOnEmptyGroupSenderAllowlist: true,

2022

};

212322-

const STATIC_DOCTOR_CHANNEL_CAPABILITIES: Readonly<Record<string, DoctorChannelCapabilities>> = {

23-

googlechat: {

24-

dmAllowFromMode: "nestedOnly",

25-

groupModel: "route",

26-

groupAllowFromFallbackToAllowFrom: false,

27-

warnOnEmptyGroupSenderAllowlist: false,

28-

},

29-

matrix: {

30-

dmAllowFromMode: "nestedOnly",

31-

groupModel: "sender",

32-

groupAllowFromFallbackToAllowFrom: false,

33-

warnOnEmptyGroupSenderAllowlist: true,

34-

},

35-

msteams: {

36-

dmAllowFromMode: "topOnly",

37-

groupModel: "hybrid",

38-

groupAllowFromFallbackToAllowFrom: false,

39-

warnOnEmptyGroupSenderAllowlist: true,

40-

},

41-

zalouser: {

42-

dmAllowFromMode: "topOnly",

43-

groupModel: "hybrid",

44-

groupAllowFromFallbackToAllowFrom: false,

45-

warnOnEmptyGroupSenderAllowlist: false,

46-

},

47-

};

24+

function mergeDoctorChannelCapabilities(

25+

capabilities?: PluginPackageChannelDoctorCapabilities,

26+

): DoctorChannelCapabilities {

27+

return {

28+

dmAllowFromMode:

29+

capabilities?.dmAllowFromMode ?? DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.dmAllowFromMode,

30+

groupModel: capabilities?.groupModel ?? DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.groupModel,

31+

groupAllowFromFallbackToAllowFrom:

32+

capabilities?.groupAllowFromFallbackToAllowFrom ??

33+

DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.groupAllowFromFallbackToAllowFrom,

34+

warnOnEmptyGroupSenderAllowlist:

35+

capabilities?.warnOnEmptyGroupSenderAllowlist ??

36+

DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.warnOnEmptyGroupSenderAllowlist,

37+

};

38+

}

39+40+

function getManifestDoctorCapabilities(

41+

channelId: string,

42+

): PluginPackageChannelDoctorCapabilities | undefined {

43+

return findBundledPackageChannelMetadata(channelId)?.doctorCapabilities;

44+

}

48454946

export function getDoctorChannelCapabilities(channelName?: string): DoctorChannelCapabilities {

5047

if (!channelName) {

5148

return DEFAULT_DOCTOR_CHANNEL_CAPABILITIES;

5249

}

53-

const staticCapabilities = STATIC_DOCTOR_CHANNEL_CAPABILITIES[channelName];

54-

if (staticCapabilities) {

55-

return staticCapabilities;

50+51+

const manifestCapabilities = getManifestDoctorCapabilities(channelName);

52+

if (manifestCapabilities) {

53+

return mergeDoctorChannelCapabilities(manifestCapabilities);

5654

}

57-

const registeredChannelId = normalizeAnyChannelId(channelName);

58-

if (!registeredChannelId) {

55+56+

const channelId = normalizeAnyChannelId(channelName);

57+

if (!channelId) {

5958

return DEFAULT_DOCTOR_CHANNEL_CAPABILITIES;

6059

}

6160

const pluginDoctor =

62-

getChannelPlugin(registeredChannelId)?.doctor ??

63-

getBundledChannelPlugin(registeredChannelId)?.doctor;

61+

getChannelPlugin(channelId)?.doctor ?? getBundledChannelPlugin(channelId)?.doctor;

6462

if (pluginDoctor) {

65-

return {

66-

dmAllowFromMode:

67-

pluginDoctor.dmAllowFromMode ?? DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.dmAllowFromMode,

68-

groupModel: pluginDoctor.groupModel ?? DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.groupModel,

69-

groupAllowFromFallbackToAllowFrom:

70-

pluginDoctor.groupAllowFromFallbackToAllowFrom ??

71-

DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.groupAllowFromFallbackToAllowFrom,

72-

warnOnEmptyGroupSenderAllowlist:

73-

pluginDoctor.warnOnEmptyGroupSenderAllowlist ??

74-

DEFAULT_DOCTOR_CHANNEL_CAPABILITIES.warnOnEmptyGroupSenderAllowlist,

75-

};

63+

return mergeDoctorChannelCapabilities(pluginDoctor);

7664

}

77-

return DEFAULT_DOCTOR_CHANNEL_CAPABILITIES;

65+

return mergeDoctorChannelCapabilities(getManifestDoctorCapabilities(channelId));

7866

}