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

推荐订阅源

月光博客
月光博客
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
量子位
Google DeepMind News
Google DeepMind News
I
InfoQ
The GitHub Blog
The GitHub Blog
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
小众软件
小众软件
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
IT之家
IT之家

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(telegram): honor catch-all mentions for captionless m...
IWhatsskill · 2026-05-17 · via Recent Commits to openclaw:main

@@ -130,6 +130,71 @@ describe("resolveTelegramInboundBody", () => {

130130

expect(result?.bodyText).toBe("<media:document> (2 attachments)");

131131

});

132132133+

it("lets catch-all mention patterns activate captionless group photos", async () => {

134+

const logger = { info: vi.fn() };

135+136+

const result = await resolveTelegramBody({

137+

cfg: {

138+

channels: { telegram: {} },

139+

messages: { groupChat: { mentionPatterns: [".*"] } },

140+

} as never,

141+

msg: {

142+

message_id: 6,

143+

date: 1_700_000_006,

144+

chat: { id: -1001234567890, type: "supergroup", title: "Test Group" },

145+

from: { id: 46, first_name: "Eve" },

146+

photo: [{ file_id: "photo-4", file_unique_id: "photo-u4", width: 120, height: 80 }],

147+

entities: [],

148+

} as never,

149+

allMedia: [{ path: "/tmp/photo.webp", contentType: "image/webp" }],

150+

isGroup: true,

151+

chatId: -1001234567890,

152+

senderId: "46",

153+

senderUsername: "",

154+

groupConfig: { requireMention: true } as never,

155+

requireMention: true,

156+

logger,

157+

});

158+159+

expect(logger.info).not.toHaveBeenCalled();

160+

expect(result?.rawBody).toBe("<media:image>");

161+

expect(result?.bodyText).toBe("<media:image>");

162+

expect(result?.effectiveWasMentioned).toBe(true);

163+

});

164+165+

it("keeps captionless group photos quiet for nonmatching mention patterns", async () => {

166+

const logger = { info: vi.fn() };

167+168+

const result = await resolveTelegramBody({

169+

cfg: {

170+

channels: { telegram: {} },

171+

messages: { groupChat: { mentionPatterns: ["\\bbot\\b"] } },

172+

} as never,

173+

msg: {

174+

message_id: 7,

175+

date: 1_700_000_007,

176+

chat: { id: -1001234567890, type: "supergroup", title: "Test Group" },

177+

from: { id: 46, first_name: "Eve" },

178+

photo: [{ file_id: "photo-5", file_unique_id: "photo-u5", width: 120, height: 80 }],

179+

entities: [],

180+

} as never,

181+

allMedia: [{ path: "/tmp/photo.webp", contentType: "image/webp" }],

182+

isGroup: true,

183+

chatId: -1001234567890,

184+

senderId: "46",

185+

senderUsername: "",

186+

groupConfig: { requireMention: true } as never,

187+

requireMention: true,

188+

logger,

189+

});

190+191+

expect(logger.info).toHaveBeenCalledWith(

192+

{ chatId: -1001234567890, reason: "no-mention" },

193+

"skipping group message",

194+

);

195+

expect(result).toBeNull();

196+

});

197+133198

it("does not transcribe group audio for unauthorized senders", async () => {

134199

transcribeFirstAudioMock.mockReset();

135200

const logger = { info: vi.fn() };