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

推荐订阅源

P
Proofpoint News Feed
V
V2EX
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
The Cloudflare Blog
T
Tailwind CSS Blog
H
Help Net Security
腾讯CDC
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
C
Check Point Blog
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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
test: dedupe control ui response reads · openclaw/opencla...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -31,7 +31,7 @@ describe("handleControlUiHttpRequest", () => {

3131

}

32323333

function parseBootstrapPayload(end: ReturnType<typeof makeMockHttpResponse>["end"]) {

34-

return JSON.parse(String(end.mock.calls.at(0)?.[0] ?? "")) as {

34+

return JSON.parse(responseBody(end)) as {

3535

basePath: string;

3636

assistantName: string;

3737

assistantAvatar: string;

@@ -41,6 +41,18 @@ describe("handleControlUiHttpRequest", () => {

4141

};

4242

}

434344+

function responseBody(end: ReturnType<typeof makeMockHttpResponse>["end"]) {

45+

return String(end.mock.calls.at(0)?.[0] ?? "");

46+

}

47+48+

function responseJson(end: ReturnType<typeof makeMockHttpResponse>["end"]) {

49+

return JSON.parse(responseBody(end)) as unknown;

50+

}

51+52+

function firstEndCallLength(end: ReturnType<typeof makeMockHttpResponse>["end"]) {

53+

return end.mock.calls.at(0)?.length ?? -1;

54+

}

55+4456

function expectNotFoundResponse(params: {

4557

handled: boolean;

4658

res: ReturnType<typeof makeMockHttpResponse>["res"];

@@ -214,7 +226,7 @@ describe("handleControlUiHttpRequest", () => {

214226

}) {

215227

expect(params.handled).toBe(true);

216228

expect(params.res.statusCode).toBe(403);

217-

expect(JSON.parse(String(params.end.mock.calls.at(0)?.[0] ?? ""))).toEqual({

229+

expect(responseJson(params.end)).toEqual({

218230

ok: false,

219231

error: {

220232

type: "forbidden",

@@ -372,7 +384,7 @@ describe("handleControlUiHttpRequest", () => {

372384

});

373385

expect(handled).toBe(true);

374386

expect(res.statusCode).toBe(200);

375-

const payload = JSON.parse(String(end.mock.calls.at(0)?.[0] ?? "")) as {

387+

const payload = responseJson(end) as {

376388

available?: boolean;

377389

mediaTicket?: string;

378390

mediaTicketExpiresAt?: string;

@@ -414,7 +426,7 @@ describe("handleControlUiHttpRequest", () => {

414426

});

415427

expect(handled).toBe(true);

416428

expect(res.statusCode).toBe(200);

417-

const payload = JSON.parse(String(end.mock.calls.at(0)?.[0] ?? "")) as {

429+

const payload = responseJson(end) as {

418430

available?: boolean;

419431

mediaTicket?: string;

420432

mediaTicketExpiresAt?: string;

@@ -440,7 +452,7 @@ describe("handleControlUiHttpRequest", () => {

440452

authorization: "Bearer test-token",

441453

},

442454

});

443-

const payload = JSON.parse(String(meta.end.mock.calls.at(0)?.[0] ?? "")) as {

455+

const payload = responseJson(meta.end) as {

444456

mediaTicket?: string;

445457

};

446458

expect(meta.handled).toBe(true);

@@ -472,7 +484,7 @@ describe("handleControlUiHttpRequest", () => {

472484

authorization: "Bearer test-token",

473485

},

474486

});

475-

const payload = JSON.parse(String(meta.end.mock.calls.at(0)?.[0] ?? "")) as {

487+

const payload = responseJson(meta.end) as {

476488

mediaTicket?: string;

477489

};

478490

@@ -483,7 +495,7 @@ describe("handleControlUiHttpRequest", () => {

483495

});

484496

expect(refresh.handled).toBe(true);

485497

expect(refresh.res.statusCode).toBe(401);

486-

expect(String(refresh.end.mock.calls.at(0)?.[0] ?? "")).toContain("Unauthorized");

498+

expect(responseBody(refresh.end)).toContain("Unauthorized");

487499

},

488500

});

489501

});

@@ -501,7 +513,7 @@ describe("handleControlUiHttpRequest", () => {

501513

});

502514

expect(handled).toBe(true);

503515

expect(res.statusCode).toBe(401);

504-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toContain("Unauthorized");

516+

expect(responseBody(end)).toContain("Unauthorized");

505517

},

506518

});

507519

});

@@ -514,7 +526,7 @@ describe("handleControlUiHttpRequest", () => {

514526

});

515527

expect(handled).toBe(true);

516528

expect(res.statusCode).toBe(200);

517-

expect(JSON.parse(String(end.mock.calls.at(0)?.[0] ?? ""))).toEqual({

529+

expect(responseJson(end)).toEqual({

518530

available: false,

519531

code: "outside-allowed-folders",

520532

reason: "Outside allowed folders",

@@ -534,7 +546,7 @@ describe("handleControlUiHttpRequest", () => {

534546

});

535547

expect(handled).toBe(true);

536548

expect(res.statusCode).toBe(401);

537-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toContain("Unauthorized");

549+

expect(responseBody(end)).toContain("Unauthorized");

538550

},

539551

});

540552

});

@@ -598,7 +610,7 @@ describe("handleControlUiHttpRequest", () => {

598610

});

599611

expect(handled).toBe(true);

600612

expect(res.statusCode).toBe(401);

601-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toContain("Unauthorized");

613+

expect(responseBody(end)).toContain("Unauthorized");

602614

},

603615

});

604616

});

