Repository navigation
fix(windows): discover Gateway Startup-folder launchers - #151674
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: blocked before merge. Reviewed September 28, 2026, 5:58 AM ET / 09:58 UTC (Revision 47). ClawSweeper reviewWhat this changesThe branch makes deep Windows Gateway inspection identify individual Startup-folder launchers, lets the live-build guard inspect those entries, and extends native proof tooling and operator guidance. Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open. Current main still lacks Startup-folder Gateway discovery, so the branch retains distinct work after its prerequisites merged. No discrete introduced code defect was established. The earlier timing concern is addressed, but the PR body still lacks the per-file test wall times required before merge. Priority: P2 Review scores
Verification
How this fits togetherWindows service inventory reads Scheduled Tasks and current-account Startup files for Gateway definitions, then supplies deep status and Doctor findings. Managed definitions also feed the build guard, which checks whether a running Gateway uses the checkout's output. flowchart LR
A[Scheduled Tasks] --> C[Windows service inventory]
B[Startup files] --> C
C --> D[Exact launcher inspection]
D --> E[Doctor and deep status]
D --> F[Managed bindings]
F --> G[Live build guard]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +306, Tests +2295, Docs +14, Config +47, Other +93. Total +2755 across 44 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain exact Startup-file identity through read-only discovery and the build guard, preserve the shipped updater fingerprint, and record measured per-file test costs before landing. Do we have a high-confidence way to reproduce the issue? Yes: on current main, install a Gateway launcher in the current account's Startup folder and run deep status or Doctor; the Windows inventory only enumerates Scheduled Tasks. This read-only review did not execute that Windows path. Is this the best way to solve the issue? Yes: the branch extends the existing inventory, exact launcher reader, and build guard while keeping Startup-file observations separate from Scheduled Task control. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 81a840ad3d12. 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 (46 earlier review cycles; latest 8 shown)
|
23966f8 to
19d63ff
Compare
Stop pnpm build and run-node auto-build from deleting hashed dist modules while a managed Gateway ExecStart still points at this checkout.
Cover the cleanTsdownOutputRoots path and refuse early in run-node so live managed Gateway dist cannot be wiped outside build-all.
Dispatch gateway stop/restart from existing dist, apply --profile before service inspection, and fence only physically overlapping checkouts.
Load daemon inspection lazily so tsdown fixtures and plugin-sdk dts generation do not import service-layout. Move run-node recovery tests to a sibling file so the line-cap ratchet does not grow.
Registered inventory must classify fully inspected unrelated commands without requiring an OpenClaw profile. Preserve resolved matching profiles for selected-service reads and all native definition revalidation. Reproduced through the real inventory collector after the installed Windows discovery fixture failed; retain the selected-service refusal control.
Merge pinned prerequisite c0f54ab after its main carry and shared discovery repair. Resolve the sole collector-test conflict with the already-reviewed Startup APPDATA fixture. Daemon, build-all, package workflow, native proof source, and dependency manifests remain unchanged from the reviewed Startup candidate. Receiving Startup, registered task, fallback, build-fence, build-all, and updater-handoff checks pass 353 cases with one existing skip.
Carry the shared stop, successful rebuild, and start guidance while keeping Startup-only siblings tied to their exact entry paths. An already-current update does not repair stale output. Fence tests pass 44 cases with one existing skip; script types, lint, formatting and independent P2 review pass. This copy-only successor is separate from the frozen f919 Windows package source.
Recognize the exact waiting VBS wrapper shipped by 2026.9.3 during owned service reconciliation. Keep custom launcher behavior unknown and preserve all command, root, Task and authority checks. The real audit entry point rejected this released form as TaskLauncher unknown-edit before repair. The causal regression and edited-launcher control pass with 55 audit and 140 backup/rewrite sibling cases.
Receive the qualified ec742 prerequisite through ordinary merge. The audit now recognizes the exact waiting VBS form shipped in 2026.9.3 while appended custom behavior remains unknown and preserved. Startup readers and shared deadlines are unchanged. Receiving audit, policy and Startup fallback tests pass 136 cases; core/services types, lint, formatting and independent P2 review pass. This does not establish a fix for update command settlement.
Retain bounded sanitized fields from the original published-update JSON before unchanged failure assertions. This preserves primary reasons and failed checks that the output tail can omit, without changing capture ceilings, command deadlines, process ownership, or cleanup.
Preserve captured autostart policy during update recovery; an explicit Gateway or Node start revalidates the selected task and its launcher/package or recorded wrapper before enabling and running it. Keep stronger local start fingerprints out of published update drivers serialized command shape.
Only an explicit disabled policy admits enabling. Preserve native Run for readable Tasks whose optional Enabled field is absent, while retaining typed failures for failed inspections. Keep the finalization fixture original gateway-entrypoint exports when replacing its install resolver.
Integrate pinned main and the qualified native source-build recovery owner, preserving exact Startup discovery and old driver command fingerprints. Record the installed disabled-task start proof separately from legacy published-driver failures. Retain canonical discovery-scope limits and the qualified Windows package-validation scratch setup.
A successful enable can remain after a later launch failure. Preserve the existing independently audited enable contract and require current authority for any further control; do not imply automatic rollback of a failed start.
Pass the existing Windows inspection allowance when the build fence reads an exact Startup entry. A stalled launcher read now aborts within that budget so the fence can still inspect and refuse a later live sibling. Preserve ordinary reader defaults and the cold native-Node import boundary. The real fence/state/file-reader regression fails before the fix and passes afterward. All 122 fence and Startup/deadline cases, selected type/lint/export checks, native Node import, and independent scoped review pass.
Merge pinned main 574927f, including the canonical task-readback, shared-worker retirement, and SQLite callback fixes required by observed CI failures. Preserve the Windows feature production postimages and current native service owners. Bind default-profile fixtures explicitly so isolated test profiles cannot change their selected Task or command hints. Clarify native service controls when a source checkout cannot run its CLI because the built runtime is missing. Validation: 289 unique receiving cases passed with one existing platform skip; full base-scoped checks, final affected type/lint checks, and five-pass independent review passed. Original ambient-profile failures, their controls, and published-driver campaign failures remain recorded. Existing native component receipts retain their exact source and package boundaries.
Merge fixed main aea578d after the prior CI exposed canonical Tasks retirement leftovers. All Startup feature postimages are unchanged. Preserve exact native proof boundaries and original published-driver failures.
Source-runner gateway stop and restart use the existing CLI by default. Explain that applying source changes requires the documented stop, build, and start sequence.
Preserve the reviewed fixed-main receiving state before resolving later canonical conflicts. The inherited UI line-cap failure and its subsequently landed repair remain recorded in task evidence. This checkpoint is local and does not replace the prepared public head.
Merge the pinned canonical main while preserving Startup discovery and exact-entry controls. Retain the current build exit and process-containment owners, remove the orphan runner hook, and use one private command copy for shipped updater fingerprints. Original native campaign and independently attributed fixture failures remain recorded.
Merge the exact landed prerequisite so the remaining PR contains Startup discovery and its proof tooling. Preserve canonical privacy and settlement diagnostics alongside exact Startup paths and published-result capture. Keep the original failed upgrade receipts and independently attributed baseline test/type failures explicit.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Prerequisites #151608 and #152875 have landed. This PR retains the remaining Windows Startup discovery, exact-entry inspection, and associated native proof tooling.
What Problem This Solves
Deep Windows inspection missed sibling Gateways installed in the Startup folder and could confuse a Startup file with a same-name Scheduled Task. That also prevented the existing build check from identifying a discoverable Startup-launched Gateway using the checkout's output.
User Impact
gateway status --deepanddoctor --deepidentify CMD/VBS Startup definitions by their exact paths. The selected fallback is excluded from extra-service findings only after Task absence and its definition are established. Unreadable, changed, or timed-out definitions remain incomplete inspection. Startup findings provide exact file-inspection guidance; their labels never grant Task Scheduler control over a login item.The existing live-output build check can inspect each Startup binding independently and name its exact entry in stop/start guidance. Operators must still stop every Gateway serving the output before rebuilding. This is a positive-evidence observation, not a lock or proof that unavailable inspection means no Gateway is running. Arbitrary active template instances without a definition/selector, system LaunchDaemon runtime, and future reuse of an absent dist path remain outside its stated scope.
Why This Change Was Made
The existing inventory, command reader, profile resolver, and service-state owners serve the flow. One existing inventory deadline covers Task enumeration, Startup scanning, launcher reads, and rereads. Each exact Startup read in the build check receives the existing 60-second Windows inspection allowance; an expired read is aborted so another live binding can still be checked. Private profile and selection facts remain distinct from public findings and mutation authority.
Startup selection provenance is excluded from fingerprints serialized by shipped updaters. Serialization uses one private copy, preserving authored override metadata and the original service snapshot. The shared inspection/XML helpers were extracted with their callers, and the obsolete start-repair wrapper was removed. There is no new CLI option, persistent schema, retention policy, or dependency override.
The native fixture composes bounded published-result capture with the now-canonical settlement diagnostics and verifies archive members directly on Windows instead of passing drive-letter paths to GNU tar. Relative to the landed prerequisite, the 9.4 serial body is 18→24 minutes and its workflow step is 22→28 minutes. The six-minute difference accounts for removing the 9.3-only authority phase (180 seconds) and adding two Startup build-fence commands (360 seconds) plus the fingerprint observer (180 seconds). Both outer steps retain three minutes for teardown and one minute of runner margin. These allowances predate the final prerequisite composition; the published update command still has the same 360-second acceptance limit. The wider outer window is not evidence that the old updater succeeds.
Evidence
The exact landed prerequisite
d09ffd222826is incorporated. Guarded disabled-Task start and the shared source-build/process owners are already canonical; they are not presented as new changes in this PR. The remaining diff is 44 files. Product postimages match the qualified fixed-main composition, while the ancestry intake preserves canonical privacy assertions, passive diagnostics, and declaration-fixture dependencies.The qualified composition passed 305 receiving cases with one existing platform skip, including all 19 shipped-fingerprint and Windows-task cases. One real CLI-output fixture failed its exact timeout-phase wording: port inspection reached the deadline instead of the polling interval. Its 16 relevant base owners match the independently observed failure in CI 36377146189. The original failure is retained, with no timeout/assertion relaxation or baseline-rerun claim. The branch-caused 701-line growth was repaired; both size guards, affected types/lint, and final P2 review passed. Earlier unaffected type graphs and selected checks are reused with their source bindings.
After prerequisite intake, the narrow receiving run passed all 266 cases with one existing platform skip. Production types and the fresh reduced-PR P2 review passed. The services test graph exposed two unchanged-main TS2459 errors: the package-update activation tests import
assertReliabilityForcedExit, which the canonical helper no longer exports. The helper, both callers, and the graph that directly includes them are unchanged fromd09ffd222826; this failure is retained separately from feature proof. Current-head hosted CI and native admission remain separately bound; older runs are not relabeled as current-head CI.Current-head CI 36398168032, attempt 1, executed merge
c9a35e6a75cb(baselineb140acb1ea3bplus head2ddb7c022154). The unchanged compiler setup rejected packed groups with differentOPENCLAW_TEST_PROJECTS_PARALLELvalues before any tests started. All eight relevant inputs match the baseline; canonical #160290 fixes this scheduling classification and passes six independent scheduler/loader controls. The operator authorized admin landing for this proven pre-existing failure. CI remains failed/cancelled: six successful jobs, 124 cancelled, 19 skipped and two failed including the aggregate. A cancelled build also ran its always-upload step after the producer was skipped; the complete missing-artifact failure is retained explicitly. Cancelled jobs are not passing coverage, and security/review admission remains required.The review's proposal to refuse every build on incomplete discovery was rejected after source-backed maintainer inspection: the invoking selector is retained, the established check fails open per binding, and the documentation expressly requires operator stop-first behavior. The limitation is retained rather than converted into a universal safety claim.
Windows feature proof 36266327232 passed its fresh cell on exact package/tooling
f919d94ee89a: distinct same-label CMD/VBS findings, selected-fallback exclusion with its sibling retained, unrelated Helper exclusion, retained missing-launcher diagnostics, and healthy exact-build RPC. All 12 commands joined, definitions were restored, and cleanup/retirement passed.The prerequisites' separate native Task authority 36287470943 passed four applicable control/refusal groups, including retained owned admission followed by foreign-root reassignment. Package Acceptance 36309132404 and installed-start proof 36311513816 authenticated package
2b0c929c76a0and tooling49903aa2e900. Its fresh cell proved public CLI disabled-Task start, exact-build RPC, seven joined successful commands, preserved files/XML apart from Enabled, and cleanup. Its unchanged three-cell reducer remained failed because the published-update cells were deliberately skipped. These are prerequisite/component receipts, not a new whole-package campaign.Canonical #159347's Windows test receipt ran 321 cases at
812235f31393; 18 complete affected blobs, including all six lifecycle owners and changed Windows tests, match through landed5232aba0030and the fixed-main composition. Catalog and dependency changes prevent whole-package equivalence. That receipt does not include a real installed candidategateway restartcell.Fixture timing and compatibility accounting
The authenticated fresh Startup cell measured its sibling Doctor/deep-status commands at 4.830/8.244 seconds and selected-fallback Doctor/deep-status at 4.196/7.808 seconds. The independent 9.4 diagnostic measured source-build refusal at 33.364 seconds and the original update failure at 271.433 seconds; the later recovery cell measured update failure at 253.992 seconds, repair at 78.047 seconds and the then-failing explicit start at 11.495 seconds. These are command wall times, not complete phase costs. No successful full 9.4 Startup/fingerprint tail duration is available: the old-driver failure prevented reaching it. The allowance is a bounded serial-fixture composition, not a measured successful full-campaign benchmark.
The automated stored-data classification for
lifecycle-core.tsdoes not apply: the change replaces the removedinspectGatewayServiceStartRepairwrapper with its exact existingreadGatewayServiceStatethencollectGatewayServiceStartRepairIssuescalls. It adds no storage writer, migration, schema or recovery protocol. Shipped fingerprint compatibility has separate direct regression coverage.Retained test-cost accounting
The remaining scope has 15 test entry files and eight support files. The following are available one-worker historical test-case duration sums in seconds, with source reuse as described above; they exclude transform/import overhead and are not per-file wrapper wall times or a uniform current-head benchmark. Support files run through their owning suites.
.test.ts)update-command-service-fingerprintupdate-command-service-maintenanceinspect.startupinspectinspect.windows.registeredinspect.windowsschtasks.installed-fingerprint-observerschtasks.installed-packageservice-audit-schtasks.windowsservice-audit.definition-factsservice-policy-preservationservice-stagelive-gateway-dist-fencedist-artifact-ownershipwindows-repair-worker-probeThe latest five-suite receiving run took 99.76 seconds wall time, with 266 passes and one existing skip; it also includes the prerequisite declaration and command-support suites. The earlier receiving run took 512.41 seconds and retained its one CLI-output failure; its separate 19-case fingerprint run took 88.29 seconds. These totals include runtime preparation and shared transform overhead. Current hosted CI failed during compiler setup before test execution, so it supplies no current test-file CI duration; its cancelled jobs remain unmeasured.
For the explicitly invoked native integration tier, historical fresh installed-start proof took 179.048 seconds of reported file test time / 202.38 seconds wrapper wall. The real installed CLI, Task Scheduler effects and joined cleanup are the contract that this slower platform proof covers. Historical failed 9.4 diagnostic measured 172 seconds preparation, 612 seconds run and one second join. Neither timing is a successful full published-driver benchmark. No new timing-only campaign was run, and missing measurements are not inferred from unit sums.
Retained published-driver limits
The original 9.3/9.4 full campaigns remain failed. No timeout, failing assertion, or full-campaign success criterion was weakened. Maintainer qualification accepts the stated Startup/component and operator-repair contracts without calling their combination a complete published-driver campaign.
The 9.3 report reached logical success and healthy candidate verification, but its old parent did not settle within the existing limit. Authenticated module/residual evidence 36285338074 records the old parent's loaded Koffi 3.1.6 module and matching addon/shim bytes in fixture-owned backups. This supports the retirement diagnosis without a direct filesystem error, stack, or mapped file-object identity. Current candidates already contain the forward cleanup fix; no old-parent backup authority is transferred.
The 9.4 driver naturally returned failure after its reported steps completed; its original first exception was not captured. In recovery proof 36299743396, candidate
update repair --yes --jsonsucceeded, reconciled the run, and preserved all 75,020 installed-prefix files in the gateway-only fixture. It correctly left the stopped Task disabled; its advised start exposed the gap subsequently repaired by the landed prerequisite. All 14 commands joined and cleanup passed. This is not a full published-driver success or a universal repair-prefix invariance claim.