fix(gateway): honor remote status probe timeout#89859
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 22, 2026, 3:44 AM ET / 07:44 UTC. Summary PR surface: Source 0, Tests +19. Total +19 across 3 files. Reproducibility: yes. from source. Current main routes active non-loopback gateway-status targets through the 1500ms cap before they can receive the caller budget, and the linked issue plus PR proof show slow reachable remotes crossing that cap. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused resolver change if maintainers accept the active-remote diagnostic latency tradeoff, then let it close #65355. Do we have a high-confidence way to reproduce the issue? Yes, from source. Current main routes active non-loopback gateway-status targets through the 1500ms cap before they can receive the caller budget, and the linked issue plus PR proof show slow reachable remotes crossing that cap. Is this the best way to solve the issue? Yes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f9ebb8d91bea. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +19. Total +19 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
4308dcf to
5dbcdde
Compare
|
Land-ready maintainer verification:
Known gaps: none for this narrow timeout-routing change. |
de6c2f8 to
e43072a
Compare
e43072a to
056707d
Compare
|
Merged via squash.
Thanks @mushuiyu886! |
Summary
Fixes #65355.
openclaw gateway probe --timeout 30000was still capping active non-loopback probes, includinggateway.remote.url/configRemote, at 1500ms. This keeps the short budgets for inactive remote probes, inactive local loopback probes, and SSH tunnel probes, but lets active configured or explicit remote probes use the caller's timeout.Changes
src/commands/gateway-status/helpers.ts: let active status probe targets use the full caller budget before applying inactive/SSH short caps.src/commands/gateway-status/helpers.test.ts: lock the active remote, inactive remote, and SSH tunnel budget cases.src/commands/gateway-status.test.ts: prove the gateway probe command passes a 15000ms caller timeout through to the active configured remote probe.Current main check
Current
origin/mainstill needs this fix:daily_fix.sh check-upstream-fixedreportedupstream_fixed=false. After the requiredsync-main, the PR remains focused on the same three gateway-status files.Why it matters / User impact
gateway probereporting a false negative after the old 1500ms background cap.resolveProbeBudgetMs()insrc/commands/gateway-status/helpers.ts; all configured, explicit, local, and SSH probe targets pass through this canonical budget boundary beforeprobeGateway()receivestimeoutMs, and no protocol/schema/default migration is involved.gateway.remote.url, CLI--url, and--timeoutare existing public surfaces; this PR does not add config fields, change schema validation, change defaults, or migrate stored config.check-upstream-fixedafter fetchingorigin/mainreported that main has not covered the fix, so this branch remains the implementation candidate rather than a duplicate replacement.probeGateway()protocol handling, WebSocket auth/read scopes, service startup, transport/channel delivery, provider routing, or external network retries.Real behavior proof
sync-main, Node v22.22.0, local OpenClaw dev gateway started from this worktree, and a local TCP proxy bound to a non-loopback host address with a 2.2s initial delay before forwarding to the real gateway.{ "command": "node openclaw.mjs gateway probe --timeout 5000 --json --token <redacted-token> (isolated config gateway.mode=remote gateway.remote.url=ws://<non-loopback-local-ip>:19060)", "proxyInitialDelayMs": 2200, "exitCode": 0, "ok": true, "targetSummary": [ { "id": "configRemote", "kind": "configRemote", "active": true, "url": "ws://<non-loopback-local-ip>:19060", "connect": { "ok": true, "rpcOk": false, "scopeLimited": true, "latencyMs": 2250, "error": "missing scope: operator.read" } }, { "id": "localLoopback", "kind": "localLoopback", "active": false, "url": "ws://127.0.0.1:19059", "connect": { "ok": true, "rpcOk": false, "scopeLimited": true, "latencyMs": 55, "error": "missing scope: operator.read" } } ] }{ "command": "node openclaw.mjs gateway probe --timeout 5000 --json --url ws://<non-loopback-local-ip>:19060 --token <redacted-token>", "proxyInitialDelayMs": 2200, "exitCode": 0, "ok": true, "targetSummary": [ { "id": "explicit", "kind": "explicit", "active": true, "url": "ws://<non-loopback-local-ip>:19060", "connect": { "ok": true, "rpcOk": false, "scopeLimited": true, "latencyMs": 2290, "error": "missing scope: operator.read" } } ] }configRemoteprobe connected through the non-loopback delayed proxy withlatencyMs=2250under a 5000ms caller timeout, so the live path crossed the old 1500ms cap and still succeeded. The explicit remote path also connected atlatencyMs=2290. Inactive local loopback remained a short background probe.operator.read, so the proof verifies live WebSocket reachability/timeout budget rather than full read-status RPC output. No third-party channel, Mantis, Desktop session, or external slow network was used.Review findings addressed
configRemotetarget is active, non-loopback, and connected withlatencyMs=2250under--timeout 5000; that crosses the old 1500ms cap and exercises the productiongateway probepath after the patch.Regression Test Plan
configRemoteprobe.src/commands/gateway-status/helpers.test.tsandsrc/commands/gateway-status.test.ts.Merge risk
configRemoteprobe under--timeout 5000.Root Cause
resolveProbeBudgetMs(): it checked for non-loopback targets before considering whether the target was the active user-selected remote endpoint, causing active configured remote probes to be forced through the legacy 1500ms background-probe cap.