Repository navigation
fix(setup): native Gateway setup rolls back a slow but progressing start after 180 seconds - #1993
Conversation
…art after 180 seconds Slow ARM64/x64 hosts reach a verified Gateway listener after about 165-210 seconds (openclaw#1969). The 180-second startup budget, which also covers the package start command's own ~90-second wait, expired first and setup stopped the still-starting Gateway. Raise IsolatedGatewayRuntime.DefaultStartupTimeoutSeconds to 300. The credential handoff, setup connection, chooser verification and execution window deadlines already derive from it and stay ordered. OPENCLAW_NATIVE_GATEWAY_START_TIMEOUT still overrides it. Add a regression test replaying the openclaw#1969 timeline (acknowledged at 90 s, unhealthy while polled, listening at 210 s) and a test that the outer deadlines outlive the startup ceiling. Express tests that hard-coded the old 180-second derivations in terms of the constants.
|
🦞👀 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 changesRaises the default native Gateway startup allowance from 180 to 300 seconds and updates its derived deadline documentation and tests. Example: An owned Gateway launch acknowledges at 90 seconds and reaches a verified listener at 210 seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: current main retains the reported 180-second limit, and this maintainer-authored PR provides a focused repair with no introduced correctness defect found. Priority: P0 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherNative setup and connection authorization call IsolatedGatewayRuntime, which invokes the installed package, polls startup status, verifies listener ownership, and either permits connection or rolls back its owned launch. flowchart TD
A[Native setup or reconnect] --> B[IsolatedGatewayRuntime]
B --> C[Package start and status commands]
C --> D[Fresh listener ownership checks]
D --> E[Credential authorization]
B --> F[Owned launch rollback on failure]
Technical reviewBest possible solution: Use the existing bounded startup owner with the 300-second default, preserving cancellation, fresh ownership verification, and original persisted deadlines. Do we have a high-confidence way to reproduce the issue? Current-main source establishes timeout followed by owned-start rollback, and the report supplies the corresponding log trace; this read-only review ran no builds, tests, or Windows reproduction. Is this the best way to solve the issue? This is the smallest complete repair for the observed 210-second startup using existing owners; the maintainer explicitly accepts the longer bounded waits, while underlying Gateway slowness remains separate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b55d522e8609. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel 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 Reviewed November 3, 2026, 4:44 PM ET / 21:44 UTC. |
Closes #1969
Related: NVBug 6934228, #1903, #1990, #1750
What Problem This Solves
Fixes: native Gateway setup fails at the verify step and stops a Gateway that is still starting when the host needs more than 180 seconds to reach a listener (observed 165-210 s on slow ARM64/x64 hosts).
User Impact
User impact: native Gateway setup now completes on slow hosts whose Gateway becomes ready within five minutes. A start that never becomes ready, and keeps reporting
startingorunhealthy, now takes up to five minutes (previously three) to fail. A start that reports a terminal state still fails immediately.OPENCLAW_NATIVE_GATEWAY_START_TIMEOUTstill overrides the budget (30-3600 s).Why This Change Was Made
IsolatedGatewayRuntimegives an owned native start one budget that also covers the package start command, which waits about 90 seconds itself. When that budget expired, setup rolled back (stopped) a start that was still progressing. This raisesDefaultStartupTimeoutSecondsfrom 180 to 300. The credential handoff, setup connection phase, chooser verification and execution window deadlines already derive from it, so every outer deadline stays longer than the runtime's own ceiling:Ownership checks, rollback rules and fresh listener verification are unchanged. Handoff records persisted by a 180 s build (1,620 s window) remain admissible after upgrade and keep their original deadline.
Known side effect:
NativeGatewayPackageClient.CommandTimeoutismax(3 min, StartupTimeout), so other package commands (setup,stop,companion prepare) can now wait up to 300 s before timing out. Status polls during startup remain bounded by the startup deadline. Left as is to keep this change minimal.Option considered and deferred: a "Retry with more time" setup action. A durable fix is a startup progress field in the package's
gateway-service status --jsoncontract (attempt-bound phase sequence), so Companion can fail on lack of progress instead of a fixed budget; that belongs in openclaw-windows-packaging.Evidence
SlowOwnedStartReachingListenerAtTwoHundredTenSecondsIsNotRolledBackreplays the [Bug] Native Gateway setup stops a progressing launch after 180s; same installation needs 210s to become ready #1969 timeline with a fake clock: start acknowledged at 90 s,unhealthywhile polled every 2 s, listener at 210 s. Before the fix it failed with the same message as the field log (did not report a verified listener within 180 seconds); it now passes with one start and no stop.DefaultNativeStartupBudgetCoversObservedSlowStartAndKeepsOuterDeadlinesOrderedchecks the default leaves at least 60 s over 210 s and that handoff, connection, verification and execution deadlines outlive the startup ceiling. It failed before the fix.Change Type
Scope
winnodeRequired proof pools
windows-11-arm64: the reported failure is native Gateway setup on a slow ARM64 host; a native setup with Store Gateway 2026.10.900.0 that becomes ready after more than 180 s is the real-behavior proof still needed.windows-wsl-mxc: required by repository policy for gateway setup/connect changes; run locally (see Validation).Validation
Run on Windows 11 x64 (10.0.26100) from the uncommitted tree identical to this commit,
OPENCLAW_NATIVE_GATEWAY_START_TIMEOUTunset:./build.ps1: all builds succeeded; documentation validation passed (71 files).dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 4,810 passed, 24 skipped, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 4,788 passed, 0 failed.dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj: 2,531 passed, 4 skipped, 0 failed (withOPENCLAW_REPO_ROOTset; rerun after the final review fix).dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore: 1,703 passed, 1 skipped, 0 failed..\scripts\validate-mxc-e2e.ps1: 18/18 passed, includingRealGateway_SystemRun_ExecutesThroughWindowsNodeMxcSandboxandRealGateway_SystemRun_BlocksWritesToTrayDataDirectoryInMxcSandbox..\scripts\validate-docs.ps1: passed.git diff --check(CRLF-aware): clean.Real Behavior Proof
.\scripts\validate-mxc-e2e.ps1; focused fake-clock regression replaying the [Bug] Native Gateway setup stops a progressing launch after 180s; same installation needs 210s to become ready #1969 timeline.Yes/No/N/A): N/Abudget 300s, readiness after more than 180 s and noRolling back the Gateway startentry inLogs\Setup\native-setup-<utc>.jsonl(poolwindows-11-arm64).Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/A. Credentials are still sent only after fresh listener ownership proof.Compatibility and Migration
Yes/No): YesYes/No): No (default ofOPENCLAW_NATIVE_GATEWAY_START_TIMEOUTchanges from 180 to 300; explicit values unchanged)Yes/No): NoReview Conversations