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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
U
Unit 42
M
MIT News - Artificial intelligence
小众软件
小众软件
P
Proofpoint News Feed
雷峰网
雷峰网
L
LangChain Blog
S
SegmentFault 最新的问题
腾讯CDC
F
Fortinet All Blogs
A
About on SuperTechFans
WordPress大学
WordPress大学
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
Recent Announcements
Recent Announcements
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow 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(gateway): preserve err.stack when chat.send/agent att...
clawsweeper · 2026-05-03 · via Recent Commits to openclaw:main

@@ -417,6 +417,7 @@ function createChatContext(): Pick<

417417

logGateway: {

418418

warn: vi.fn(),

419419

debug: vi.fn(),

420+

error: vi.fn(),

420421

} as unknown as GatewayRequestContext["logGateway"],

421422

};

422423

}

@@ -2772,9 +2773,12 @@ describe("chat directive tag stripping for non-streaming final payloads", () =>

27722773

{ path: "/home/user/.openclaw/media/inbound/report.pdf", contentType: "application/pdf" },

27732774

];

27742775

mockState.sandboxWorkspace = { workspaceDir: "/sandbox/workspace" };

2775-

mockState.stageSandboxMediaError = Object.assign(new Error("ENOSPC: no space left on device"), {

2776+

const stageError = Object.assign(new Error("ENOSPC: no space left on device"), {

27762777

code: "ENOSPC",

27772778

});

2779+

stageError.stack =

2780+

"Error: ENOSPC: no space left on device\n at stageSandboxMedia (stage-sandbox-media.ts:1:1)";

2781+

mockState.stageSandboxMediaError = stageError;

27782782

const respond = vi.fn();

27792783

const context = createChatContext();

27802784

const pdf = Buffer.from("%PDF-1.4\n%µ¶\n1 0 obj\n<<>>\nendobj\n").toString("base64");

@@ -2808,10 +2812,68 @@ describe("chat directive tag stripping for non-streaming final payloads", () =>

28082812

expect(payload).toBeUndefined();

28092813

expect(error?.code).toBe(ErrorCodes.UNAVAILABLE);

28102814

expect(error?.message ?? String(error)).toMatch(/ENOSPC|non-image attachments/i);

2815+

expect(context.logGateway.error).toHaveBeenCalledWith(

2816+

"chat.send attachment parse/stage failed",

2817+

expect.objectContaining({

2818+

consoleMessage: expect.stringContaining(

2819+

"chat.send attachment parse/stage failed: MediaOffloadError",

2820+

),

2821+

error: expect.stringContaining(

2822+

"Caused by: Error: ENOSPC: no space left on device\n at stageSandboxMedia",

2823+

),

2824+

}),

2825+

);

28112826

// Orphaned media-store files are cleaned up before the 5xx surfaces.

28122827

expect(mockState.deleteMediaBufferCalls).toEqual([{ id: "saved-media", subdir: "inbound" }]);

28132828

});

281428292830+

it("logs chat.send attachment parse failures with stack details", async () => {

2831+

createTranscriptFixture("openclaw-chat-send-attachment-parse-stack-");

2832+

const respond = vi.fn();

2833+

const context = createChatContext();

2834+2835+

await runNonStreamingChatSend({

2836+

context,

2837+

respond,

2838+

idempotencyKey: "idem-chat-send-attachment-parse-stack",

2839+

message: "inspect this",

2840+

requestParams: {

2841+

attachments: [

2842+

{

2843+

type: "file",

2844+

mimeType: "image/png",

2845+

fileName: "broken.png",

2846+

content: "not-base64",

2847+

},

2848+

],

2849+

},

2850+

expectBroadcast: false,

2851+

waitFor: "none",

2852+

});

2853+2854+

expect(mockState.lastDispatchCtx).toBeUndefined();

2855+

expect(respond).toHaveBeenCalledWith(

2856+

false,

2857+

undefined,

2858+

expect.objectContaining({

2859+

code: ErrorCodes.INVALID_REQUEST,

2860+

message: expect.stringContaining("attachment broken.png: invalid base64 content"),

2861+

}),

2862+

);

2863+

expect(context.logGateway.error).toHaveBeenCalledWith(

2864+

"chat.send attachment parse/stage failed",

2865+

expect.objectContaining({

2866+

consoleMessage: expect.stringContaining(

2867+

"chat.send attachment parse/stage failed: Error: attachment broken.png",

2868+

),

2869+

error: expect.stringContaining("Error: attachment broken.png: invalid base64 content"),

2870+

}),

2871+

);

2872+

const logMeta = (context.logGateway.error as unknown as ReturnType<typeof vi.fn>).mock

2873+

.calls[0]?.[1] as { error?: string } | undefined;

2874+

expect(logMeta?.error).toContain("\n at ");

2875+

});

2876+28152877

it("surfaces partial non-image staging failures as 5xx UNAVAILABLE", async () => {

28162878

// Regression: stageSandboxMedia keeps unstaged entries as their original

28172879

// absolute path, so a simple `stagedPaths.length === nonImage.length`