@@ -719,7 +731,7 @@ describe("handleControlUiHttpRequest", () => {

719731

});

720732

expect(handled).toBe(true);

721733

expect(res.statusCode).toBe(401);

722-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toContain("Unauthorized");

734+

expect(responseBody(end)).toContain("Unauthorized");

723735

},

724736

});

725737

});

@@ -805,7 +817,7 @@ describe("handleControlUiHttpRequest", () => {

805817806818

expect(handled).toBe(true);

807819

expect(res.statusCode).toBe(200);

808-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toBe("avatar-bytes\n");

820+

expect(responseBody(end)).toBe("avatar-bytes\n");

809821

} finally {

810822

await fs.rm(tmp, { recursive: true, force: true });

811823

}

@@ -876,7 +888,7 @@ describe("handleControlUiHttpRequest", () => {

876888877889

expect(handled).toBe(true);

878890

expect(res.statusCode).toBe(200);

879-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toBe("avatar-bytes\n");

891+

expect(responseBody(end)).toBe("avatar-bytes\n");

880892

} finally {

881893

await fs.rm(tmp, { recursive: true, force: true });

882894

}

@@ -901,7 +913,7 @@ describe("handleControlUiHttpRequest", () => {

901913902914

expect(handled).toBe(true);

903915

expect(res.statusCode).toBe(200);

904-

expect(JSON.parse(String(end.mock.calls.at(0)?.[0] ?? ""))).toEqual({

916+

expect(responseJson(end)).toEqual({

905917

avatarUrl: "https://example.com/avatar.png",

906918

avatarSource: "remote URL",

907919

avatarStatus: "remote",

@@ -922,7 +934,7 @@ describe("handleControlUiHttpRequest", () => {

922934923935

expect(handled).toBe(true);

924936

expect(res.statusCode).toBe(200);

925-

expect(JSON.parse(String(end.mock.calls.at(0)?.[0] ?? ""))).toEqual({

937+

expect(responseJson(end)).toEqual({

926938

avatarUrl: null,

927939

avatarSource: null,

928940

avatarStatus: "none",

@@ -940,7 +952,7 @@ describe("handleControlUiHttpRequest", () => {

940952941953

expect(handled).toBe(true);

942954

expect(res.statusCode).toBe(401);

943-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toContain("Unauthorized");

955+

expect(responseBody(end)).toContain("Unauthorized");

944956

});

945957946958

it("rejects trusted-proxy avatar metadata requests without operator.read scope", async () => {

@@ -995,7 +1007,7 @@ describe("handleControlUiHttpRequest", () => {

99510079961008

expect(handled).toBe(true);

9971009

expect(res.statusCode).toBe(200);

998-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toBe("inside-ok\n");

1010+

expect(responseBody(end)).toBe("inside-ok\n");

9991011

},

10001012

});

10011013

});

@@ -1013,7 +1025,7 @@ describe("handleControlUiHttpRequest", () => {

1013102510141026

expect(handled).toBe(true);

10151027

expect(res.statusCode).toBe(200);

1016-

expect(end.mock.calls.at(0)?.length ?? -1).toBe(0);

1028+

expect(firstEndCallLength(end)).toBe(0);

10171029

},

10181030

});

10191031

});

@@ -1096,7 +1108,7 @@ describe("handleControlUiHttpRequest", () => {

1096110810971109

expect(handled).toBe(true);

10981110

expect(res.statusCode).toBe(200);

1099-

expect(String(end.mock.calls.at(0)?.[0] ?? "")).toBe("console.log('hi');");

1111+

expect(responseBody(end)).toBe("console.log('hi');");

11001112

},

11011113

});

11021114

});