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

推荐订阅源

爱范儿
爱范儿
博客园_首页
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
MongoDB | Blog
MongoDB | Blog
美团技术团队
H
Help Net Security
G
Google Developers Blog
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
M
MIT News - Artificial intelligence
腾讯CDC
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
I
InfoQ
博客园 - 司徒正美
A
About on SuperTechFans

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(ui): avoid inline image previews in webchat send (#82...
steipete · 2026-05-16 · via Recent Commits to openclaw:main

@@ -901,6 +901,29 @@ describe("loadChatHistory filtering", () => {

901901

expect(state.chatMessages).toEqual([messages[0], messages[2]]);

902902

});

903903904+

it("keeps image-only user messages that carry transcript media paths", async () => {

905+

const messages = [

906+

{ role: "user", content: "", MediaPath: "/tmp/openclaw/user-upload.png" },

907+

{

908+

role: "user",

909+

content: "",

910+

MediaPaths: ["/tmp/openclaw/first.png", "/tmp/openclaw/second.jpg"],

911+

},

912+

{ role: "user", content: "" },

913+

];

914+

const mockClient = {

915+

request: vi.fn().mockResolvedValue({ messages }),

916+

};

917+

const state = createState({

918+

client: mockClient as unknown as ChatState["client"],

919+

connected: true,

920+

});

921+922+

await loadChatHistory(state);

923+924+

expect(state.chatMessages).toEqual([messages[0], messages[1]]);

925+

});

926+904927

it("keeps a user message even if it matches the synthetic repair text", async () => {

905928

const messages = [

906929

{

@@ -1075,6 +1098,76 @@ describe("sendChatMessage", () => {

10751098

]);

10761099

});

107711001101+

it("sends inline image payloads without copying data URLs into optimistic chat state", async () => {

1102+

const request = vi.fn().mockResolvedValue({ runId: "run-1", status: "started" });

1103+

const state = createState({

1104+

connected: true,

1105+

client: { request } as unknown as ChatState["client"],

1106+

});

1107+

const imageBase64 = "A".repeat(1024 * 1024);

1108+

const imageDataUrl = `data:image/png;base64,${imageBase64}`;

1109+1110+

const result = await sendChatMessage(state, "", [

1111+

{

1112+

id: "att-image",

1113+

dataUrl: imageDataUrl,

1114+

mimeType: "image/png",

1115+

fileName: "photo.png",

1116+

},

1117+

]);

1118+1119+

expect(result).toMatch(UUID_V4_RE);

1120+

expect(request).toHaveBeenCalledTimes(1);

1121+

const [requestMethod, requestParams] = requireFirstRequestCall(request);

1122+

expect(requestMethod).toBe("chat.send");

1123+

const sendParams = requireRecord(requestParams);

1124+

expect(sendParams.message).toBe("");

1125+

expect(sendParams.attachments).toEqual([

1126+

{

1127+

type: "image",

1128+

mimeType: "image/png",

1129+

fileName: "photo.png",

1130+

content: imageBase64,

1131+

},

1132+

]);

1133+

expect(state.chatMessages).toStrictEqual([

1134+

{

1135+

role: "user",

1136+

content: [{ type: "text", text: "Attached image: photo.png" }],

1137+

timestamp: expect.any(Number),

1138+

},

1139+

]);

1140+

expect(JSON.stringify(state.chatMessages)).not.toContain("data:image/png;base64");

1141+1142+

const captionedRequest = vi.fn().mockResolvedValue({ runId: "run-2", status: "started" });

1143+

const captionedState = createState({

1144+

connected: true,

1145+

client: { request: captionedRequest } as unknown as ChatState["client"],

1146+

});

1147+1148+

await expect(

1149+

sendChatMessage(captionedState, "describe", [

1150+

{

1151+

id: "att-captioned-image",

1152+

dataUrl: imageDataUrl,

1153+

mimeType: "image/png",

1154+

fileName: "photo.png",

1155+

},

1156+

]),

1157+

).resolves.toMatch(UUID_V4_RE);

1158+

expect(captionedState.chatMessages).toStrictEqual([

1159+

{

1160+

role: "user",

1161+

content: [

1162+

{ type: "text", text: "describe" },

1163+

{ type: "text", text: "Attached image: photo.png" },

1164+

],

1165+

timestamp: expect.any(Number),

1166+

},

1167+

]);

1168+

expect(JSON.stringify(captionedState.chatMessages)).not.toContain("data:image/png;base64");

1169+

});

1170+10781171

it("formats structured non-auth connect failures for chat send", async () => {

10791172

const request = vi.fn().mockRejectedValue(

10801173

new GatewayRequestError({