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

推荐订阅源

博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
B
Blog
GbyAI
GbyAI
爱范儿
爱范儿
月光博客
月光博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
腾讯CDC
MyScale Blog
MyScale Blog
V
Visual Studio Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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): reuse paired auth for probes · openclaw/ope...
steipete · 2026-04-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -26,6 +26,7 @@ Docs: https://docs.openclaw.ai

2626

- Providers/Bedrock: omit deprecated `temperature` for Claude Opus 4.7 Bedrock model ids, named and application inference profiles, including dotted `opus-4.7` refs, and classify the nested validation response for failover. Fixes #73663. Thanks @bstanbury.

2727

- Gateway: raise the preauth/connect-challenge timeout to 15s so cold CLI starts on slower hosts have more time to process the WebSocket challenge before the Gateway closes the connection. Fixes #51469; refs #73592 and #62060. Thanks @GothicFox and @jackychen-png.

2828

- CLI/status: fall back to a bounded local `status` RPC when loopback detail probes time out or report unknown capability, so reachable local gateways are no longer marked unreachable by slow read diagnostics. Fixes #73535; refs #48360, #62762, #51357, and #42019. Thanks @RacecarGuy, @justinschille, @DJBlackhawk, @tianyaqpzm, and @0xrsydn.

29+

- CLI/gateway: reuse cached paired-device auth during `gateway probe` and report post-connect diagnostic failures as degraded reachability, so healthy local gateways are no longer marked unreachable after loopback auth or read timeouts. Fixes #48360. Thanks @RacecarGuy.

2930

- Channels/Discord: give Discord Gateway WebSocket handshakes a 30s timeout so stalled TLS/network transitions emit an error and Carbon can continue its reconnect loop instead of leaving the bot silent until restart. Refs #50046. Thanks @codexGW.

3031

- NVIDIA/NIM: persist the `NVIDIA_API_KEY` provider marker and mark bundled NVIDIA Chat Completions models as string-content compatible, so NIM models load from `models.json` and OpenAI-compatible subagent calls send plain text content. Fixes #73013 and #50107; refs #73014. Thanks @bautrey, @iot2edge, @ifearghal, and @futhgar.

3132

- Channels/Discord: let text-only configs drop the `GuildVoiceStates` gateway intent and expose a bounded `/gateway/bot` metadata timeout with rate-limited fallback logs, reducing idle CPU and warning floods. Fixes #73709 and #73585. Thanks @sanchezm86 and @trac3r00.

Original file line numberDiff line numberDiff line change

@@ -323,6 +323,7 @@ openclaw gateway probe --json

323323

- `Capability: read-only|write-capable|admin-capable|pairing-pending|connect-only` reports what the probe could prove about auth. It is separate from reachability.

324324

- `Read probe: ok` means read-scope detail RPC calls (`health`/`status`/`system-presence`/`config.get`) also succeeded.

325325

- `Read probe: limited - missing scope: operator.read` means connect succeeded but read-scope RPC is limited. This is reported as **degraded** reachability, not full failure.

326+

- `Read probe: failed` after `Connect: ok` means the Gateway accepted the WebSocket connection, but follow-up read diagnostics timed out or failed. This is also **degraded** reachability, not an unreachable Gateway.

326327

- Like `gateway status`, probe reuses existing cached device auth but does not create first-time device identity or pairing state.

327328

- Exit code is non-zero only when no probed target is reachable.

328329

@@ -331,7 +332,7 @@ openclaw gateway probe --json

331332

Top level:

332333
333334

- `ok`: at least one target is reachable.

334-

- `degraded`: at least one target had scope-limited detail RPC.

335+

- `degraded`: at least one target accepted a connection but did not complete full detail RPC diagnostics.

335336

- `capability`: best capability seen across reachable targets (`read_only`, `write_capable`, `admin_capable`, `pairing_pending`, `connected_no_operator_scope`, or `unknown`).

336337

- `primaryTargetId`: best target to treat as the active winner in this order: explicit URL, SSH tunnel, configured remote, then local loopback.

337338

- `warnings[]`: best-effort warning records with `code`, `message`, and optional `targetIds`.

