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

推荐订阅源

雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
D
Docker
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
U
Unit 42

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): decouple backend RPC from CLI pairing · ope...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -27,7 +27,9 @@ let lastClientOptions: {

2727

token?: string;

2828

password?: string;

2929

tlsFingerprint?: string;

30+

clientName?: string;

3031

clientDisplayName?: string;

32+

mode?: string;

3133

scopes?: string[];

3234

deviceIdentity?: unknown;

3335

onHelloOk?: (hello: { features?: { methods?: string[] } }) => void | Promise<void>;

@@ -59,7 +61,9 @@ vi.mock("./client.js", () => ({

5961

url?: string;

6062

token?: string;

6163

password?: string;

64+

clientName?: string;

6265

clientDisplayName?: string;

66+

mode?: string;

6367

scopes?: string[];

6468

onHelloOk?: (hello: { features?: { methods?: string[] } }) => void | Promise<void>;

6569

onClose?: (code: number, reason: string) => void;

@@ -97,7 +101,9 @@ class StubGatewayClient {

97101

url?: string;

98102

token?: string;

99103

password?: string;

104+

clientName?: string;

100105

clientDisplayName?: string;

106+

mode?: string;

101107

scopes?: string[];

102108

onHelloOk?: (hello: { features?: { methods?: string[] } }) => void | Promise<void>;

103109

onClose?: (code: number, reason: string) => void;

@@ -303,14 +309,31 @@ describe("callGateway url resolution", () => {

303309

expect(lastClientOptions?.token).toBe("test-token");

304310

});

305311306-

it("keeps device identity enabled for local loopback shared-token auth", async () => {

312+

it("keeps direct-local backend shared-token auth independent of paired device state", async () => {

307313

setLocalLoopbackGatewayConfig();

308314309315

await callGateway({

310316

method: "health",

311317

token: "explicit-token",

312318

});

313319320+

expect(lastClientOptions?.url).toBe("ws://127.0.0.1:18789");

321+

expect(lastClientOptions?.token).toBe("explicit-token");

322+

expect(lastClientOptions?.clientName).toBe(GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT);

323+

expect(lastClientOptions?.mode).toBe(GATEWAY_CLIENT_MODES.BACKEND);

324+

expect(lastClientOptions?.deviceIdentity).toBeNull();

325+

});

326+327+

it("keeps device identity enabled for explicit CLI loopback shared-token auth", async () => {

328+

setLocalLoopbackGatewayConfig();

329+330+

await callGateway({

331+

method: "health",

332+

token: "explicit-token",

333+

clientName: GATEWAY_CLIENT_NAMES.CLI,

334+

mode: GATEWAY_CLIENT_MODES.CLI,

335+

});

336+314337

expect(lastClientOptions?.url).toBe("ws://127.0.0.1:18789");

315338

expect(lastClientOptions?.token).toBe("explicit-token");

316339

expect(lastClientOptions?.deviceIdentity).toEqual(deviceIdentityState.value);

@@ -331,6 +354,22 @@ describe("callGateway url resolution", () => {

331354

expect(lastRequestOptions?.method).toBe("health");

332355

});

333356357+

it("keeps backend device identity enabled for remote shared-token auth", async () => {

358+

loadConfig.mockReturnValue(makeRemotePasswordGatewayConfig("remote-password"));

359+

setGatewayNetworkDefaults();

360+361+

await callGateway({

362+

method: "health",

363+

token: "explicit-token",

364+

});

365+366+

expect(lastClientOptions?.url).toBe("wss://remote.example:18789");

367+

expect(lastClientOptions?.token).toBe("explicit-token");

368+

expect(lastClientOptions?.clientName).toBe(GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT);

369+

expect(lastClientOptions?.mode).toBe(GATEWAY_CLIENT_MODES.BACKEND);

370+

expect(lastClientOptions?.deviceIdentity).toEqual(deviceIdentityState.value);

371+

});

372+334373

it("honors an explicit null device identity override", async () => {

335374

setLocalLoopbackGatewayConfig();

336375

@@ -470,6 +509,22 @@ describe("callGateway url resolution", () => {

470509

expect(lastClientOptions?.scopes).toEqual([]);

471510

});

472511512+

it("uses backend client metadata for explicit scoped default calls", async () => {

513+

setLocalLoopbackGatewayConfig();

514+515+

await callGateway({

516+

method: "sessions.delete",

517+

scopes: ["operator.admin"],

518+

token: "explicit-token",

519+

});

520+521+

expect(lastClientOptions?.clientName).toBe(GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT);

522+

expect(lastClientOptions?.mode).toBe(GATEWAY_CLIENT_MODES.BACKEND);

523+

expect(lastClientOptions?.clientDisplayName).toBe("gateway:sessions.delete");

524+

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

525+

expect(lastClientOptions?.deviceIdentity).toBeNull();

526+

});

527+473528

it("labels default backend calls with the requested method", async () => {

474529

setLocalLoopbackGatewayConfig();

475530