fix(gateway): raise local loopback probe timeout from 800ms to 8s#50568
Draft
belisarius222 wants to merge 1 commit intoopenclaw:mainfrom
Draft
fix(gateway): raise local loopback probe timeout from 800ms to 8s#50568belisarius222 wants to merge 1 commit intoopenclaw:mainfrom
belisarius222 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
The local loopback probe budget was hardcoded to 800ms, which is too aggressive and causes spurious timeouts on slower machines or when the gateway handshake takes longer than expected. Raise the per-target budget for localLoopback to 8000ms and the overall default from 3s to 10s so the new budget is usable without an explicit --timeout flag. Fixes openclaw#45560 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openclaw gateway probetimes out on local loopback connections because the per-target probe budget forlocalLoopbackis hardcoded to 800ms, which is too aggressive for machines where the WS handshake takes longer (e.g., token-auth setups, slower hardware, or when the gateway is under load).localLoopbackprobe budget cap from 800ms to 8000ms. (2) Raised the overall default timeout forgatewayStatusCommandfrom 3000ms to 10000ms so the new loopback budget is usable without an explicit--timeoutflag. (3) RefactoredresolveProbeBudgetMsto use a declarative config map instead of if/else chains.sshTunnel(2000ms),configRemote(1500ms), andexplicit(1500ms) per-target budgets are unchanged. The--timeoutflag still works and still caps all per-target budgets. The server-side handshake timeout (DEFAULT_HANDSHAKE_TIMEOUT_MS = 10_000) is untouched.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
openclaw gateway probedefault overall timeout changed from 3s to 10s (still overridable via--timeout).Security Impact (required)
NoNoNo(same WebSocket probe, just a longer timeout)NoNoRepro + Verification
Environment
gateway.mode = local,gateway.bind = lan,gateway.auth.mode = tokenSteps
openclaw statusandcurl http://127.0.0.1:18789/returns 200.openclaw gateway probe --json.Expected
"ok": truewith health/status data.Actual
"error": "timeout"for thelocalLoopbacktarget because the 800ms budget expires before the WS handshake + token auth completes.Evidence
All 23 tests in
src/commands/gateway-status/pass after the change (npx vitest run src/commands/gateway-status).Human Verification (required)
gateway-status.test.tsandgateway-status/helpers.test.ts). ConfirmedresolveProbeBudgetMsreturns 8000 forlocalLoopbackand respectsoverallMscap.overallMssmaller than 8000 still correctly caps the loopback budget (e.g.,--timeout 2000yields a 2000ms loopback budget). All fourTargetKindvalues are covered in the config map with no fallthrough gaps.Review Conversations
Compatibility / Migration
Yes— the--timeoutflag still works identically; only defaults changed.NoNoFailure Recovery (if this breaks)
--timeout 3000to restore the previous effective behavior.src/commands/gateway-status.ts,src/commands/gateway-status/helpers.tsgateway probecommand to feel sluggish when the gateway is truly unreachable, users can pass a shorter--timeoutvalue.Risks and Mitigations
openclaw gateway probetake longer to report failure when the gateway is genuinely down.DEFAULT_HANDSHAKE_TIMEOUT_MS(also 10s) and matches timeouts used elsewhere in the codebase (e.g.,status-all.ts,status.scan.ts). Users who prefer faster failure can pass--timeout <ms>.AI Disclosure