Repository navigation
fix: native setup cannot remain stuck finishing indefinitely - #1927
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 changes before merge. What this changesThis PR gives setup finishing one execution deadline across retries while retaining ownership of admitted work until cleanup settles. Example: Native Gateway finalization remains pending for 27 minutes with the default startup allowance.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored draft addresses an unbounded finishing wait still present on main; one low-impact recovery-message defect needs correction. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherSetupWindow passes verified Gateway and model information to SetupCompletionPreparation, which drains the previous page, verifies readiness, finalizes setup, and publishes the Companion restart handoff. flowchart TD
A[Verified AI action] --> B[SetupWindow]
B --> C[SetupCompletionPreparation]
C --> D[Page drain and verification]
D --> E[Gateway finalization]
E --> F[Restart publication]
C --> G[Timeout presentation]
C --> H[Retained cleanup]
Technical reviewBest possible solution: Keep the existing completion owner’s deadline and retained cleanup, and display localized recovery guidance matching the available actions. Do we have a high-confidence way to reproduce the issue? Current main directly awaits finalization and restart publication without an execution deadline, so a nonsettling delegate leaves finishing pending; no runtime reproduction or tests were run during this read-only review. Is this the best way to solve the issue? Bounding observation in SetupCompletionPreparation while joining the real execution is the smallest complete repair using existing owners, provided timeout guidance reflects the recovery actions actually available. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4cbbe51c45a7. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What 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 29, 2026, 6:37 PM ET / 22:37 UTC. |
Honor bounded structured startup retry hints without changing auth, pairing, provenance or caller deadlines. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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]>
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]>
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]>
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]>
Update the existing ownership guard for preparation's linked caller, session and admission-deadline token. Co-authored-by: Copilot App <[email protected]>
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]>
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]>
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]>
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]>
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]>
f47cfa3 to
8499d9a
Compare
) * 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]>
Preserve validation-before-admission and retained finalization ownership while resolving current-main conflicts. Include the two deterministic chat test completion synchronizations. Co-authored-by: Copilot App <[email protected]>
Final Companion layer of the native Gateway recovery stack, stacked on #1926 (fix(setup): wait safely for native Gateway operator admission). Targets
karkarl-native-gateway-admissionatd99b6a7cc591de722d325f73f58c3822ae6e3427. Native Companion stack1928is now registered in order1917 -> 1924 -> 1926 -> 1927.What Problem This Solves
Fixes: Companion can remain on Finishing indefinitely when native Gateway finalization or restart publication stops responding.
User Impact
User impact: finishing reports an existing localized timeout after one finite execution window (27 minutes by default, following the existing native startup override), without enabling duplicate writes or restarts.
Retry cannot renew that deadline. Back and Retry remain unavailable while admitted work settles; Close remains the recovery action. Cleanup can outlive the presentation deadline because an admitted operation must not be abandoned. Signed Store Gateway x64/ARM64 and visible UI proof remain blocked by missing runtime authority, so this is a draft, not a merge-readiness claim.
Why This Change Was Made
SetupWindowactually callsSetupCompletionPreparation, not the similarly named destination coordinator. Keep ownership there: start one monotonic execution deadline on admission, request cooperative cancellation at expiry, bound the presentation wait, and retain/join the real execution plus prior page drain before releasing setup ownership.Preserve uncertain-finalization and confirmed-committed resume behavior, committed-publication exceptions, exact verification, pairing policy and durable registry ordering. The already-bounded persisted restart handoff is unchanged. No new operation registry, receipt API or blanket mutation retry.
The lower base advanced from
e41f54d4tod99b6a7conly to fix an existing Tray source-guard expectation for the linked admission token. No lower production source changed;git range-diffconfirms this layer's patch stayed identical across rebase.Evidence
Deterministic production-owner cases cover deadline after finalization/publication admission, exact expiry across retries and idle time, late success/committed-publication failure, caller cancellation, cancellation-honoring asynchronous cleanup, confirmed-committed resume, and refusal to duplicate mutation/publication. A narrow WinUI source guard protects Back while retained work is pending.
Negative control: removing only the bounded
_execution.WaitAsync(ct)observation made all four finite finalization/publication deadline/cancellation cases fail at their watchdogs. Restoring it passes. This is a targeted negative control, not a live installed-Gateway reproduction.Independent Copilot
rubber-duckreview covered the eight-file candidate plus unchanged finalization/close paths, with P0-P3 source and proof-plan assessment. Codex CLI was unavailable; reviewer model identity is unverified. It reported one blocking cancellation/ownership concern. Disposition: cancellation requests do not abandon the retained task; the native owner holds its gate through cleanup, and the window joins cleanup before releasing the session/setup lock. Retained cooperative cancellation and added a cancellation-honoring cleanup regression. No other findings reported. Supplemental test/comment and ledger-schema corrections were directly checked, not independently re-reviewed. This narrative fallback provides no helper-owned isolation, frozen-input checks or machine-clean verdict.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: current-head finishing timeout, pending-work Back/Retry gating and Close presentation on an authorized isolated native Gateway path. Not run; runtime authority unavailable.windows-11-arm64: signed native Store Gateway finalization/restart/late settlement on ARM64. Local ARM64 compilation does not establish this runtime contract.windows-wsl-gateway-e2e: shared finishing orchestration also serves managed WSL setup; real setup/pairing/handoff regression remains unverified.windows-wsl-mxc: required setup-to-node/MXC path remains blocked by runtime authority. No-AllowSkipresult is claimed.Validation
Final source:
4f2452bdbb71fd6da133315a25919a99e95e0698, clean task-owned worktree on native Windows ARM64. SetOPENCLAW_REPO_ROOTto this worktree andOPENCLAW_TRAY_DATA_DIRto an isolated session profile. Removed inherited integration/GPU/E2E/MXC opt-ins. Built Shared/Tray test projects first so--no-restorecannot silently no-op.All results below were rerun at that final head.
$rootis the isolated session evidence directory; TRX and command logs remain local..\build.ps1: passed, all five product projects, Debugwin-arm64; includes documentation validation (68 Markdown files).dotnet build .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --verbosity quietanddotnet build .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --verbosity quiet: passed, zero warnings/errors each.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'trx;LogFileName=head-shared.trx' --results-directory $root --verbosity quiet: passed, 4,847 passed, 24 skipped, 0 failed (4,871 total).dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'trx;LogFileName=head-tray.trx' --results-directory $root --verbosity quiet: passed, 4,754 passed, 0 skipped/failed.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --logger 'trx;LogFileName=head-setup.trx' --results-directory $root --verbosity quiet: failed with the 15 known host policy denials, 2,486 passed, 15 failed, 1 skipped (2,502 total). Every failure is in unchangedGatewayPackageCleanupTests; all 15 TRX messages confirm temporary scripts cannot load because running scripts is disabled. No policy/test weakening or unrelated fix.git diff --check: passed; tracked worktree clean.Before native stack registration, product build/test CI had not triggered for this feature-base PR;
.github/workflows/ci.ymlordinarily filters push/pull-request branches tomain/master. After native Companion stack1928registration, Build and Test run 40964792074 automatically started forpull_request, attempt 1, at exact head4f2452bdbb71fd6da133315a25919a99e95e0698. Latest verified state: in progress, not yet green (no conclusion). No workflow dispatch, retarget, or workflow configuration change was made. A bot dispatch is not product validation. All local results, review limitations and runtime-proof blockers above remain unchanged. The root layer's separate composer draft-text assertion failure remains unresolved and is not classified as a proven baseline/flake here.Real Behavior Proof
4f2452bdbb71fd6da133315a25919a99e95e0698.Passed! - Failed: 0, Passed: 84, Skipped: 0, Total: 84, Duration: 7 s - OpenClaw.SetupEngine.Tests.dll (net10.0).Yes/No/N/A): N/A. TRX/logs retained locally; no public screenshot/artifact links are asserted.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/A. Existing calls receive the whole-operation cancellation signal; retained ownership and uncertainty guards prevent replay.Compatibility and Migration
Yes/No): Yes. Intentional behavior change: finishing waits and retries share a finite in-process deadline; cleanup still joins admitted work.Yes/No): No. Reuses the existing startup-derived timing convention; no new setting.Yes/No): NoReview Conversations