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

推荐订阅源

I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
B
Blog
罗磊的独立博客
GbyAI
GbyAI
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
The GitHub Blog
The GitHub Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 聂微东
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏

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(slack): share HTTP route registry across module loads...
steipete · 2026-04-25 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -65,6 +65,7 @@ Docs: https://docs.openclaw.ai

6565

- Codex harness/models: keep legacy `codex/*` harness shorthand out of model picker and `/models` choice surfaces while migrating primary legacy refs to canonical `openai/*` plus explicit Codex harness config. (#71193) Thanks @vincentkoc.

6666

- Plugins/runtime deps: respect explicit plugin and channel disablement when repairing bundled runtime dependencies, so doctor and health checks no longer install deps for disabled configured channels.

6767

- WhatsApp/plugins: support an explicit opt-in for inbound `message_received` hooks with canonical channel, conversation, session, and sender fields. Thanks @vincentkoc.

68+

- Slack/HTTP: keep webhook handlers in a process-global registry so HTTP mode survives plugin-loader/native-import splits and `/slack/events/<account>` no longer returns 404 after logging as active. Fixes #67955, #46245, and #46246. Thanks @chrisabad and @cesararevalo.

6869

- Diagnostics: harden tool and model diagnostic events against hostile errors, blocking listeners, and unsafe stability reason fields. Thanks @vincentkoc.

6970

- Plugins/onboarding: record local plugin install source metadata without duplicating raw absolute local paths in persisted `plugins.installs`, while preserving linked load-path cleanup. (#70970) Thanks @vincentkoc.

7071

- Browser/tool: tell agents not to pass per-call `timeoutMs` on existing-session type, evaluate, and other Chrome MCP actions that reject timeout overrides.

Original file line numberDiff line numberDiff line change

@@ -85,4 +85,43 @@ describe("registerSlackHttpHandler", () => {

8585

'slack: webhook path /slack/events already registered for account "duplicate"',

8686

);

8787

});

88+
89+

it("preserves registered handlers across module reloads", async () => {

90+

const handler = vi.fn();

91+

unregisters.push(

92+

registerSlackHttpHandler({

93+

path: "/slack/events/reload",

94+

handler,

95+

}),

96+

);

97+
98+

vi.resetModules();

99+

const reloadedRegistry = await import("./registry.js");

100+

const req = { url: "/slack/events/reload" } as IncomingMessage;

101+

const res = {} as ServerResponse;

102+
103+

const handled = await reloadedRegistry.handleSlackHttpRequest(req, res);

104+
105+

expect(handled).toBe(true);

106+

expect(handler).toHaveBeenCalledWith(req, res);

107+

});

108+
109+

it("recreates the shared registry if the global slot is corrupted", async () => {

110+

const globalStore = globalThis as Record<PropertyKey, unknown>;

111+

globalStore[Symbol.for("openclaw.slack.httpRoutes.v1")] = {};

112+

const handler = vi.fn();

113+

unregisters.push(

114+

registerSlackHttpHandler({

115+

path: "/slack/events/recovered",

116+

handler,

117+

}),

118+

);

119+

const req = { url: "/slack/events/recovered" } as IncomingMessage;

120+

const res = {} as ServerResponse;

121+
122+

const handled = await handleSlackHttpRequest(req, res);

123+
124+

expect(handled).toBe(true);

125+

expect(handler).toHaveBeenCalledWith(req, res);

126+

});

88127

});

Original file line numberDiff line numberDiff line change

@@ -15,18 +15,30 @@ type RegisterSlackHttpHandlerArgs = {

1515

accountId?: string;

1616

};

1717
18-

const slackHttpRoutes = new Map<string, SlackHttpRequestHandler>();

18+

const SLACK_HTTP_ROUTES_GLOBAL_KEY = Symbol.for("openclaw.slack.httpRoutes.v1");

19+
20+

function getSlackHttpRoutes(): Map<string, SlackHttpRequestHandler> {

21+

const globalStore = globalThis as Record<PropertyKey, unknown>;

22+

const existing = globalStore[SLACK_HTTP_ROUTES_GLOBAL_KEY];

23+

if (existing instanceof Map) {

24+

return existing as Map<string, SlackHttpRequestHandler>;

25+

}

26+

const routes = new Map<string, SlackHttpRequestHandler>();

27+

globalStore[SLACK_HTTP_ROUTES_GLOBAL_KEY] = routes;

28+

return routes;

29+

}

1930
2031

export function registerSlackHttpHandler(params: RegisterSlackHttpHandlerArgs): () => void {

2132

const normalizedPath = normalizeSlackWebhookPath(params.path);

22-

if (slackHttpRoutes.has(normalizedPath)) {

33+

const routes = getSlackHttpRoutes();

34+

if (routes.has(normalizedPath)) {

2335

const suffix = params.accountId ? ` for account "${params.accountId}"` : "";

2436

params.log?.(`slack: webhook path ${normalizedPath} already registered${suffix}`);

2537

return () => {};

2638

}

27-

slackHttpRoutes.set(normalizedPath, params.handler);

39+

routes.set(normalizedPath, params.handler);

2840

return () => {

29-

slackHttpRoutes.delete(normalizedPath);

41+

getSlackHttpRoutes().delete(normalizedPath);

3042

};

3143

}

3244

@@ -35,7 +47,7 @@ export async function handleSlackHttpRequest(

3547

res: ServerResponse,

3648

): Promise<boolean> {

3749

const url = new URL(req.url ?? "/", "http://localhost");

38-

const handler = slackHttpRoutes.get(url.pathname);

50+

const handler = getSlackHttpRoutes().get(url.pathname);

3951

if (!handler) {

4052

return false;

4153

}