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

推荐订阅源

Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
罗磊的独立博客
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
J
Java Code Geeks
L
LangChain Blog
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers 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(slack): ignore duplicate reaction adds · openclaw/ope...
steipete · 2026-04-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

2424

### Fixes

2525
2626

- Models/UI: hide unauthenticated providers from the default Web chat, `/models`, and model setup pickers while keeping explicit full-catalog browse paths through `view: "all"`, `/models <provider> all`, and `models list --all`. Fixes #74423. Thanks @guarismo and @SymbolStar.

27+

- Slack/reactions: treat duplicate `already_reacted` responses as idempotent success so repeated agent reaction adds no longer surface as tool failures. Fixes #69005. Thanks @shipitsteven and @martingarramon.

2728

- Slack/tools: expose `fileId` in the shared message tool schema so `download-file` can receive Slack attachment IDs from inbound placeholders. Fixes #45574. Thanks @chadvegas.

2829

- Exec: reject invalid per-call `host` values instead of silently falling back to the default target, so hostname-like values fail before commands run. Fixes #74426. Thanks @scr00ge-00 and @vyctorbrzezowski.

2930

- Google/Gemini: send non-empty placeholder content when a Gemini run is triggered with empty or filtered user content, avoiding `contents is not specified` API errors. Thanks @CaoYuhaoCarl.

Original file line numberDiff line numberDiff line change

@@ -115,7 +115,7 @@ describe("handleSlackAction", () => {

115115

{ name: "raw channel id", channelId: "C1" },

116116

{ name: "channel: prefixed id", channelId: "channel:C1" },

117117

])("adds reactions for $name", async ({ channelId }) => {

118-

await handleSlackAction(

118+

const result = await handleSlackAction(

119119

{

120120

action: "react",

121121

channelId,

@@ -130,6 +130,10 @@ describe("handleSlackAction", () => {

130130

"✅",

131131

expect.objectContaining({ cfg: expect.any(Object) }),

132132

);

133+

expect(JSON.parse((result.content?.[0] as { type: "text"; text: string }).text)).toEqual({

134+

ok: true,

135+

added: "✅",

136+

});

133137

});

134138
135139

it("removes reactions on empty emoji", async () => {

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,60 @@

1+

import type { WebClient } from "@slack/web-api";

2+

import { describe, expect, it, vi } from "vitest";

3+

import { reactSlackMessage } from "./actions.js";

4+
5+

function createClient() {

6+

return {

7+

reactions: {

8+

add: vi.fn(async () => ({})),

9+

},

10+

} as unknown as WebClient & {

11+

reactions: {

12+

add: ReturnType<typeof vi.fn>;

13+

};

14+

};

15+

}

16+
17+

function slackPlatformError(error: string) {

18+

return Object.assign(new Error(`An API error occurred: ${error}`), {

19+

data: {

20+

ok: false,

21+

error,

22+

},

23+

});

24+

}

25+
26+

describe("reactSlackMessage", () => {

27+

it("treats already_reacted as idempotent success", async () => {

28+

const client = createClient();

29+

client.reactions.add.mockRejectedValueOnce(slackPlatformError("already_reacted"));

30+
31+

await expect(

32+

reactSlackMessage("C1", "123.456", ":white_check_mark:", {

33+

client,

34+

token: "xoxb-test",

35+

}),

36+

).resolves.toBeUndefined();

37+
38+

expect(client.reactions.add).toHaveBeenCalledWith({

39+

channel: "C1",

40+

timestamp: "123.456",

41+

name: "white_check_mark",

42+

});

43+

});

44+
45+

it("propagates unrelated reaction add errors", async () => {

46+

const client = createClient();

47+

client.reactions.add.mockRejectedValueOnce(slackPlatformError("invalid_name"));

48+
49+

await expect(

50+

reactSlackMessage("C1", "123.456", "not-an-emoji", {

51+

client,

52+

token: "xoxb-test",

53+

}),

54+

).rejects.toMatchObject({

55+

data: {

56+

error: "invalid_name",

57+

},

58+

});

59+

});

60+

});

Original file line numberDiff line numberDiff line change

@@ -77,6 +77,17 @@ function normalizeEmoji(raw: string) {

7777

return trimmed.replace(/^:+|:+$/g, "");

7878

}

7979
80+

function hasSlackPlatformError(err: unknown, code: string): boolean {

81+

if (!err || typeof err !== "object") {

82+

return false;

83+

}

84+

const data = (err as { data?: unknown }).data;

85+

if (!data || typeof data !== "object") {

86+

return false;

87+

}

88+

return (data as { error?: unknown }).error === code;

89+

}

90+
8091

async function getClient(opts: SlackActionClientOpts = {}, mode: "read" | "write" = "read") {

8192

if (opts.client) {

8293

return opts.client;

@@ -100,11 +111,18 @@ export async function reactSlackMessage(

100111

opts: SlackActionClientOpts = {},

101112

) {

102113

const client = await getClient(opts, "write");

103-

await client.reactions.add({

104-

channel: channelId,

105-

timestamp: messageId,

106-

name: normalizeEmoji(emoji),

107-

});

114+

try {

115+

await client.reactions.add({

116+

channel: channelId,

117+

timestamp: messageId,

118+

name: normalizeEmoji(emoji),

119+

});

120+

} catch (err) {

121+

if (hasSlackPlatformError(err, "already_reacted")) {

122+

return;

123+

}

124+

throw err;

125+

}

108126

}

109127
110128

export async function removeSlackReaction(