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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
T
Tailwind CSS Blog
V
Visual Studio Blog
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
量子位
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
Jina AI
Jina AI
雷峰网
雷峰网
博客园 - 【当耐特】
博客园 - 叶小钗
美团技术团队
宝玉的分享
宝玉的分享
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(bluebubbles): apply cross-chat guard to full message ...
2026-04-29 · via Recent Commits to openclaw:main

@@ -148,17 +148,107 @@ describe("resolveBlueBubblesMessageId chat-scoped short-id guard", () => {

148148

).toThrow(/different chat/);

149149

});

150150151-

it("accepts a full uuid input unchanged regardless of chat context", () => {

152-

// Non-numeric input is treated as a full GUID already; the guard does

153-

// not apply. Callers supplying the full GUID have presumably resolved

154-

// the chat themselves.

151+

it("passes a full uuid through unchanged when not in the reply cache", () => {

152+

// Cache miss falls through. Callers supplying a GUID that the cache

153+

// hasn't observed get the input back so fresh-from-the-wire GUIDs

154+

// (e.g. from a `find` API call) still work.

155155

const resolved = resolveBlueBubblesMessageId("1E7E6B6A-0000-4C6C-BCA7-000000000001", {

156156

requireKnownShortId: true,

157157

chatContext: { chatGuid: "iMessage;+;anything" },

158158

});

159159

expect(resolved).toBe("1E7E6B6A-0000-4C6C-BCA7-000000000001");

160160

});

161161162+

it("passes a full uuid through unchanged when caller supplies no chat context", () => {

163+

// Belt-and-braces: even when the cache knows the GUID, callers that

164+

// can't supply any chat hint at all (legacy tool invocations) fall

165+

// through to preserve prior behavior.

166+

seedMessage({

167+

accountId: "default",

168+

messageId: "uuid-known",

169+

chatGuid: "iMessage;+;chat240698944142298252",

170+

});

171+

expect(resolveBlueBubblesMessageId("uuid-known")).toBe("uuid-known");

172+

expect(resolveBlueBubblesMessageId("uuid-known", { chatContext: {} })).toBe("uuid-known");

173+

});

174+175+

it("accepts a full uuid that points at a same-chat cached entry", () => {

176+

seedMessage({

177+

accountId: "default",

178+

messageId: "uuid-in-group",

179+

chatGuid: "iMessage;+;chat240698944142298252",

180+

});

181+182+

const resolved = resolveBlueBubblesMessageId("uuid-in-group", {

183+

chatContext: { chatGuid: "iMessage;+;chat240698944142298252" },

184+

});

185+

expect(resolved).toBe("uuid-in-group");

186+

});

187+188+

it("REJECTS a full uuid that points at a different chat in the cache", () => {

189+

// Candidate-1 regression: the previous implementation only ran the

190+

// cross-chat guard on numeric short ids. After the short-id guard

191+

// landed, agents that retried with a full GUID (because the short id

192+

// got rejected) silently bypassed the check. Group GUIDs reused in

193+

// DM tool calls again leaked group reactions into DMs.

194+

seedMessage({

195+

accountId: "default",

196+

messageId: "uuid-in-group",

197+

chatGuid: "iMessage;+;chat240698944142298252",

198+

});

199+200+

expect(() =>

201+

resolveBlueBubblesMessageId("uuid-in-group", {

202+

chatContext: { chatGuid: "iMessage;-;+8618621181874" },

203+

}),

204+

).toThrow(/different chat/);

205+

});

206+207+

it("uuid-path error message hints at fixing the chat target, not the id format", () => {

208+

// The short-id error tells the agent to retry with the full GUID.

209+

// For UUID input that's already failed, advising "use the full GUID"

210+

// would be wrong — the agent already supplied one. Make the

211+

// remediation hint differ so a retrying agent is steered toward

212+

// fixing the chat target.

213+

seedMessage({

214+

accountId: "default",

215+

messageId: "uuid-in-group",

216+

chatGuid: "iMessage;+;chat240698944142298252",

217+

});

218+219+

try {

220+

resolveBlueBubblesMessageId("uuid-in-group", {

221+

chatContext: { chatGuid: "iMessage;-;+8618621181874" },

222+

});

223+

expect.fail("expected cross-chat guard to throw");

224+

} catch (err) {

225+

const message = err instanceof Error ? err.message : String(err);

226+

expect(message).toContain("iMessage;+;chat240698944142298252");

227+

expect(message).toContain("iMessage;-;+8618621181874");

228+

expect(message).toContain("correct chat target");

229+

expect(message).not.toContain("Retry with the full message GUID");

230+

}

231+

});

232+233+

it("applies the chatIdentifier fallback to full uuid input as well", () => {

234+

// Same handle-only-caller scenario as the short-id case: a tool

235+

// invocation might only resolve the chatIdentifier (the bare handle).

236+

// The guard must catch GUID reuse across mismatched chatIdentifiers

237+

// even when the caller has no chatGuid hint.

238+

seedMessage({

239+

accountId: "default",

240+

messageId: "uuid-in-group",

241+

chatGuid: "iMessage;+;chat240698944142298252",

242+

chatIdentifier: "chat240698944142298252",

243+

});

244+245+

expect(() =>

246+

resolveBlueBubblesMessageId("uuid-in-group", {

247+

chatContext: { chatIdentifier: "+8618621181874" },

248+

}),

249+

).toThrow(/different chat/);

250+

});

251+162252

it("reports the conflicting chats in the error message for debugability", () => {

163253

const entry = seedMessage({

164254

accountId: "default",