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

推荐订阅源

雷峰网
雷峰网
宝玉的分享
宝玉的分享
I
InfoQ
P
Privacy International News Feed
V
V2EX
IT之家
IT之家
S
SegmentFault 最新的问题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V2EX - 技术
V2EX - 技术
C
CERT Recently Published Vulnerability Notes
C
Check Point Blog
The Register - Security
The Register - Security
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
AWS News Blog
AWS News Blog
M
MIT News - Artificial intelligence
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
B
Blog
N
Netflix TechBlog - Medium
B
Blog RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
T
Threatpost
Forbes - Security
Forbes - Security
U
Unit 42
A
Arctic Wolf
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recorded Future
Recorded Future
L
Lohrmann on Cybersecurity
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
月光博客
月光博客
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
I
Intezer
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
The Hacker News
The Hacker News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
MyScale Blog
MyScale Blog
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(gateway): reuse paired auth for probes · openclaw/openclaw@193c743
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",