Repository navigation
fix(gateway): keep long probe timeouts from failing immediately - #186528
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves long Gateway probe budgets by scheduling the existing monotonic deadline in safe timer intervals. Example: Probe a healthy Gateway with --timeout 2147488648.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review This PR fixes a current timeout-overflow bug with the existing deadline scheduler; no actionable defects remain, and exact-head CI passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe gateway probe CLI combines discovery and local, remote, and SSH checks under one deadline, then emits reachability and diagnostic results. flowchart TD
A[Gateway probe CLI] --> B[Parse selected budget]
B --> C[Monotonic deadline]
C --> D[Existing deadline scheduler]
C --> E[Discovery and target probes]
D --> F[Shared cancellation signal]
F --> E
E --> G[Reachability and diagnostics]
Technical reviewBest possible solution: Merge the focused scheduler reuse while preserving the existing shared deadline, cancellation, and diagnostic contracts. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes the overflowing timer, and the supplied built-CLI trace reproduces the failure twice with --timeout 2147488648; this read-only review ran no target code. Is this the best way to solve the issue? Yes: the existing scheduler already handles long deadlines and cancellation, making reuse smaller and safer than adding a cap, parser policy, or timeout manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2ecb073b2cf. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +5, Tests -2, Docs +2. Total +5 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 28, 2026, 1:52 AM ET / 05:52 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Built-CLI proof on Linux arm64, Node v24.22.1, against a real isolated loopback Gateway. Main This proves actual transport hello/reachability, not privileged diagnostics success. The limited RPC result was preserved, not suppressed or converted to success. Normal 5000ms probes before and after each long-budget probe succeeded on both refs. Tiny 1ms timed out. Invalid 35 focused tests passed: probe command and existing scheduler. Identical consolidated test on main: ordinary case passes; long case fails because it aborts before the selected budget. Existing deterministic scheduler tests exercise 30-day rearming; no physical multiweek wait is claimed. Regression test delta is -2 lines, with no baseline increase. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…528) fix(gateway): keep long gateway status probe timeouts from firing immediately gateway status accepted a --timeout above the native timer limit and passed it straight to a timer, which overflows to about 1 ms, so the probe reported the Gateway unreachable at once. The probe deadline now uses the existing scheduleAbsoluteDeadline helper. Evidence: built CLI against a real Gateway on Linux, Node 24.22.1. On main the overflowing timeout failed immediately with an overflow warning (twice); with this change the probe connected in about 210 ms with no warning (twice). The rpcOk false, scope-limited and missing-read-scope results are unchanged, and the normal, tiny and invalid timeout controls behave the same on both refs. Details: openclaw/openclaw#186528 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @obviyus for reviewing this and running the extra verification! |
…claw#186528) fix(gateway): keep long gateway status probe timeouts from firing immediately gateway status accepted a --timeout above the native timer limit and passed it straight to a timer, which overflows to about 1 ms, so the probe reported the Gateway unreachable at once. The probe deadline now uses the existing scheduleAbsoluteDeadline helper. Evidence: built CLI against a real Gateway on Linux, Node 24.22.1. On main the overflowing timeout failed immediately with an overflow warning (twice); with this change the probe connected in about 210 ms with no warning (twice). The rpcOk false, scope-limited and missing-read-scope results are unchanged, and the normal, tiny and invalid timeout controls behave the same on both refs. Details: openclaw#186528 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
An accepted
gateway probe --timeoutabove Node's native timer limit becomes a 1 ms timer. A healthy Gateway can therefore appear unreachable immediately, accompanied byTimeoutOverflowWarning.User Impact
Long selected budgets no longer fail immediately. Ordinary and invalid timeout handling and reachable-but-scope-limited diagnostics retain their existing behavior.
Why This Change Was Made
The probe already owns an absolute monotonic deadline. Reuse
scheduleAbsoluteDeadlinewith that same clock to chunk long waits and cancel it in the existingfinally. No new cap, timeout policy/default, parser, protocol, SDK, discovery, SSH, TLS, or authorization change.Evidence
Observed runtime capture.
Built CLI and real loopback Gateway in secretless Linux arm64 Docker, Node 24.22.1, with isolated profile/HOME/state/config:
--timeout 2147488648ok:false, connection timeoutok:true, real connection in 217/208 ms5000ms probes before and after each long-budget run succeeded on both refs. Tiny1ms probes timed out;0,-1,invalid, and1.5retained validation failures.rpcOk:false,scopeLimited:true,missing scope: operator.read. This is reachable/degraded, not privileged diagnostics success.Simplification: folded the added deadline cases into the existing discovery/unfinished-probe table and reused scheduler coverage. Removed duplicated fixture setup and the mock's competing late-timeout timer. Production +10/-5, tests +21/-23 (net -2), docs +2; no ceiling raised.
Two-way door: reverting restores native timer overflow; no migration or new stored format. Blast radius is the CLI probe's overall deadline and cleanup, not Gateway service or authentication policy.