Repository navigation
fix: native Gateway setup loses startup window to slow validation - #1952
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 gives configuration validation a separate timeout before starting the native Gateway admission deadline. Example: Configuration validation takes 87 seconds and Gateway preparation takes another 165 seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open: it makes a focused correction to its lower stack's admission deadline, and no concrete introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherNativeGatewaySetupService creates a staged setup session; the session validates configuration, authorizes the package-owned runtime, and passes its remaining admission allowance to NativeGatewaySetupConnection. flowchart TD
A[Native setup page] --> B[Setup service]
B --> C[Setup session]
C --> D[Configuration validation]
D --> E[Bounded runtime authorization]
E --> F[Operator connection and pairing]
Technical reviewBest possible solution: Keep validation outside the one-shot admission deadline in the existing session owner while preserving bounded startup, cancellation, and fresh ownership checks. Do we have a high-confidence way to reproduce the issue? The pinned base starts admission before validation, so 87 seconds of validation plus 165 seconds of preparation exceeds its 210-second allowance; this source path belongs to the lower stack rather than current main. Is this the best way to solve the issue? The patch is a small complete fix for validation consuming admission time, but it does not establish that every reported slow Gateway launch will finish within the unchanged startup ceiling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a4dd026cc5f8. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 October 31, 2026, 12:38 PM ET / 16:38 UTC. |
Hanselman dual-model reviewScope: PR #1952, head Reviewers: Claude Opus 5.5 ( Both Models Agree: HIGH consensus No shared findings. Only One Model Flagged: LOW consensus
Impact and suggested fix: A retry can spend, for example, 87 seconds validating and 165 seconds starting, exceeding the 210-second admission budget even though startup itself fits. Apply the same separation to the retry/restart path: bound validation independently, then start the admission budget immediately before runtime authorization/startup, while preserving caller cancellation. This is a one-reviewer finding and is not HIGH consensus. |
f47cfa3 to
8499d9a
Compare
Co-authored-by: Copilot App <[email protected]>
Hanselman review (local rebased state)Reviewed local commit Reviewers:
Opus reported 171 targeted setup/CLI tests passing. No fixes were made as part of this review. The separate retry-path fix is also still local and has not been pushed. |
Run legacy restart validation before a new admission window without renewing existing deadlines. Preserve the configurable native CLI validation timeout and reject exhausted retries before restart side effects. Co-authored-by: Copilot <[email protected]>
09118d5 to
d10894e
Compare
6e346f1
into
openclaw:karkarl-native-setup-finalization
* fix(connection): retry while the Gateway reports startup unavailable Honor bounded structured startup retry hints without changing auth, pairing, provenance or caller deadlines. Co-authored-by: Copilot App <[email protected]> * fix(connection): exclude stale startup state during a new upgrade Co-authored-by: Copilot App <[email protected]> * improve(setup): record safe native Gateway handshake phases Co-authored-by: Copilot App <[email protected]> * docs: name a single handshake ownership guard Co-authored-by: Copilot App <[email protected]> * fix(setup): preserve handshake diagnostic identity and categories Keep client attempt ordinals unique across replacement native setup sessions. Classify observed transport failures without scanning exception stack frames, leaving existing failure policy unchanged. Cover both regressions and document the page-owned file sink boundary. Co-authored-by: Copilot App <[email protected]> * fix(setup): align handshake sink with rebased logger owner Use the setup host's current logger parameter and describe window-owned sink lifetime after the lower stack's main rebase. No UI, logging lifetime or handshake policy changes. Co-authored-by: Copilot App <[email protected]> * fix(connection): observe keepalive transport disconnections Cover the upstream-added keepalive cancellation path with the same current-generation disconnect observation as adjacent transport loss paths. Extend the existing real-socket ping timeout test to protect generation and ordering without changing recovery or timing policy. Co-authored-by: Copilot App <[email protected]> * fix(setup): keep native Gateway admission within one owned attempt Share the launch-to-operator budget across preparation, authorization and retries. Use optional packaging launch receipts for conditional, attempt-owned cleanup without changing shipping v1 compatibility. Co-authored-by: Copilot App <[email protected]> * test(setup): preserve staged authorization under admission cancellation Update the existing ownership guard for preparation's linked caller, session and admission-deadline token. Co-authored-by: Copilot App <[email protected]> * fix(setup): preserve startup rejection across cancellation disposal Capture the current transport rejection before prompt cancellation disposal and synchronize the callback before classifying a delayed continuation. Preserve caller and session cancellation, and reject stale startup state after a fresh transport. Co-authored-by: Copilot App <[email protected]> * fix(setup): integrate admission layer with updated native startup owners Use the existing logged package invocation and result parser for receipt operations. Align independent fake-clock thresholds and documentation with the inherited five-minute startup budget plus thirty-second handoff allowance, preserving the existing production deadlines. Co-authored-by: Copilot App <[email protected]> * fix: native setup cannot remain stuck finishing indefinitely Bound production finalization and restart publication with one retained execution deadline across retries. Join admitted work through late settlement before releasing setup ownership. Co-authored-by: Copilot App <[email protected]> * fix(setup): report expiry when retry deadline has elapsed Keep the original execution deadline and reject late retries with the existing timeout diagnostic rather than an unrelated replay error. Co-authored-by: Copilot App <[email protected]> * test(setup): follow startup-derived finishing execution budget Advance lifecycle clocks to the configured execution window after lower-stack startup defaults changed. Keep timing defaults independently asserted and avoid duplicating the default in finishing documentation. Co-authored-by: Copilot App <[email protected]> * fix: native Gateway setup loses startup window to slow validation (#1952) * fix: preserve native startup budget after slow validation Co-authored-by: Copilot App <[email protected]> * fix(setup): preserve validation timeout and reject exhausted retries Run legacy restart validation before a new admission window without renewing existing deadlines. Preserve the configurable native CLI validation timeout and reject exhausted retries before restart side effects. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Copilot App <[email protected]>
What Problem This Solves
Fixes: native Gateway setup can roll back before the configured startup window when
config validate --jsonis slow.User Impact
User impact: A successful configuration validation no longer consumes the bounded native Gateway admission window; the Gateway receives its full configured startup budget.
Why This Change Was Made
Configuration validation now has its own two-minute timeout and must return successfully before the one-shot admission deadline starts. Later retries keep using that same deadline. The package has no verified attempt-bound startup progress callback, so repeated
startingsnapshots and unverified Gateway log phases do not extend the absolute startup ceiling.Evidence
config validate --jsonexited 0 after 87.2 seconds, then the shared 210-second deadline rolled back 118.4 seconds after the start request.SlowConfigurationValidation_DoesNotReduceNativeStartupBudgetadvances a manual clock by 87 seconds for validation and 165 seconds for startup, then confirms preparation succeeds without charging validation time to the admission window.Change Type
Scope
winnodeRequired proof pools
none: No capacity-dependent pool directly validates this native Gateway startup-budget contract. The WSL Gateway pool is not native Gateway proof. The post-fix isolated Companion/Gateway rerun is pending with the coordinator.Validation
.\build.ps1- PASS. Windows ARM64 host; Debug build targetedwin-arm64. Documentation and proof-pool validation passed.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --verbosity minimal- PASS: 4,847 passed, 24 skipped.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --verbosity minimal- PASS: 4,754 passed. An earlier full run had two unrelated failures; their focused reruns passed, and the final full Tray run passed.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --filter 'FullyQualifiedName~NativeGatewaySetupTests|FullyQualifiedName~NativeGatewaySetupConnectionTests' --verbosity minimal- PASS: 137 passed.dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore --filter 'FullyQualifiedName~IsolatedGatewayRuntimeTests' --verbosity minimal- PASS: 75 passed.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --verbosity minimal- FAIL: 15 failed, 2,488 passed, 1 skipped (2,504 total). All 15 areGatewayPackageCleanupTests; the host execution policy blocks loading their generatedreceipt-test.ps1. This is unrelated to the startup-budget change.git diff --check- PASS. The tested uncommitted diff hash8add7a4c166914f82f158e668aa2df6d480a16a2matches the committed diff for09118d5ca8c78e942c9b4b935196098bc7c7d29c.tray-tests,ui-tests, andsetup-e2e; those hosted lanes have not run yet.Real Behavior Proof
win-arm64build and automated tests. No Companion or Gateway process was launched.09118d5ca8c78e942c9b4b935196098bc7c7d29c; the test-run candidate diff hash matches this commit's parent-relative diff (8add7a4c166914f82f158e668aa2df6d480a16a2).SlowConfigurationValidation_DoesNotReduceNativeStartupBudgetpasses with 87 seconds of validation and 165 seconds of startup.Yes/No/N/A): N/A.Security Impact
NoNoNoNoNoYes, explain the risk and mitigation: N/ACompatibility and Migration
YesNoNoReview Conversations