Repository navigation
fix: avoid premature timeouts when completing native AI setup - #1582
Conversation
Bound acknowledged owned startup polling without relaxing listener provenance. Separate previous-page drain from read-only exact-model proof and allow native handoff startup overhead. Document the installed package's ambiguous pending-start contract blocker. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 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: blocked before merge. Reviewed October 2, 2026, 3:27 AM ET / 07:27 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch gives native AI setup separate readiness deadlines, persists a non-renewable destination handoff window, and adds localized timeout guidance and regression tests. Merge readiness⛔ Blocked before merge - 4 items remain The timing fix remains necessary on current main, and the merged recovery PR does not supersede it. No discrete blocking code defect was found, but the previous upgrade-compatibility decision and repository-required runtime proof remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherWindows Companion verifies the selected Gateway and AI model before finishing onboarding and opening the selected app destination. After a restart, a profile-local handoff record carries that selection through fresh connection, ownership, model, and navigation checks. flowchart TD
A[Verified AI selection] --> B[Completion chooser]
B --> C[Persisted destination handoff]
C --> D[Exclusive bounded execution]
D --> E[Gateway and model verification]
E --> F{Authority still matches?}
F -->|Yes| G[Open destination and consume handoff]
F -->|No or timeout| H[Visible recovery guidance]
Decision needed
Why: The new persisted execution provenance intentionally changes an existing retry contract; rejection tests and contributor documentation do not establish accepted user impact or successful recovery. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep finite phase budgets and fresh authority checks, with an approved handoff upgrade contract and a visible app path for obtaining new verification when an old retry record is rejected. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main shares a 30-second deadline across page drain and model verification, so otherwise successful work exceeding that combined limit is cancelled. Deterministic regression fixtures cover this collision; no live current-main reproduction was executed. Is this the best way to solve the issue? Unclear overall: separate finite deadlines are a focused repair, but the persisted retry-format change still needs an approved upgrade contract and demonstrated app recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4c9a7a829a27. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
Keep unused handoff admission at five minutes while persisting one non-renewable execution lease. Bound both connection borrows, recovery, exact-model proof and navigation; preserve authority and single-use checks. Cover cancellation, repeated polling and process-restart expiry with isolated fixtures. Co-authored-by: Copilot App <[email protected]>
Hanselman review verdictReviewed baseline Both models agree: HIGH consensus
Only one model flagged: LOW consensus
The user has now requested fixes for all flagged issues. Remaining changes will preserve exact ownership, route/device/session/model checks and single-use handoff semantics; no arbitrary failed start response will be accepted. Validation at Proof blockers remain: current-head strict MXC and native/UI completion are not verified while user manual testing holds the shared host. Baseline |
Address remaining review findings with bounded late-start confirmation, a fresh attested listener transition check, native-specific credential reauthorization deadlines, and sanitized localized completion diagnostics. Co-authored-by: Copilot App <[email protected]>
|
Implemented the actionable Companion findings in
Final full Release build passed. Shared: 4222 passed/35 skipped; Tray: 3885 passed; Connection: 1526 passed/5 skipped; SetupEngine: 2214 passed/1 skipped. One preceding SetupEngine run hit the known fixture disposed-semaphore teardown race; focused 27/27 and a repeated full build plus all suites then passed without source changes. Exact commands/results are in the updated PR body. Still draft: current-head native/UI/strict MXC proof is blocked by the active manual-test slot. The installed package's ambiguous failed Starting response after 90 seconds still needs an upstream contract fix. Conditional fixtures do not prove that installed path. No installed apps, Gateway or Local AI state were changed or stopped. |
Preserve managed Local AI intent alongside bounded verification and fresh connection checks. Co-authored-by: Copilot App <[email protected]>
|
Resolved the conflict with main in 1fbca31 (merged main da8f98a). The verifier retains both RequiresManagedLocalAi propagation and timeProvider-based bounded verification. Fresh post-recovery borrowing and exact authority/model checks are unchanged. The resolved verifier matches the previously integrated 6ccddce0 file exactly. Focused rubber-duck merge review found no issues. Current merge-head validation (isolated OPENCLAW_REPO_ROOT and OPENCLAW_TRAY_DATA_DIR; sequential suites):
Test invocations also used Not verified / blocked: strict |
What Problem This Solves
Fixes premature AI-ready completion and post-restart destination timeouts when successful native connection, recovery and model verification take longer than the previous combined deadlines.
User Impact
Users get separate bounded completion phases and localized timeout guidance while exact model, route, device, session and listener ownership remain mandatory. An unused destination handle still expires after five minutes. First exclusive acquisition grants one non-renewable execution window shared by explicit retries and process restarts.
Installed-package blocker remains: MSIX 2026.9.700.0 at packaging commit
133deeb1a5efac2bcbc6564c90c038a999e6e842returns exit 1 forStartingafter 90 seconds and omits structured Gateway state from that response. Pending status does not attest launch identity. This PR still rejects that ambiguous failure. Conditional polling fixtures do not establish support for that installed contract. Draft pending upstream packaging and current-head native/UI proof.Why This Change Was Made
The chooser separates a 30-second page drain from six-minute verification. Authorization can start/roll back its owned runtime; provider writes and finalization are excluded from that deadline. Successful finalization remains one-shot.
SetupNativeCompletionTimingcentralizes two 210-second authenticated connection/authorization phases, a 210-second join of already-admitted Local AI recovery, 150 seconds for exact-model verification including its existing 120-second RPC, and 30 seconds for navigation. Total execution ceiling: 810 seconds. Underlying owner failures or shorter caller deadlines still win.SetupDashboardHandoffStoreretains five-minute unused admission and atomically persists execution start and absolute expiry under its exclusive file lock. Retries cannot refresh either value. Malformed, expired, interrupted in-flight and legacy retry records without execution provenance fail closed. The launcher consumes only after fresh authority checks and successful presentation. Gateway credential lifetimes are unchanged.IsolatedGatewayRuntimepolls only after a successfully acknowledged own start. The 180-second start/readiness budget permits a bounded ten-second confirmation allowance after late acknowledgement, at most 190 seconds for start/status and always subordinate to the caller deadline. A pending-status/listener transition gets one fresh status recheck, not another Start. Only fresh Running plus unchanged complete port/process attribution can succeed. Terminal states, unattributed listeners and identity drift fail closed.Native credential reauthorization now has 210 seconds; non-native five-second behavior is unchanged. Typed phase diagnostics preserve safe startup messages, localize specific completion timeouts and log only exception type/finite phase. The coordinator's aggregate deadline uses neutral readiness guidance rather than incorrectly blaming inference.
Docs pin the needed upstream pending-start/launch-identity/guarded-stop contract. Gateway 9.4 success versus 9.7 failure is correlation, not a controlled regression measurement. Local AI ownership recovery remains separate.
Evidence
Deterministic fixtures cover 275-second verification and 745-second recovery/reconnection/verification plus 25-second navigation, reaching the destination exactly once. Receipt tests cover concurrent first acquisition, unchanged deadlines across restart/retries, malformed/legacy records, expiry, backward clocks and late callbacks. Runtime tests cover 68 successive two-second polls, cancellation during awaited start/status, late acknowledgement, a safe listener-transition recheck and rejected attribution drift.
Actual runtime/authorizer composition succeeds with 197 seconds of preflight/start/confirmation/inspection, while slower preflight correctly hits the outer 210-second deadline and rolls back. Native reconnect tests allow 187 seconds and reject deadline expiry, cancellation and record drift. Real local fixture Gateway/manager tests exercise verifier phase cancellation and subsequent successful exact-model verification. Six-locale presentation contracts reject arbitrary exception-message rendering. None of these fixtures starts the installed Gateway.
Hanselman verdict: independent Claude Opus 5.5 and GPT-6 Astra found no HIGH/CRITICAL regression. All actionable Companion findings are addressed in
ac86c3a9and8d8fd60c; the disputed support claim and read-only wording were clarified. Narrow Opus re-review found no blocking/HIGH/MEDIUM defects. Its two LOW notes were addressed by real deadline-composition tests/documentation and neutral aggregate timeout labeling. Source review does not substitute for native/UI proof.Change Type
Scope
winnodeRequired proof pools
windows-11-arm64: native startup/completion; Release ARM64 build passed, real native delayed-start/completion not verified.windows-wsl-mxc: required setup regression proof. Current head blocked by active user manual testing. Baseline2b44d33passed 18/18; that is not current-head proof.windows-wsl-gateway-e2e: current head needs coordinated isolated Gateway setup/pairing/invocation proof; same shared-host blocker.windows-winui-interactive: current-head visible completion/recovery/cold navigation and timeout guidance remain unverified.Validation
Final source:
8d8fd60c3cecfe6293b0acff53ad9b5c3a47d96c.OPENCLAW_REPO_ROOTset to the isolated worktree; Tray settings isolated. Tests actually ran, sequentially.powershell -NoProfile -ExecutionPolicy Bypass -File .\build.ps1: previous attempt BLOCKED at Debug WinUI output copy by user-driven manual app PID 15008. App was not stopped. Full Release build below used unlocked output.powershell -NoProfile -ExecutionPolicy Bypass -File .\build.ps1 -Configuration Release: PASS, all five projects, ARM64, final sources.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger "trx;LogFileName=Shared-all-flags-closeout.trx" --results-directory .\TestResults\Timing --verbosity quiet: PASS, 4222 passed, 35 skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger "trx;LogFileName=Tray-all-flags-closeout.trx" --results-directory .\TestResults\Timing --verbosity quiet: PASS, 3885 passed, 0 skipped, 0 failed.dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore --logger "trx;LogFileName=Connection-all-flags-closeout.trx" --results-directory .\TestResults\Timing --verbosity quiet: PASS, 1526 passed, 5 skipped, 0 failed.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --logger "trx;LogFileName=SetupEngine-all-flags-closeout.trx" --results-directory .\TestResults\Timing --verbosity quiet: PASS, 2214 passed, 1 skipped, 0 failed.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --filter FullyQualifiedName~NativeGatewaySetupConnectionTests --logger "trx;LogFileName=NativeConnection-all-flags-rerun.trx" --results-directory .\TestResults\Timing --verbosity quiet: PASS, 27 passed, 0 failed.powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\validate-mxc-e2e.ps1 -NoBuild: NOT RERUN for this head. Shared-host manual-test slot remains held; no app/service was stopped to obtain it. Baseline2b44d33strict run passed 18/18 with no skips and fixture teardown exit 0.The preceding full SetupEngine run failed one case with the previously observed
FixtureGatewayServer.CloseConnectionsAsyncdisposed-semaphore teardown race. All 27 native connection fixture tests then passed, followed by another complete build and all four full suites passing without source changes. Earlier build-contention failures also passed sequential reruns. Final local evidence:TestResults\Timing\*-all-flags-closeout.trx; these are not uploaded artifact links.Real Behavior Proof
8d8fd60c3cecfe6293b0acff53ad9b5c3a47d96cfor automated fixtures/build only.Yes/No/N/A): N/A; no external artifacts or screenshots attached.Security Impact
Yes/No): NoYes/No): Yes, only the opaque profile-local completion receipt gains persisted execution timing. Gateway/device tokens and their lifetimes are unchanged.Yes/No): NoYes/No): No new surface; acknowledged startup can repeat read-only package status calls.Yes/No): NoYes, explain the risk and mitigation: Active execution may last up to 810 seconds after acquisition, but unused admission remains five minutes. Exclusive lease, immutable deadline, explicit retry, exact route/device/session/model proof, cancellation and single-use consumption remain mandatory. Malformed or provenance-less records cannot gain time. Longer native reauthorization preserves record/generation checks; diagnostics use fixed safe text and finite phases, never raw command output or arbitrary exception messages.Compatibility and Migration
Yes/No): Partially. Legacy unused records remain admissible only within their original five minutes; legacy retry/in-flight records lacking execution provenance are rejected, never renewed. No new packaging fields are assumed.Yes/No): No user configuration changes; only transient handoff receipt metadata changes.Yes/No): No automatic migration of authority.Review Conversations
The user-requested verdict is posted above; actionable Companion findings are implemented. This is a same-repository PR. GitHub rejected enabling the fork-collaboration flag with HTTP 422: "Fork collab can only be enabled on cross-repo pull requests." The template's maintainer-edit flag is therefore not applicable here.