Original file line numberDiff line numberDiff line change

@@ -380,6 +380,7 @@ Common signatures:

380380

- `SSH tunnel failed to start; falling back to direct probes.` → SSH setup failed, but the command still tried direct configured/loopback targets.

381381

- `multiple reachable gateways detected` → more than one target answered. Usually this means an intentional multi-gateway setup or stale/duplicate listeners.

382382

- `Read-probe diagnostics are limited by gateway scopes (missing operator.read)` → connect worked, but detail RPC is scope-limited; pair device identity or use credentials with `operator.read`.

383+

- `Gateway accepted the WebSocket connection, but follow-up read diagnostics failed` → connect worked, but the full diagnostic RPC set timed out or failed. Treat this as a reachable Gateway with degraded diagnostics; compare `connect.ok` and `connect.rpcOk` in `--json` output.

383384

- `Capability: pairing-pending` or `gateway closed (1008): pairing required` → the gateway answered, but this client still needs pairing/approval before normal operator access.

384385

- unresolved `gateway.auth.*` / `gateway.remote.*` SecretRef warning text → auth material was unavailable in this command path for the failed target.

385386
Original file line numberDiff line numberDiff line change

@@ -4,6 +4,7 @@ import {

44

buildNetworkHints,

55

extractConfigSummary,

66

isProbeReachable,

7+

isPostConnectProbeFailure,

78

isScopeLimitedProbeFailure,

89

renderProbeSummaryLine,

910

resolveAuthForTarget,

@@ -250,7 +251,7 @@ describe("probe reachability classification", () => {

250251

expect(renderProbeSummaryLine(probe, false)).toContain("Read probe: limited");

251252

});

252253
253-

it("keeps non-scope RPC failures as unreachable", () => {

254+

it("treats post-connect read failures as reachable with failed diagnostics", () => {

254255

const probe = {

255256

ok: false,

256257

url: "ws://127.0.0.1:18789",

@@ -269,10 +270,33 @@ describe("probe reachability classification", () => {

269270

};

270271
271272

expect(isScopeLimitedProbeFailure(probe)).toBe(false);

272-

expect(isProbeReachable(probe)).toBe(false);

273+

expect(isPostConnectProbeFailure(probe)).toBe(true);

274+

expect(isProbeReachable(probe)).toBe(true);

273275

expect(renderProbeSummaryLine(probe, false)).toContain("Capability: connect-only");

274276

expect(renderProbeSummaryLine(probe, false)).toContain("Read probe: failed");

275277

});

278+
279+

it("keeps failed-before-connect probes unreachable", () => {

280+

const probe = {

281+

ok: false,

282+

url: "ws://127.0.0.1:18789",

283+

connectLatencyMs: null,

284+

error: "timeout",

285+

close: null,

286+

auth: {

287+

role: null,

288+

scopes: [],

289+

capability: "unknown" as const,

290+

},

291+

health: null,

292+

status: null,

293+

presence: null,

294+

configSnapshot: null,

295+

};

296+
297+

expect(isPostConnectProbeFailure(probe)).toBe(false);

298+

expect(isProbeReachable(probe)).toBe(false);

299+

});

276300

});

277301

describe("gateway-status local target scheme", () => {

278302

it("uses wss for local loopback targets and network hints when gateway TLS is enabled", () => {

Original file line numberDiff line numberDiff line change

@@ -276,8 +276,12 @@ export function isScopeLimitedProbeFailure(probe: GatewayProbeResult): boolean {

276276

return MISSING_SCOPE_PATTERN.test(probe.error ?? "");

277277

}

278278
279+

export function isPostConnectProbeFailure(probe: GatewayProbeResult): boolean {

280+

return !probe.ok && probe.connectLatencyMs != null;

281+

}

282+
279283

export function isProbeReachable(probe: GatewayProbeResult): boolean {

280-

return probe.ok || isScopeLimitedProbeFailure(probe);

284+

return probe.ok || probe.connectLatencyMs != null;

281285

}

282286
283287

function getGatewayProbeCapability(probe: GatewayProbeResult): GatewayProbeCapability {

Original file line numberDiff line numberDiff line change

@@ -95,11 +95,11 @@ describe("gateway status output", () => {

9595

discovery: [],

9696

probed: [

9797

createTarget(

98-

"unreachable-admin",

98+

"unreachable-before-connect",

9999

createProbe("admin_capable", {

100100

ok: false,

101-

connectLatencyMs: 40,

102-

error: "unknown method: status",

101+

connectLatencyMs: null,

102+

error: "timeout",

103103

}),

104104

),

105105

createTarget(

@@ -132,11 +132,11 @@ describe("gateway status output", () => {

132132

discovery: [],

133133

probed: [

134134

createTarget(

135-

"unreachable-admin",

135+

"unreachable-before-connect",

136136

createProbe("admin_capable", {

137137

ok: false,

138-

connectLatencyMs: 40,

139-

error: "unknown method: status",

138+

connectLatencyMs: null,

139+

error: "timeout",

140140

}),

141141

),

142142

createTarget(

@@ -153,4 +153,57 @@ describe("gateway status output", () => {

153153
154154

expect(runtime.log).toHaveBeenCalledWith("Capability: read-only");

155155

});

156+
157+

it("reports post-connect detail failures as reachable but degraded in json output", () => {

158+

const runtime = createRuntimeCapture();

159+

writeGatewayStatusJson({

160+

runtime,

161+

startedAt: Date.now() - 50,

162+

overallTimeoutMs: 5_000,

163+

discoveryTimeoutMs: 500,

164+

network: {

165+

localLoopbackUrl: "ws://127.0.0.1:18789",

166+

localTailnetUrl: null,

167+

tailnetIPv4: null,

168+

},

169+

discovery: [],

170+

probed: [

171+

createTarget(

172+

"detail-timeout",

173+

createProbe("read_only", {

174+

ok: false,

175+

connectLatencyMs: 40,

176+

error: "timeout",

177+

}),

178+

),

179+

],

180+

warnings: [

181+

{

182+

code: "probe_detail_failed",

183+

message:

184+

"Gateway accepted the WebSocket connection, but follow-up read diagnostics failed: timeout",

185+

targetIds: ["detail-timeout"],

186+

},

187+

],

188+

primaryTargetId: "detail-timeout",

189+

});

190+
191+

expect(writeRuntimeJson).toHaveBeenCalledWith(

192+

runtime,

193+

expect.objectContaining({

194+

ok: true,

195+

degraded: true,

196+

primaryTargetId: "detail-timeout",

197+

targets: [

198+

expect.objectContaining({

199+

connect: expect.objectContaining({

200+

ok: true,

201+

rpcOk: false,

202+

error: "timeout",

203+

}),

204+

}),

205+

],

206+

}),

207+

);

208+

});

156209

});

Original file line numberDiff line numberDiff line change

@@ -4,6 +4,7 @@ import { colorize, theme } from "../../terminal/theme.js";

44

import { serializeGatewayDiscoveryBeacon } from "./discovery.js";

55

import {

66

isProbeReachable,

7+

isPostConnectProbeFailure,

78

isScopeLimitedProbeFailure,

89

summarizeGatewayProbeCapability,

910

renderProbeSummaryLine,

@@ -39,6 +40,9 @@ export function buildGatewayStatusWarnings(params: {

3940

const degradedScopeLimited = params.probed.filter((entry) =>

4041

isScopeLimitedProbeFailure(entry.probe),

4142

);

43+

const degradedDetailFailed = params.probed.filter(

44+

(entry) => isPostConnectProbeFailure(entry.probe) && !isScopeLimitedProbeFailure(entry.probe),

45+

);

4246

const warnings: GatewayStatusWarning[] = [];

4347

if (params.sshTarget && !params.sshTunnelStarted) {

4448

warnings.push({

@@ -83,6 +87,14 @@ export function buildGatewayStatusWarnings(params: {

8387

targetIds: [result.target.id],

8488

});

8589

}

90+

for (const result of degradedDetailFailed) {

91+

const detail = result.probe.error ? `: ${result.probe.error}` : ".";

92+

warnings.push({

93+

code: "probe_detail_failed",

94+

message: `Gateway accepted the WebSocket connection, but follow-up read diagnostics failed${detail}`,

95+

targetIds: [result.target.id],

96+

});

97+

}

8698

return warnings;

8799

}

88100

@@ -98,7 +110,7 @@ export function writeGatewayStatusJson(params: {

98110

primaryTargetId: string | null;

99111

}) {

100112

const reachable = params.probed.filter((entry) => isProbeReachable(entry.probe));

101-

const degraded = params.probed.some((entry) => isScopeLimitedProbeFailure(entry.probe));

113+

const degraded = params.probed.some((entry) => isPostConnectProbeFailure(entry.probe));

102114

const capability = summarizeGatewayProbeCapability(reachable.map((entry) => entry.probe));

103115

writeRuntimeJson(params.runtime, {

104116

ok: reachable.length > 0,

Original file line numberDiff line numberDiff line change

@@ -203,7 +203,18 @@ describe("probeGateway", () => {

203203

expect(gatewayClientState.options?.scopes).toEqual(["operator.read"]);

204204

});

205205
206-

it("keeps device identity disabled for unauthenticated loopback probes", async () => {

206+

it("reuses cached device identity for unauthenticated loopback probes", async () => {

207+

await probeGateway({

208+

url: "ws://127.0.0.1:18789",

209+

timeoutMs: 1_000,

210+

});

211+
212+

expect(gatewayClientState.options?.deviceIdentity).toEqual(deviceIdentityState.value);

213+

});

214+
215+

it("keeps device identity disabled for first-time unauthenticated loopback probes", async () => {

216+

deviceIdentityState.cachedToken = null;

217+
207218

await probeGateway({

208219

url: "ws://127.0.0.1:18789",

209220

timeoutMs: 1_000,

@@ -220,7 +231,7 @@ describe("probeGateway", () => {

220231

});

221232
222233

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

223-

expect(gatewayClientState.options?.deviceIdentity).toBeNull();

234+

expect(gatewayClientState.options?.deviceIdentity).toEqual(deviceIdentityState.value);

224235

expect(gatewayClientState.requests).toEqual([]);

225236

});

226237
Original file line numberDiff line numberDiff line change

@@ -5,7 +5,6 @@ import type { SystemPresence } from "../infra/system-presence.js";

55

import { MAX_SAFE_TIMEOUT_DELAY_MS, resolveSafeTimeoutDelayMs } from "../utils/timer-delay.js";

66

import { GatewayClient, GatewayClientRequestError } from "./client.js";

77

import { READ_SCOPE } from "./method-scopes.js";

8-

import { isLoopbackHost } from "./net.js";

98

import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "./protocol/client-info.js";

109
1110

export type GatewayProbeAuth = {

@@ -162,24 +161,18 @@ export async function probeGateway(opts: {

162161

const detailLevel = opts.includeDetails === false ? "none" : (opts.detailLevel ?? "full");

163162
164163

const deviceIdentity = await (async () => {

165-

let hostname: string;

166-

try {

167-

hostname = new URL(opts.url).hostname;

168-

} catch {

169-

return null;

170-

}

171-

// Keep probes non-mutating: only attach a device identity when this CLI

172-

// already has a cached operator device token. Fresh diagnostics should not

173-

// create a read-only pairing baseline that later blocks admin commands.

174-

if (isLoopbackHost(hostname) && !(opts.auth?.token || opts.auth?.password)) {

175-

return null;

176-

}

177164

try {

165+

if (!URL.canParse(opts.url)) {

166+

return null;

167+

}

178168

const { loadDeviceIdentityIfPresent } = await import("../infra/device-identity.js");

179169

const identity = loadDeviceIdentityIfPresent();

180170

if (!identity) {

181171

return null;

182172

}

173+

// Keep probes non-mutating: only attach a device identity when this CLI

174+

// already has a cached operator device token. Fresh diagnostics should not

175+

// create a read-only pairing baseline that later blocks admin commands.

183176

const cachedOperatorToken = loadDeviceAuthToken({

184177

deviceId: identity.deviceId,

185178

role: "operator",