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

推荐订阅源

爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
Y
Y Combinator Blog
I
InfoQ
美团技术团队
罗磊的独立博客
B
Blog RSS Feed
GbyAI
GbyAI
小众软件
小众软件
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Blog — PlanetScale
Blog — PlanetScale
V
V2EX
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
MyScale Blog
MyScale Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss

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): enforce resolved runtime channel config · op...
steipete · 2026-04-22 · via Recent Commits to openclaw:main

@@ -0,0 +1,104 @@

1+

#!/usr/bin/env node

2+

import fs from "node:fs";

3+

import path from "node:path";

4+5+

const repoRoot = path.resolve(new URL("..", import.meta.url).pathname);

6+7+

const CHANNEL_EXTENSION_IDS = new Set([

8+

"discord",

9+

"imessage",

10+

"irc",

11+

"line",

12+

"matrix",

13+

"mattermost",

14+

"nextcloud-talk",

15+

"signal",

16+

"slack",

17+

"telegram",

18+

"whatsapp",

19+

]);

20+21+

const HELPER_BASENAME_PATTERNS = [

22+

/^action-runtime\.ts$/,

23+

/^actions(?:\..*)?\.ts$/,

24+

/^active-listener\.ts$/,

25+

/^access-control\.ts$/,

26+

/^channel\.ts$/,

27+

/^client(?:[-.].*)?\.ts$/,

28+

/^recipient-resolution\.ts$/,

29+

/^rich-menu\.ts$/,

30+

/^send(?:[-.].*)?\.ts$/,

31+

/^sent-message-cache\.ts$/,

32+

/^thread-bindings\.ts$/,

33+

];

34+35+

const FORBIDDEN_PATTERNS = [/\bloadConfig\s*\(/, /\.config\.loadConfig\s*\(/];

36+37+

function* walk(dir) {

38+

for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {

39+

if (entry.name === "node_modules" || entry.name === "dist") {

40+

continue;

41+

}

42+

const absolute = path.join(dir, entry.name);

43+

if (entry.isDirectory()) {

44+

yield* walk(absolute);

45+

continue;

46+

}

47+

yield absolute;

48+

}

49+

}

50+51+

function isCandidate(relativePath) {

52+

const parts = relativePath.split(path.sep);

53+

if (parts[0] !== "extensions" || parts[2] !== "src") {

54+

return false;

55+

}

56+

if (!CHANNEL_EXTENSION_IDS.has(parts[1])) {

57+

return false;

58+

}

59+

if (

60+

relativePath.endsWith(".test.ts") ||

61+

relativePath.endsWith(".test-harness.ts") ||

62+

relativePath.endsWith(".d.ts")

63+

) {

64+

return false;

65+

}

66+

if (parts.includes("monitor") || parts.includes("cli")) {

67+

return false;

68+

}

69+

if (parts.includes("actions")) {

70+

return true;

71+

}

72+

const basename = path.basename(relativePath);

73+

return HELPER_BASENAME_PATTERNS.some((pattern) => pattern.test(basename));

74+

}

75+76+

function main() {

77+

const violations = [];

78+

for (const absolute of walk(path.join(repoRoot, "extensions"))) {

79+

const relativePath = path.relative(repoRoot, absolute);

80+

if (!isCandidate(relativePath)) {

81+

continue;

82+

}

83+

const lines = fs.readFileSync(absolute, "utf8").split(/\r?\n/);

84+

lines.forEach((line, index) => {

85+

if (FORBIDDEN_PATTERNS.some((pattern) => pattern.test(line))) {

86+

violations.push(`${relativePath}:${index + 1}: ${line.trim()}`);

87+

}

88+

});

89+

}

90+

if (violations.length === 0) {

91+

return;

92+

}

93+

console.error(

94+

[

95+

"Runtime channel send/action/client/pairing helpers must not call loadConfig().",

96+

"Load and resolve config at the command/gateway/monitor boundary, then pass cfg through.",

97+

"",

98+

...violations,

99+

].join("\n"),

100+

);

101+

process.exitCode = 1;

102+

}

103+104+

main();