Skip to content

fix(gateway): honor configured remote probe budgets - #88302

Closed
Alix-007 wants to merge 2 commits into
openclaw:mainfrom
Alix-007:issue-65355-remote-probe-budget
Closed

Alix-007 wants to merge 2 commits into
openclaw:mainfrom
Alix-007:issue-65355-remote-probe-budget

Conversation

@Alix-007

@Alix-007 Alix-007 commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • honor the caller timeout budget for active configured remote and explicit remote gateway probes
  • keep the short remote cap (1500ms) for inactive configured remote targets — i.e. local mode with a stale leftover gateway.remote.url — so a dead remote host cannot consume the entire caller timeout before the active local probe runs
  • keep the shorter ssh tunnel cap unchanged
  • cover the helper budget split (active vs inactive configRemote) and the gateway probe command path with regression tests, including local mode with a stale remote URL

Fixes #65355.

Real behavior proof

Behavior addressed: openclaw gateway probe --timeout <n> previously capped configRemote probes at 1500ms, so a healthy remote gateway could false-negative even when the caller supplied a larger budget. The fix now honors the full caller budget for active configured remote targets, while inactive configured remote targets (local mode with a stale gateway.remote.url) keep the short 1500ms cap so an unreachable remote host does not burn the whole caller timeout ahead of the active local probe.

Real environment tested: Linux x86_64, Node.js v22.22.0, PR HEAD f86be96c9769dbee94bc7772d862468a789a952f rebased onto upstream main e9d01320d7f3cca9debe814bb909b3ffe9f9560d.

Exact steps or command run after this patch:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.unit-fast.config.ts \
  src/commands/gateway-status/helpers.test.ts --reporter=verbose

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.commands.config.ts \
  src/commands/gateway-status.test.ts --reporter=dot

Evidence after fix:

$ OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.unit-fast.config.ts \
  src/commands/gateway-status/helpers.test.ts --reporter=verbose

 ✓ |unit-fast| src/commands/gateway-status/helpers.test.ts > resolveProbeBudgetMs > lets active local loopback probes use the full caller budget 0ms
 ✓ |unit-fast| src/commands/gateway-status/helpers.test.ts > resolveProbeBudgetMs > keeps inactive local loopback probes on the short cap 0ms
 ✓ |unit-fast| src/commands/gateway-status/helpers.test.ts > resolveProbeBudgetMs > lets explicit loopback URLs use the full caller budget 0ms
 ✓ |unit-fast| src/commands/gateway-status/helpers.test.ts > resolveProbeBudgetMs > lets active configured and explicit remote probes use the full caller budget 0ms
 ✓ |unit-fast| src/commands/gateway-status/helpers.test.ts > resolveProbeBudgetMs > keeps inactive configured remote probes (local mode with a stale remote URL) on the short cap 0ms
 ✓ |unit-fast| src/commands/gateway-status/helpers.test.ts > resolveProbeBudgetMs > keeps ssh tunnel probes on the short cap 0ms

 Test Files  1 passed (1)
      Tests  18 passed (18)
$ OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.commands.config.ts \
  src/commands/gateway-status.test.ts --reporter=dot

 RUN  v4.1.7 /media/vdc/0668001470/workSpace/claw-campaign/openclaw-issue-65355-fresh

·························

 Test Files  1 passed (1)
      Tests  25 passed (25)

The new helper test keeps inactive configured remote probes (local mode with a stale remote URL) on the short cap asserts resolveProbeBudgetMs(15_000, { kind: "configRemote", active: false, url: "wss://stale-remote.example/ws" }) === 1500, while lets active configured and explicit remote probes use the full caller budget asserts the active path still receives the full 15_000ms.

Observed result after fix: gateway probe --timeout 15000 passes the full 15000ms budget to active configRemote and to explicit probe targets. An inactive configRemote target (local mode + stale gateway.remote.url) stays capped at 1500ms. SSH tunnel probes remain capped at 2000ms.

What was not tested: End-to-end gateway probe against a live remote gateway. The budget routing — including the inactive-target short cap — is covered by unit tests for both the helper and the command path. (Note: the 4 failing daemon-install-helpers.test.ts exec-SecretRef plugin-provider tests seen in the broader commands-light suite are pre-existing on upstream main and are not touched by this PR, which only changes src/commands/gateway-status/helpers.ts and its tests.)

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 30, 2026
@clawsweeper

