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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
量子位
S
SegmentFault 最新的问题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
Recent Announcements
Recent Announcements
腾讯CDC
I
InfoQ
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
爱范儿
爱范儿

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: tighten control ui pairing assertions · openclaw/op...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -33,6 +33,22 @@ import {

33333434

const operatorIdentityPathByPrefix = new Map<string, string>();

353536+

function expectArrayIncludes(actual: unknown, expectedValues: string[]): void {

37+

expect(Array.isArray(actual)).toBe(true);

38+

const values = actual as unknown[];

39+

for (const expected of expectedValues) {

40+

expect(values).toContain(expected);

41+

}

42+

}

43+44+

function expectArrayExcludes(actual: unknown, deniedValues: string[]): void {

45+

expect(Array.isArray(actual)).toBe(true);

46+

const values = actual as unknown[];

47+

for (const denied of deniedValues) {

48+

expect(values).not.toContain(denied);

49+

}

50+

}

51+3652

export function registerControlUiAndPairingSuite(): void {

3753

const trustedProxyControlUiCases: Array<{

3854

name: string;

@@ -830,7 +846,7 @@ export function registerControlUiAndPairingSuite(): void {

830846

(entry) => entry.deviceId === identity.deviceId,

831847

);

832848

expect(pendingAfterAdmin).toHaveLength(1);

833-

expect(pendingAfterAdmin[0]?.scopes ?? []).toEqual(expect.arrayContaining(["operator.admin"]));

849+

expectArrayIncludes(pendingAfterAdmin[0]?.scopes, ["operator.admin"]);

834850

if (!(await getPairedDevice(identity.deviceId))) {

835851

throw new Error(`expected paired device ${identity.deviceId}`);

836852

}

@@ -868,7 +884,7 @@ export function registerControlUiAndPairingSuite(): void {

868884

const pending = await listDevicePairing();

869885

const pendingUpgrade = pending.pending.filter((entry) => entry.deviceId === identity.deviceId);

870886

expect(pendingUpgrade).toHaveLength(1);

871-

expect(pendingUpgrade[0]?.scopes ?? []).toEqual(expect.arrayContaining(["operator.admin"]));

887+

expectArrayIncludes(pendingUpgrade[0]?.scopes, ["operator.admin"]);

872888

const updated = await getPairedDevice(identity.deviceId);

873889

expect(updated?.tokens?.operator?.scopes ?? []).not.toContain("operator.admin");

874890

@@ -1023,39 +1039,35 @@ export function registerControlUiAndPairingSuite(): void {

10231039

expect(initialPayload?.auth?.deviceTokens?.some((entry) => entry.role === "node")).toBe(

10241040

false,

10251041

);

1026-

expect(

1027-

initialPayload?.auth?.deviceTokens?.find((entry) => entry.role === "operator")?.scopes,

1028-

).toEqual(

1029-

expect.arrayContaining([

1030-

"operator.approvals",

1031-

"operator.read",

1032-

"operator.talk.secrets",

1033-

"operator.write",

1034-

]),

1035-

);

1036-

expect(

1037-

initialPayload?.auth?.deviceTokens?.find((entry) => entry.role === "operator")?.scopes,

1038-

).not.toEqual(

1039-

expect.arrayContaining(["node.camera", "node.display", "node.exec", "node.voice"]),

1040-

);

1041-

expect(

1042-

initialPayload?.auth?.deviceTokens?.find((entry) => entry.role === "operator")?.scopes,

1043-

).not.toEqual(expect.arrayContaining(["operator.admin", "operator.pairing"]));

1042+

const operatorBootstrapScopes = initialPayload?.auth?.deviceTokens?.find(

1043+

(entry) => entry.role === "operator",

1044+

)?.scopes;

1045+

expectArrayIncludes(operatorBootstrapScopes, [

1046+

"operator.approvals",

1047+

"operator.read",

1048+

"operator.talk.secrets",

1049+

"operator.write",

1050+

]);

1051+

expectArrayExcludes(operatorBootstrapScopes, [

1052+

"node.camera",

1053+

"node.display",

1054+

"node.exec",

1055+

"node.voice",

1056+

]);

1057+

expectArrayExcludes(operatorBootstrapScopes, ["operator.admin", "operator.pairing"]);

1044105810451059

const afterBootstrap = await listDevicePairing();

10461060

expect(

10471061

afterBootstrap.pending.filter((entry) => entry.deviceId === identity.deviceId),

10481062

).toEqual([]);

10491063

const paired = await getPairedDevice(identity.deviceId);

1050-

expect(paired?.roles).toEqual(expect.arrayContaining(["node", "operator"]));

1051-

expect(paired?.approvedScopes ?? []).toEqual(

1052-

expect.arrayContaining([

1053-

"operator.approvals",

1054-

"operator.read",

1055-

"operator.talk.secrets",

1056-

"operator.write",

1057-

]),

1058-

);

1064+

expectArrayIncludes(paired?.roles, ["node", "operator"]);

1065+

expectArrayIncludes(paired?.approvedScopes, [

1066+

"operator.approvals",

1067+

"operator.read",

1068+

"operator.talk.secrets",

1069+

"operator.write",

1070+

]);

10591071

expect(paired?.tokens?.node?.token).toBe(issuedDeviceToken);

10601072

expect(paired?.tokens?.operator?.token).toBe(issuedOperatorToken);

10611073

if (!issuedDeviceToken || !issuedOperatorToken) {

@@ -1278,7 +1290,7 @@ export function registerControlUiAndPairingSuite(): void {

12781290

expect(pending[0]?.role).toBe("node");

12791291

expect(pending[0]?.roles).toEqual(["node"]);

12801292

const paired = await getPairedDevice(identity.deviceId);

1281-

expect(paired?.roles).toEqual(expect.arrayContaining(["operator"]));

1293+

expectArrayIncludes(paired?.roles, ["operator"]);

12821294

wsUpgrade.close();

12831295

} finally {

12841296

await server.close();

@@ -1322,7 +1334,7 @@ export function registerControlUiAndPairingSuite(): void {

13221334

);

13231335

expect(pending).toHaveLength(1);

13241336

expect(pending[0]?.role).toBe("operator");

1325-

expect(pending[0]?.scopes ?? []).toEqual(expect.arrayContaining(["operator.read"]));

1337+

expectArrayIncludes(pending[0]?.scopes, ["operator.read"]);

13261338

expect(await getPairedDevice(identity.deviceId)).toBeNull();

13271339

wsBootstrap.close();

13281340

} finally {

@@ -1377,15 +1389,11 @@ export function registerControlUiAndPairingSuite(): void {

13771389

(entry) => entry.deviceId === identity.deviceId,

13781390

);

13791391

expect(pendingForTestDevice).toHaveLength(1);

1380-

expect(pendingForTestDevice[0]?.scopes ?? []).toEqual(

1381-

expect.arrayContaining(["operator.read", "operator.write"]),

1382-

);

1392+

expectArrayIncludes(pendingForTestDevice[0]?.scopes, ["operator.read", "operator.write"]);

1383139313841394

const paired = await getPairedDevice(identity.deviceId);

1385-

expect(paired?.roles).toEqual(expect.arrayContaining(["node", "operator"]));

1386-

expect(paired?.approvedScopes ?? []).toEqual(

1387-

expect.arrayContaining(["operator.read", "operator.write"]),

1388-

);

1395+

expectArrayIncludes(paired?.roles, ["node", "operator"]);

1396+

expectArrayIncludes(paired?.approvedScopes, ["operator.read", "operator.write"]);

1389139713901398

const approvedOperatorConnect = await connectWithNonce("operator", ["operator.read"]);

13911399

expect(approvedOperatorConnect.ok).toBe(true);

@@ -1576,10 +1584,10 @@ export function registerControlUiAndPairingSuite(): void {

15761584

if (!pendingUpgrade) {

15771585

throw new Error(`expected pending upgrade for device ${identity.deviceId}`);

15781586

}

1579-

expect(pendingUpgrade?.scopes ?? []).toEqual(expect.arrayContaining(["operator.admin"]));

1587+

expectArrayIncludes(pendingUpgrade.scopes, ["operator.admin"]);

15801588

const repaired = await getPairedDevice(identity.deviceId);

15811589

expect(repaired?.role).toBe("operator");

1582-

expect(repaired?.approvedScopes ?? []).toEqual(expect.arrayContaining(["operator.read"]));

1590+

expectArrayIncludes(repaired?.approvedScopes, ["operator.read"]);

15831591

} finally {

15841592

ws2?.close();

15851593

await server.close();