fix: increase DEFAULT_HANDSHAKE_TIMEOUT_MS from 3s to 10s#49049
fix: increase DEFAULT_HANDSHAKE_TIMEOUT_MS from 3s to 10s#49049c-amg wants to merge 6 commits intoopenclaw:mainfrom
Conversation
- Increase default handshake timeout from 3 seconds to 10 seconds - Remove VITEST gate on OPENCLAW_TEST_HANDSHAKE_TIMEOUT_MS env var - This fixes spurious 'gateway closed (1000)' errors when event loop is busy See: openclaw#46892
Greptile SummaryThis PR bumps
Confidence Score: 5/5
|
…HAKE_TIMEOUT_MS Remove _TEST_ prefix from env var name for clarity - this is now a useful production override, not just for test environments.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7150d9fb22
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (process.env.OPENCLAW_HANDSHAKE_TIMEOUT_MS) { | ||
| const parsed = Number(process.env.OPENCLAW_HANDSHAKE_TIMEOUT_MS); |
There was a problem hiding this comment.
Keep OPENCLAW_TEST_HANDSHAKE_TIMEOUT_MS fallback
Switching the override lookup to OPENCLAW_HANDSHAKE_TIMEOUT_MS breaks existing callers that still set OPENCLAW_TEST_HANDSHAKE_TIMEOUT_MS; this commit does not update those call sites, so gateway tests now silently use the 10s default. In particular, src/gateway/server.preauth-hardening.test.ts expects idle sockets to close in under 1s and will fail once the override is ignored, and other suites that relied on short overrides become significantly slower. Please preserve backward compatibility for the old env var (or migrate all known callers in the same change).
Useful? React with 👍 / 👎.
…EST_HANDSHAKE_TIMEOUT_MS Keep backward compatibility for existing callers. Addresses Codex review P1 suggestion on PR openclaw#49049.
…r backward compat Added constants for payload limits and handshake timeout.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d156147097
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| }; | ||
| export const DEFAULT_HANDSHAKE_TIMEOUT_MS = 3_000; | ||
| export const DEFAULT_HANDSHAKE_TIMEOUT_MS = 10_000; |
There was a problem hiding this comment.
Update the client challenge timeout alongside the server timeout
Raising DEFAULT_HANDSHAKE_TIMEOUT_MS to 10s only extends the server-side idle-socket timer. The default GatewayClient path still gives up after 2,000ms if connect.challenge has not arrived (src/gateway/client.ts:699-712), so any event-loop stall between 2s and 10s will continue to fail the handshake before the client can send connect. For callers using the default connectDelayMs, this change only fixes the 2-3s window and leaves the reported busy-loop failure mode in place.
Useful? React with 👍 / 👎.
Summary
Increase the default WebSocket handshake timeout from 3 seconds to 10 seconds to fix spurious gateway closed 1000 errors when the event loop is busy.
Changes
Fixes