clawsweeper Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 30, 2026, 9:17 PM ET / 01:17 UTC.

Summary
The PR changes gateway probe budget routing so active configured remote and explicit remote targets use the caller timeout while inactive configured remotes, inactive local loopback targets, and SSH tunnel probes remain capped, with helper and command regression tests.

PR surface: Source +11, Tests +39. Total +50 across 3 files.

Reproducibility: yes. from source: current main and v2026.5.28 route non-loopback probe targets through Math.min(1500, overallMs), so a configured remote probe cannot receive a larger --timeout budget. I did not run a live remote gateway repro in this read-only review.

Review metrics: 1 noteworthy metric.

  • Probe budget behavior: 2 target classes expanded, 3 caps preserved. Active configRemote and explicit remote now use the caller timeout while inactive configRemote, inactive localLoopback, and sshTunnel remain capped, so maintainers should notice the deliberate latency tradeoff.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Add redacted terminal output, copied live output, logs, or a recording from openclaw gateway probe --json --timeout ... against a healthy configured remote gateway after this patch.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body supplies targeted Vitest output but no live remote gateway probe after the patch; add redacted terminal output, copied live output, logs, or a recording, then update the PR body to trigger re-review or ask for @clawsweeper re-review.

Risk before merge

  • [P1] The intended fix lets active configured remote and explicit remote probes wait up to the caller-supplied budget, which changes existing diagnostic latency for scripts or operators that were implicitly relying on the old short cap.
  • [P1] The submitted proof is mocked test output only; the real remote gateway false-negative path has not been shown after the patch with redacted terminal output, logs, or a recording.

Maintainer options:

  1. Require Live Remote Probe Proof (recommended)
    Ask for redacted terminal output, logs, or a recording of openclaw gateway probe --json --timeout ... against a healthy configured remote that would exceed the old 1500ms cap.
  2. Accept The Diagnostic Latency Change
    A maintainer can intentionally accept the longer active-remote wait based on source and unit coverage, but that should be an explicit proof override before merge.

Next step before merge

  • [P1] Keep this in human PR review until live remote probe proof or an explicit maintainer proof override is available; there is no narrow automated code repair to request.

Security
Cleared: The diff only changes gateway probe timeout routing and tests; I found no concrete security or supply-chain regression.

Review details

Best possible solution:

Merge the focused budget split after live remote proof or an explicit maintainer proof override confirms active remote probes succeed with the caller budget while inactive stale remotes and SSH tunnels stay bounded.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main and v2026.5.28 route non-loopback probe targets through Math.min(1500, overallMs), so a configured remote probe cannot receive a larger --timeout budget. I did not run a live remote gateway repro in this read-only review.

Is this the best way to solve the issue?

Yes on code shape: the PR narrows the full-budget behavior to active configured remote and explicit targets while preserving short caps for inactive configured remotes, inactive local loopback, and SSH tunnels. The missing piece is live proof, not an obvious code repair.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 5c5711f061cd.

Label changes

Label justifications:

  • P2: This is a normal-priority gateway diagnostic bug fix with limited blast radius and a clear linked user report.
  • merge-risk: 🚨 compatibility: The PR intentionally changes effective timeout behavior for existing active configured remote and explicit remote gateway probe targets.
  • merge-risk: 🚨 availability: Those probe targets can now wait for the full caller-supplied budget, which can lengthen diagnostic command runtime if a remote endpoint is slow or unhealthy.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies targeted Vitest output but no live remote gateway probe after the patch; add redacted terminal output, copied live output, logs, or a recording, then update the PR body to trigger re-review or ask for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +11, Tests +39. Total +50 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 0 +11
Tests 2 41 2 +39
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 52 2 +50

What I checked:

  • Current main source behavior: Current main still caps every non-loopback probe target at Math.min(1500, overallMs), so configured remote and explicit remote targets cannot receive the full caller timeout today. (src/commands/gateway-status/helpers.ts:139, 5c5711f061cd)
  • PR implementation: At PR head, resolveProbeBudgetMs returns the full caller budget for explicit targets and for active configRemote targets, while inactive configRemote targets keep the 1500ms cap. (src/commands/gateway-status/helpers.ts:136, f86be96c9769)
  • Command path wiring: gateway status/probe passes each resolved target through resolveProbeBudgetMs before calling probeGateway, so the helper change is on the active command path. (src/commands/gateway-status/probe-run.ts:127, 5c5711f061cd)
  • PR regression coverage: The PR adds helper coverage for active remote/full-budget and inactive remote/short-cap behavior, plus a command test asserting configured remote probes receive 15000ms. (src/commands/gateway-status/helpers.test.ts:372, f86be96c9769)
  • Shipped behavior check: The latest release tag v2026.5.28 still contains the non-loopback 1500ms cap and a test expecting active configRemote and explicit remote targets to be capped at 1500ms. (src/commands/gateway-status/helpers.ts:139, e93216080aa1)
  • Real behavior proof gap: The PR body supplies targeted Vitest output and explicitly says end-to-end gateway probe against a live remote gateway was not tested after the patch. (f86be96c9769)

Likely related people:

  • Ted Li: Commit 5bb5d7d introduced resolveProbeBudgetMs with the local/full-budget split and the default non-local 1500ms cap that this PR narrows. (role: introduced budget helper behavior; confidence: high; commits: 5bb5d7dab4b2; files: src/commands/gateway-status/helpers.ts, src/commands/gateway-status/helpers.test.ts, src/commands/gateway-status.test.ts)
  • heavenlost: Commit 3cbd4de changed gateway-status helpers and src/gateway/probe.ts while restoring loopback detail probes and identity fallback, adjacent to this probe behavior. (role: recent gateway probe behavior contributor; confidence: medium; commits: 3cbd4de95cdc; files: src/commands/gateway-status/helpers.ts, src/commands/gateway-status/helpers.test.ts, src/gateway/probe.ts)
  • Peter Steinberger: Recent current-main and release-adjacent history touches gateway-status behavior and tests, including the local TLS hardening and current source provenance in this checkout. (role: recent area contributor; confidence: medium; commits: baf4119ae374, 0ed9fb48c486; files: src/commands/gateway-status.test.ts, src/commands/gateway-status/helpers.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels May 30, 2026
@Alix-007
Alix-007 force-pushed the issue-65355-remote-probe-budget branch from d3e614c to 6f4d61d Compare May 30, 2026 13:44
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 30, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Alix-007 and others added 2 commits May 31, 2026 08:54
Active configured remote targets (gateway.mode === remote) need the full
caller budget for a healthy remote RPC. An inactive configured remote —
local mode with a stale leftover gateway.remote.url — must retain the short
remote cap (1500ms) so a dead remote host cannot consume the entire caller
timeout before the active local probe runs.

Adds a regression test for local mode with a stale remote URL.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Alix-007
Alix-007 force-pushed the issue-65355-remote-probe-budget branch from 6f4d61d to f86be96 Compare May 31, 2026 01:05
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Alix-007

Copy link
Copy Markdown
Contributor Author

Status note for maintainers on proof. The code side is now complete: active configured-remote and explicit-remote probes honor the caller --timeout, while inactive configured remotes, inactive local loopback, and SSH tunnels keep the short cap — with helper and command regression tests covering both. The remaining gap is purely a live capture: I don't have a healthy remote gateway to record openclaw gateway probe --json --timeout ... exceeding the old 1500ms cap.

Could a maintainer advise the preferred path — apply proof: override based on source + unit coverage, capture a live remote probe on your side, or close if the latency tradeoff isn't wanted? ClawSweeper notes there's no further automated code repair to request, so this is waiting on a human call. Happy to follow whatever you decide.

@Alix-007

Alix-007 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Closing to keep the contribution queue focused on PRs with mergeable proof. The code path is covered by source/unit checks, but this still needs a live remote gateway probe capture or maintainer-side proof override, which I cannot provide from my environment. Happy to reopen or rework if maintainers want this path pursued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: gateway probe false-negatives on remote configRemote because non-loopback targets are hard-capped to 1500ms

1 participant