Skip to content

fix: keep task recovery working across shared Gateway updates - #150153

Closed
steipete wants to merge 29 commits into
mainfrom
codex/task-recovery-reduction
Closed

steipete wants to merge 29 commits into
mainfrom
codex/task-recovery-reduction

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Do not merge this combined PR. It remains a draft preserving the original branch and source-bound evidence while focused replacements land.

The replacement update design is stop-first: refuse replacement while another Gateway uses the installation and tell the operator to stop it first. Automatic sibling updates are no longer part of that design. Session-identity work is being split into smaller storage, Doctor, runtime, and wire-boundary changes; the current direction uses qualified logical identities while retaining existing physical addresses and explicit adapters for published clients and durable data.

The historical landed checkpoint contains 53 named focused PRs. It originally reported 1,824 fewer application lines, 105 additional production-tooling lines, and 1,719 fewer application-plus-tooling lines. A subsequent reconstruction resolved all 53 canonical landings unambiguously and remeasured each actual first-parent diff using the same explicit classifier as the later accounting: 1,813 fewer application lines, 103 additional tooling lines, and 1,710 fewer application-plus-tooling lines. Tests/support add 8,837 lines and docs add 91 under that classifier. The original per-file accounting is unavailable, so the nine-line application/tooling discrepancy remains unattributed; both figures are preserved rather than silently combined.

This historical subtotal is not the current replacement-series total, and the overall net-negative goal is not yet established for the surviving series. The broader campaign merge count is not this umbrella’s replacement set. A separate actual-parent measurement of 16 subsequently named landings records +5,677 application, +1,376 production-tooling, +22,006 test/support and +228 documentation lines. Another bounded measurement of #160203, #160472, #160663, #160718 and #161110 records +3,648 application, +718 tooling, +6,720 test/support, +78 docs and one explicit unclassified configuration line. Those two later sets add 7,053 and 4,366 application/tooling lines respectively. They are partial named sets, not a complete series or overall repository LOC claim.

Recent verified landings are updater runtime (#153764), chat identity cleanup (#155664), selected-session queue protection (#155714), failed-steer UI ownership (#155746), registry fixture migration (#155727), TUI/CLI session ownership (#155872), registry dependency retirement (#155796), stored-session address preservation (#155886), prepared lookup-key reuse (#156035), explicit Doctor migration policy (#156034), native restart ownership (#155355), and session-method policy consolidation (#156071). The updater-runtime landing has source-bound build, compiled-worker, binding, sealed-smoke, and published-driver qualification. Its original failed outer proof and unattributed timeout remain recorded; recovered inner evidence and diagnostic CI reruns do not relabel those failures.

Registry retirement #155796 removed 121 application lines and 13 test/support lines while preserving the existing runtime owners. Its original profile-merge test failure remains unattributed. The authorized exact-head rerun passed the target and all 152 cases in its state group on different GitHub-hosted hardware; no production fix or unrelated-flake verdict is claimed. Native merge, main ancestry, and cleanup are verified.

Stored-session address preservation #155886 landed after exact-head CI, independent review, the exact candidate package, and both actual published 2026.9.4 updater cells passed. The proof preserves session IDs, lifecycle revisions, lineage, projected history-window ownership, and transcript bytes; repeated Doctor leaves the entire captured agent state identical. The legacy session.mainKey field remains accepted but ignored. Its conflict case preserves canonical main while the existing repair quarantines the divergent retired-main claim. The Testbox hosting run was intentionally cancelled after successful proof and lease cleanup; it is not relabeled as green CI. The actual landed delta is +83 application, +553 test/support, and +19 documentation lines, byte-identical to the qualified candidate. Native receipt, main ancestry, and cleanup are verified.

Prepared lookup-key reuse #156035 removes 12 application lines by carrying one ordered key plan through store reads and returned targets. Its 31 focused cases passed. Initial CI timed out in two existing Doctor/config fixtures and reported a subsequent cleanup-order failure; the cause remains unattributed. One unchanged-source rerun of the original five groups passed 3,280 cases with eight skips, followed by verified native landing and cleanup. No product fix or flaky-test verdict is claimed.

Doctor migration policy #156034 makes the existing removed-default-agent choice explicit at the Doctor boundary. The landed patch adds 15 application and 49 test lines, with 19 focused cases, green exact-head CI, and both actual published 2026.9.4 updater cells passing against the exact candidate package. Repeated Doctor preserves the captured agent state. Retired-agent sibling placement is proved at the canonical-repair boundary; whole-update migration can move or quarantine retired-main claims, and whole-config byte idempotence is not claimed. The hosting run was intentionally cancelled after successful proof and verified cleanup; it remains separate from green CI.

Native restart ownership #155355 removes 752 application lines and one tooling line by using the installed Gateway CLI and verifying every attempted restart. Known-empty native metadata and retained PATH ordering now preserve eligible service rebinds without weakening authority or definition checks. Its 354 selected tests, retained 76-case owner proof, exact-head CI, exact candidate package, native candidate-to-same-candidate rebind, and genuine published 2026.9.2 upgrade are qualified. The retained recovery cases use real orchestration with simulated native manager, HTTP, and package transport; no native failed-activation recovery is claimed. Original failed acceptance, the optional continuation-row diagnostic, and cleanup warnings remain recorded. Actual-parent delta, receipt, main ancestry, and cleanup are verified.

Session-method policy consolidation #156071 removes 79 application lines from one file. One per-method map supplies the existing targeting, profile, approval, and run-start predicates with their conditional rules intact. All 31 selected existing tests passed before and after; 7,452 equivalence assertions, selected changed checks, independent review, and exact-head CI passed. The landed patch is byte-identical to the qualified delta. Native receipt, main ancestry, and cleanup are verified.

Requirement disposition (bounded updates through September 29):

  • Managed service discovery and source-build protection are landed. #151608, merge 244d4419, owns the registered-service inventory and strict Windows reader. fix(windows): preserve registered Gateway task definitions #151463 was closed as superseded with its unique contracts and failed platform history explicitly transferred. #152875, merge d09ffd22, owns the live physical-dist build fence and selected-service failed-build recovery. Its final conflict composition passed 456 receiving cases, one existing skip, full changed checks and independent review. The maintained administrative route recorded its independently reproduced pre-existing CI planner overflow; skipped jobs were not called passing. Existing real Linux published-source-shell and Windows restoration/reassignment/disabled-start receipts retain their exact source/package identities. These establish the bounded build/recovery behavior, not whole shared-install admission.
  • Startup-only Windows discovery landed in #151674 (733ceac1). Its exact CMD/VBS binding, private profile provenance, aggregate inventory deadline and bounded Startup state read preserve diagnostic-only discovery and never confer Scheduled Task control authority. Its landed source exactly matches the reviewed candidate and carries the landed Upper prerequisite. Native recovery and cleanup completed, preserving the original base-modified refusal. Fresh-install, explicit-start and authority component receipts remain source-bound; none is relabeled as a whole published-driver campaign pass.
  • TUI, saved-pane and bounded client identity requirements are qualified. #158240 (df5e316a) keeps the selected agent/session owner consistent; #158639 (3bdec389) preserves saved-pane identity and leaves an ownerless raw-global pane unbound until explicit choice. #158845 (bc84e282) closes the old remembered-session/pointer-clear SQLite gap through awaited worker reads/writes/scan/CAS and joined normal shutdown, including awaited Doctor cleanup. Forced exit is not a persistence guarantee. #159166 (ccf4edde) qualifies exact existing-row precedence, shipped Home fallback, immediate-send readiness and physical history/send/reply/persistence. It preserves the public alias contract; the obsolete fix: keep session selection bound to its agent #152895 unconditional exact-main dialect is not being revived. #154069 (e0d80000) supplies the landed projection/readiness owner work. None of these is a whole-product async-completion claim.
  • Wire and media evidence have precise boundaries. Retained real browser→real Gateway evidence proves delayed/expired ACK handling, reconnect, successor ACK, retained selection and row update; the existing 18-case protocol/session-capability boundary additionally proves observer-versus-operation error ownership and clearing. Generic authenticated request/result/targeted-event payload preservation is separately proved. The stronger exact-event-label refinement failed amid a sessions.list/model-catalog readiness fault; that failure, unobserved label assertion and lost additional private diagnostic remain disclosed and separately routed. No observer-error banner or all-specialized-formatter claim is made. Source-bound before/after pairs for the TUI and saved-pane replacements were delivered and rendered in both destinations. All six attention images for landed fix(ui): keep questions and approvals in their conversation #151412 were recovered, inspected and delivered in the originating task and verified rendered in the PR; historical first-delivery/capture-location uncertainty is not misrepresented as a new UI run.
  • Runtime, cancellation and exactly-once work is partly landed and partly active. #159632 (0269af6f) owns worker reply admission/FIFO/generation custody and joined release. #159807 (15bb24e3) fixes mutable SessionManager rollback/view parity. #159943 (1fea5ee1) preserves correlated completion custody and marker→await-onSettled→terminal ordering; #160238 (da51d9ed) moves durable archive discovery/preflight to existing workers. #160035 (1ac31be0) retains the shipped conditional ACP cancellation contract. Native Stop #160203 has now landed as fd1467d4, qualifying the file-backed registered Stop path, source/session replacement and unknown-write custody through the existing worker. Requester wake #160472 landed as 10e951e8, retaining known-commit reconciliation without replay, surviving-sibling retry, restore fencing and marker→await-onSettled→terminal ordering. Both have verified complete native receipts and cleanup. Initial requester transfer #160778 has also landed as 437572e2, with matched merge parent/tree, all 92 reviewed postimages and complete native cleanup. Its independently attributed fixture failures and cancelled CI coverage remain explicit; this does not close ordinary announcement or Incognito work. Ordinary announcement bookkeeping, native/Incognito-only branches, prepared deletion/reset discovery, unqualified ACP/reset/conditional SDK cleanup, synchronous atomic replacement, and full retained/Incognito/session-storage execution still have named active owners and outstanding proof. The intentionally retired Tasks/TaskFlow domain is not restored. Partial worker proofs do not close remaining caller SQL, pending-input, Cron-descendant or compatibility obligations.
  • Atomic recovery remains with its dedicated owner. Landed fix: recover interrupted npm package updates #158491 does not fully supersede originals #144005 and #145169. Complete config/includes, database, Workshop/plugin-resource recovery and recovered-generation publication preserving later writes/configuration/history remain under that owner’s current work. Its retained proof-loss disclosure is not erased. The separate stale-release follow-up #160288 landed as 95414356, with its official 2026.9.6 installed-update cell and complete native receipt; that bounded repair does not close the broader rollback requirements. This umbrella does not duplicate that implementation or close those originals.
  • Observed shared-install publication protection landed in #160663 (e694fa75). It checks known managed consumers before stopping the selected Gateway and again at publication, preserves package --no-restart, and grants no sibling controls. Known untouched preparation refusals retire safely so a later update can proceed; retained runtimes exclude activation control journals; common finalization adopts a recorded delegated Doctor stop. Exact-head CI, receiving tests, independent review, native merge and cleanup passed. Linux proof covers early live-sibling refusal, successful publication to an exact healthy target, untouched disjoint peers, and a published 2026.9.6 manual lifecycle upgrade. The strict native Doctor-adoption cell remains unqualified because a watcher-owned restart left that branch unexercised; controlled producer/finalizer proof is separate. macOS GUI proof preserves actual loaded-job observation across plist changes without granting selected-service authority; positive live System-domain proof remains absent. This is bounded observed physical overlap, not exhaustive discovery of every consumer. The reference source-update script repair landed in #161110 (8953498f). Its existing Git runtime transaction prepares privately before stopping and publishing source/dependencies/output; the last observed-consumer check follows private Git import. Exact candidate cfe94b1e passed 200 receiving cases, full changed checks and independent review. Native run 36547729748 qualified stop refusal with the original installation intact, restoration before restart after a controlled publication fault, and ordinary success at the exact resulting target. All 80 command receipts joined and the task-owned service/account/lease were cleaned. The native administrative merge preserved three independently proved pre-existing workflow-fixture failures, the failed gate and all 67 cancelled jobs; canonical repair c7e89bc6 is separate from product qualification. Genuine released 2026.9.6 source proof now establishes the exact old-script limitation and supported manual path. Actual eb377 main/non-fast-forward and detached/locale-conflict refusals preserved PID 9387, native snapshots, all 141,282 runtime/dependency entries, and the seeded state. Neither old invocation reached dependency install or the three-argument adapter. The separate manual recovery stopped the installed-old service before selecting/building exact cfe; the manual build stayed stopped, Doctor restored the service, and explicit start confirmed already-running PID 14546. Real RPC build identity moved from eb377 to cfe, the selected unit/environment/root/database identities stayed fixed, and the authored disabled automation, scratch and workspace were unchanged while shared schema migrated 18→19 with integrity passing. All 131 receipts joined normally and owned cleanup/provider completion passed. This closes the genuine source-installation follow-through for those exact refusals and manual recovery; it is not automatic old-script success, a published npm-tarball cell or all-state migration proof. Immediate pre-refusal source files were checked by the bound fixture but not separately exported; retained initial/post inventories and native snapshots support independent comparison. The original setup attempt remains failed; the corrected preparation used ordinary complete history and unchanged bounds. Required one-worker follow-through also passed all seven full changed test files (194 cases), with exact costs and limits recorded separately from earlier sharded measurements. These changes cannot patch already-running shipped scripts, and the whole stop-first umbrella requirement is not closed. Positive-live macOS System-domain proof also remains unavailable: two isolated task-owned guest attempts were cleaned, with the final attempt unable to obtain maintained guest execution because Parallels Tools were unavailable; GUI component evidence retains its narrower scope.
  • Published Windows completion and series accounting remain open, with explicit recovery continuity now proved. The old 2026.9.3 parent still failed the unchanged command settlement bound; the loaded-addon/residual observation does not identify its active syscall or transfer backup authority. The separate actual 2026.9.4 recovery run, tooling 5388562f and candidate a68299da, completed public repair → disabled-task public start → selected/peer continuity. Repair reconciled the run and left the Task stopped/disabled; public start restored the exact candidate RPC/root. Selected start-time config/launcher/XML checks and peer PID/build/definition/install checks passed, all 16 commands joined, and fixture cleanup succeeded. This closes the post-disabled-start continuity gap only: the original automatic update still exited 1, and no whole-driver or full-matrix pass is claimed. A later bounded native diagnostic, tooling a5f20aad against the same a68299da candidate, source-binds a newer-content rejection in the shipped 9.4 getUpdateRun callback during Windows recovery handoff, after the capability check and before normal finalizer launch. The original noninstrumented first exception was not retained; the diagnostic does not establish the earliest exception of the whole invocation or the exact rejected schema number. Its per-command/fixture cleanup passed, while outer Vitest descendant cleanup remained unverified. All original red campaigns remain red. Early containment has now landed in #160718 (0703c215). Native run 36526721185 qualified the explicit package-lifecycle refusal before activation: selected and peer native identities, RPCs, files, prefixes and canaries stayed unchanged, as did shared versions 17/17, all 334 preexisting schema objects and all prior rows. The sole exception was the exact shipped updater’s first-use four-object ledger bootstrap and one run-bound row. That is safe containment, not automatic 9.4 completion. The Windows owner retains original-parent completion and the 9.3 diagnosis; no schema-version lie, old-reader weakening, or blind matrix retry is authorized. Actual-merge-parent application/tooling/test/docs accounting remains limited to named replacements; the historical 53-PR subtotal and broader campaign tally do not establish the final net-negative goal.

The old native restart helper branch #153643 is closed as superseded by #155355. Its closure disposition records the exact owner/caller removal and preserved restart-outcome suite; it explicitly does not claim new native Windows qualification. That resolves the historical helper disposition, not the remaining platform or whole-update contracts above.

The combined branch stays unmerged and must not be used as the next implementation base. The historical 53-PR subtotal and original source-bound evidence below remain retained; no new full-series LOC or completion claim is made. This umbrella stays open until the surviving requirements above have verified dispositions.

No production deployment or release is claimed.

Earlier verified landed replacements

The twelve recent landings above join these 41 earlier verified replacements:

#151416, #151430, #151450, #151607, #151447, #151432, #151435, #151840, #151842, #151836, #151892, #151652, #152107, #152116, #152195, #152795, #153387, #153596, #151412, #152466, #153637, #153749, #153838, #153947, #153868, #154219, #154669, #154790, #153814, #154863, #154867, #154972, #154776, #155058, #155125, #154985, #155157, #155098, #155307, #155291, #155120.

Historical description and evidence for the original combined branch

The following describes the original branch only. Its automatic multi-Gateway behavior, LOC figures, and proof do not describe the replacement candidates or clear their remaining gates.

Related: #92241

What Problem This Solves

Tasks can fail on missing runtime modules, remain waiting after interruption, or show another conversation's pending question or approval when Gateways share an installation or recover across updates.

User Impact

One updater coordinates the Gateways sharing an installation while preserving each profile's service, configuration, runtime intent, verification, and decision to remain stopped. Interrupted work resumes from its latest execution transcript, equivalent completion delivery stays idempotent, and questions and approvals stay with their originating conversation. Foreground replacement survives slow startup and releases agent database leases before candidate repair.

Published 2026.9.3/2026.9.4 updaters retain their first-hop limitations: let active work finish, stop sibling Gateways sharing the installation before that initial upgrade, then restart and verify them afterward. Their original shutdown path can cancel work still active when its drain expires. Same-install system services require their deployment owner to coordinate replacement. Out-of-band package replacement while Gateways run remains outside this repair.

Why This Change Was Made

Shared runtime publication and rollback have one owner; service policy and task state remain profile-specific. Only the origin publishes the final update result. The audit removes superseded update/Doctor paths, duplicate finalization decisions, session adapters, plist parsers, and private forwarding exports. Published-driver contracts and settlement of write-capable processes remain intact. Rotated runtime credentials reach the correct service refresh, explicit Responses strict-mode compatibility settings reach the provider, and recoverable plugin-path warnings remain in durable update history and JSON output.

Service discovery now includes macOS system/global consumers and binary plists, using one native decoder over captured bytes. External definitions retain their exact identity without granting native-service authority. Loaded or unverifiable external consumers remain protected. Malformed unrelated LaunchAgent plists no longer block updates; selected or recognizable Gateway definitions and captured OpenClaw/Clawdbot branding still require inspection when decoding fails. Positive system ownership blocks code replacement at update admission; Doctor retains its existing authority for state-only repair.

At 5dc7317102c8, product source is reduced by 33 lines. Including production tooling, the net reduction is 12 lines against main 1e6ca9fe6e39: 6,295 additions and 6,307 deletions. Tests, test support, documentation, and generated inventory are counted separately. Application deadlines and size limits are unchanged. Live ownership and write-settlement checks remain enforced. This change introduces no SQL schema migration. Published-driver upgrade evidence below covers the existing migration path. Changelog generation remains release-owned.

Evidence

The candidate passed the native discovery/publication, Doctor ownership, systemd target, and caller-cutover regressions. The main integrations passed 216, 122, and 227 focused cases, respectively. The malformed-plist regression failed before the fix; 108 discovery, native decoder, and service-ownership cases pass afterward, with nine existing platform skips. Two complete independent P0–P2 reviews passed before the final mechanical merge; the merge resolutions and automatic overlaps were independently checked. A further focused P0–P2 review passed for the plist fix. The 5552fbe1acec package build, tarball integrity/import graph, and exact-tarball macOS CLI/config/Gateway smoke passed with owned-process cleanup. The refreshed Linux shared-install live proof passed at 5552fbe1acec. Full changed checks passed there; the final focused changed checks also passed at b14038c40620 in a checkout with physical dependencies. Current-head CI run 35292975843 passed at 5dc7317102c8, including the corrected Node and UI E2E scenarios.

Retained real-provider evidence proves held-child recovery during shared-install updates, tool-result preservation across two cold restarts without command replay, duplicate-completion delivery, stale-replay refusal, and foreground replacement with all profiles preserved. Each result retains its original source and package identity; these are not described as fresh runs of the final candidate.

Live and integration evidence, including original failures
  • The subsequent UI E2E failure came from a lifecycle waiting hint without a registered approval. The fixture now follows the Gateway registration order and retains every original assertion. Main independently landed the same repair plus a deferred-snapshot race check; the merge keeps that exact test. Browser-free ACK/approval controls passed 26 cases, and focused review was clean. The unchanged browser assertions passed in current-head hosted CI.
  • CI at b14038c40620 exposed four stale test expectations in one Node shard: an eager-loader forwarding name and an optional refusal argument. 57ffca32627d repairs only those two tests; all 15 direct cases, targeted lint/formatting, and focused P0–P2 review pass. Production code is byte-identical to b14038c40620.
  • Fresh Blacksmith Testbox proof at 5552fbe1acec, run 35287758231, durable update 22799417-a9ae-4c7f-8562-336a053ed788: foreground and native-service profiles were replaced, the stopped profile stayed stopped, real provider replies worked before/after, and the foreground replacement survived a measured 12,000.466 ms startup delay. The wrapper exited 0, its 70-file evidence export verified, native cleanup reported zero errors, and the lease is completed. This retains its original source identity; the later main merge and macOS-only plist repair have separate focused proof.
  • Installed-driver update at 6654812bf6af: real provider replies, both running profiles replaced, held child resumed, one parent final, stopped profile and channel policies preserved. Published 2026.9.4 upgrade to that candidate verified removal of the old ACP chunk. Earlier published 2026.9.3 and system-service ownership cells also passed.
  • The native active-child test exposed ordinary stop cancelling waiting work after drain expiry. The repair writes the existing profile- and PID-bound restart intent before the authorized stop and clears it if stopping fails. Regression failed before the fix and passed afterward; ordinary stop behavior is unchanged.
  • Foreground Git update at d96f72612042 failed with durable doctor-failed because the closed Gateway retained an agent database lease. Four real-server regressions failed before the final-owner retirement repair and passed afterward, including sibling ownership, pending resources, incognito handles, and fatal close failures. Doctor's lease guard is unchanged.
  • Repaired foreground update at 8c76a1b06fca, run 6db32ec4-ce99-430e-af3e-be2897963765: durable succeeded, real provider replies before/after, all three profiles preserved, owned services cleaned up. Its initial fixture process exited 1 because it expected absolute receipt paths instead of the ledger's ~ home prefix. Corrected exact-path assertions and every remaining recorded assertion were independently replayed against retained, hashed inputs. The original startup-delay function passed unchanged: 12,000.916 ms preload delay, matching process identities/arguments, 20 observations of unavailability. The replay made no new live requests and does not turn the original fixture exit into a pass.
  • Cold-restart proof at 932c148c5cc7: all 9,925 runtime files matched its Linux tarball; real provider requests across two cold restarts preserved recovered tool output, produced one parent final, and rejected stale hard-kill replay without another provider dispatch.
  • Published 2026.9.2 to 932c148c5cc7: automatic migration before standalone Doctor, survival, missing-path config-byte preservation, dependency cleanup, and readiness/status passed. Initial baseline startup deliberately requested one fresh process after installing migration plugins, before candidate execution. The bounded fixture now follows that exact published protocol, retains the first log, and rejects unrelated or repeated failures; candidate assertions are unchanged.
  • Historical 7be29196eb22 package: full build, integrity/import graph, exact-tarball macOS CLI/config/readiness/RPC, eight served UI assets, and owned-process cleanup passed. CI 35189876458 passed on verified merge 60777822a4f7, parents c49879668263 and 7be29196eb22.
  • The 91799f main integration passed 188 updater/startup-duration cases, 171 task/startup cases, selected changed checks, and independent P0–P2 review. The 4c8032 integration passed 96 browser-free UI attention/identity cases. Native decoder/discovery/publication proof passed 390 cases with nine platform skips; install-helper proof passed 111. The registered systemd reader/boundary group passed 121; the forwarding cutover passed 98 distinct selected cases. Focused regressions preserve original red results and unchanged expectations.

The original combined-branch before capture and its historical missing-after checkpoint remain part of the retained evidence. They do not qualify this obsolete combined branch for merging. The separately landed user-visible replacements have their own source-bound before/after delivery and rendering records, including the recovered six-image #151412 attention set described above; no screenshot waiver or new combined-branch UI run is claimed.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 16:05
@steipete
steipete requested a review from a team as a code owner September 16, 2026 16:05
@steipete
steipete force-pushed the codex/task-recovery-reduction branch from 2c83a04 to 8238002 Compare September 16, 2026 16:22
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 29, 2026, 8:46 AM ET / 12:46 UTC (Revision 83).

ClawSweeper review

What this changes

The branch changes shared Gateway updates, Windows service inspection, interrupted task recovery, provider request handling, and Control UI conversation attention, with supporting tests and documentation.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 11 items remain

Keep this protected tracking draft open. The author explicitly rules out merging the combined branch, and the focused replacements have not disposed of every requirement.

Priority: P1
Reviewed head: 5dc7317102c8f033ed86d081dfc5c92bd0055dee

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Historical proof is useful, but the pinned combined patch has two blocking defects and lacks authority and existing-state qualification.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: historical real Gateway/provider traces cover older source identities and allowed automatic updates, but do not show this pinned head rejecting an unselected live sibling before native I/O. The inspected image for this branch is before-only; paired after images belong to a separately merged UI PR. Existing stored recovery state has no verified upgrade cell on the pinned head, so data-model compatibility is insufficient. Any new traces or screenshots should redact credentials, IP addresses, phone numbers, and private endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: historical real Gateway/provider traces cover older source identities and allowed automatic updates, but do not show this pinned head rejecting an unselected live sibling before native I/O. The inspected image for this branch is before-only; paired after images belong to a separately merged UI PR. Existing stored recovery state has no verified upgrade cell on the pinned head, so data-model compatibility is insufficient. Any new traces or screenshots should redact credentials, IP addresses, phone numbers, and private endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 11 items Branch-only Windows launcher parser: The introduced parser accepts its current wrapper and an asynchronous legacy wrapper, but omits the direct synchronous VBS wrapper.
Current main recognizes published launchers: Current main explicitly recognizes the direct synchronous wrapper generated by v2026.9.2 and v2026.9.3.
Branch loops over admitted profiles: The introduced updater loop passes each admitted profile to managed-service stop; the native owner ultimately calls service.stop.
Findings 2 actionable findings [P1] Accept the published synchronous VBS launcher
[P1] Refuse a live sibling before any service stop
Security Needs attention Unselected sibling service can be stopped: The updater iterates admitted sibling profiles and reaches native service.stop; discovery of a shared installation does not itself grant the selected updater current authority over another profile's running service.

How this fits together

The installed updater discovers Gateways using an installation and controls when runtime files may be replaced. Gateway recovery then restores interrupted work, while the Control UI presents the resulting conversation state.

flowchart LR
  A[Operator update request] --> B[Installed updater]
  B --> C[Gateway service discovery]
  C --> D[Live service decision]
  D --> E[Runtime publication]
  E --> F[Gateway restart]
  F --> G[Task and conversation recovery]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: historical real Gateway/provider traces cover older source identities and allowed automatic updates, but do not show this pinned head rejecting an unselected live sibling before native I/O. The inspected image for this branch is before-only; paired after images belong to a separately merged UI PR. Existing stored recovery state has no verified upgrade cell on the pinned head, so data-model compatibility is insufficient. Any new traces or screenshots should redact credentials, IP addresses, phone numbers, and private endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Accept the published synchronous VBS launcher (P1) - The introduced matcher recognizes the current two-line wrapper and an asynchronous legacy wrapper, but not the direct synchronous form generated by published 2026.9.2 and 2026.9.3 builds. A service using that form fails effective launcher inspection. Current main recognizes it; preserve that compatibility in any landing candidate.
  • Refuse a live sibling before any service stop (P1) - The introduced default loop visits every admitted profile and calls the managed-service stop path, which can reach native service.stop for an unselected sibling. The adopted stop-first update boundary requires refusal before the selected service is stopped or runtime files are published.
  • Resolve security concern: Unselected sibling service can be stopped - The updater iterates admitted sibling profiles and reaches native service.stop; discovery of a shared installation does not itself grant the selected updater current authority over another profile's running service.
  • Resolve merge risk (P1) - The combined branch can stop an unselected sibling Gateway during an update, crossing profile service ownership despite the adopted stop-first direction.
  • Resolve merge risk (P1) - The branch writes additional persistent recovery identity without verified existing-state upgrade behavior on this pinned head.
  • Complete next step (P2) - Keep the combined branch unmerged; finish and qualify the remaining focused replacements, then verify the umbrella's final disposition.
  • Improve patch quality - Resolve the Windows launcher and sibling-service findings on any proposed landing branch.
  • Improve patch quality - Show allowed and unselected-sibling final-effect proof, plus an existing-state recovery upgrade check, for that branch.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P1] Accept the published synchronous VBS launcher — src/daemon/schtasks-layout.ts:367-372
  • [P1] Refuse a live sibling before any service stop — src/cli/update-cli/update-command-execution.ts:223-228
  • [high] Unselected sibling service can be stopped — src/cli/update-cli/update-command-execution.ts:228
Agent review details

Security

Needs attention: The branch expands update-driven native service control to sibling profiles without the adopted stop-first boundary.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Persisted recovery identity fields 2 added The session state and recovery receipt additions make existing-state compatibility relevant before any merge.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/missing-load-path.sh, unknown-data-model-change: scripts/e2e/lib/upgrade-survivor/missing-load-path.sh, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Continue focused replacements (recommended)
    Leave the combined branch unmerged and qualify each remaining contract on its focused PR with current-source proof.
  2. Requalify the combined branch
    Resolve the Windows and sibling-ownership defects, conflicts, authority proof, and stored-state upgrade evidence before reconsidering this branch.

Technical review

Best possible solution:

Keep the umbrella as a tracking record while focused replacements finish Windows compatibility, stop-first publication, and recovery contracts; retire the combined branch after those dispositions are verified.

Do we have a high-confidence way to reproduce the issue?

Yes, for the branch findings: the introduced parser lacks the published VBS form, and the admitted-profile loop reaches native service stop. This read-only review did not execute the scenarios.

Is this the best way to solve the issue?

No. The combined implementation conflicts with the adopted stop-first boundary; focused owner-level replacements are the maintainable route.

Full review comments:

  • [P1] Accept the published synchronous VBS launcher — src/daemon/schtasks-layout.ts:367-372
    The introduced matcher recognizes the current two-line wrapper and an asynchronous legacy wrapper, but not the direct synchronous form generated by published 2026.9.2 and 2026.9.3 builds. A service using that form fails effective launcher inspection. Current main recognizes it; preserve that compatibility in any landing candidate.
    Confidence: 0.95
  • [P1] Refuse a live sibling before any service stop — src/cli/update-cli/update-command-execution.ts:223-228
    The introduced default loop visits every admitted profile and calls the managed-service stop path, which can reach native service.stop for an unselected sibling. The adopted stop-first update boundary requires refusal before the selected service is stopped or runtime files are published.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c374040735c9.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The branch affects live Gateway update availability and interrupted-work recovery across shared installations.
  • merge-risk: 🚨 compatibility: The branch's Windows reader omits a published synchronous VBS launcher form that current main recognizes.
  • merge-risk: 🚨 security-boundary: The updater's admitted-profile loop can reach a native stop for an unselected sibling service.
  • merge-risk: 🚨 availability: Automatic sibling stops can interrupt another running Gateway during shared runtime replacement.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: historical real Gateway/provider traces cover older source identities and allowed automatic updates, but do not show this pinned head rejecting an unselected live sibling before native I/O. The inspected image for this branch is before-only; paired after images belong to a separately merged UI PR. Existing stored recovery state has no verified upgrade cell on the pinned head, so data-model compatibility is insufficient. Any new traces or screenshots should redact credentials, IP addresses, phone numbers, and private endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [high] Unselected sibling service can be stopped — src/cli/update-cli/update-command-execution.ts:228
    The updater iterates admitted sibling profiles and reaches native service.stop; discovery of a shared installation does not itself grant the selected updater current authority over another profile's running service.
    Confidence: 0.94

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Donnie Fiander: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (82 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T11:50:16.211Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-28T13:04:32.090Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-28T18:36:33.087Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-28T20:15:50.152Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-29T08:19:20.719Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-29T10:50:52.613Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-29T11:10:10.793Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles
  • reviewed 2026-09-29T12:32:33.364Z sha 5dc7317 :: needs real behavior proof before merge. :: [P1] Recognize the published synchronous VBS launcher | [P1] Refuse shared-install updates before stopping sibling profiles

Preserve the latest hidden transcript and visible lifecycle identity across repeated Gateway restarts, retain hard-kill activity timestamps, and keep equivalent completion events from invalidating delivery. Scope questions and approvals to the selected conversation and honor configured Responses strict-tool support. Remove duplicate approval projection state. Regression, real Gateway/provider, build, and independent review evidence is retained for the PR.
Observe the first actual recovery request after the old Gateway exits, retain its typed prior tool result in proof, and exclude auxiliary recaps from stale-worker dispatch counts while checking the HTTP gate. Keep same-task, no-repeat and exactly-once assertions. Use explicit completed receipts and a capable public model for the live fixture; the full real Gateway and provider flow passes.
Coordinate managed consumers before replacing a shared runtime, preserve stopped profiles, and keep per-profile recovery and verification with the existing service owners. The origin owns the final notice and scalar health observation; candidate code completes work after schema migration.

Preserve registered Windows actions, principals, and policy, and reject inconsistent launcher snapshots. Reuse canonical restart-notification storage in the sealed helper and remove retired update paths and duplicate task-recovery/attention bookkeeping.

Regression coverage includes shared-profile failure and rollback, stale and missing Windows launchers, legacy helper settlement, sentinel preservation, and repeated task recovery. Document the first-hop limitation of published older updaters.
Keep selected native service authority separate from caller state and fresh runtime credentials. Preserve a live foreground replacement after the initial readiness observation and retain required Node refresh across preflight. Normalize Windows task identity through its existing owner and consolidate repeated finalization decisions.
@steipete
steipete force-pushed the codex/task-recovery-reduction branch from 8238002 to dba98ea Compare September 16, 2026 19:59
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
Preserve the required running state emitted by published updaters. Extract pure test fixtures to keep existing coverage within its line caps, normalize command options through their actual type, and reuse the native spawn-result fixture.
Publish the existing targeted restart intent before native update stops so interrupted subagents remain recoverable. Clear the profile-bound intent after a failed stop, preserve ordinary shutdown behavior, and document the older-driver first-hop limitation. Cover intent publication and failed-stop cleanup at the native maintenance boundary.
@steipete
steipete marked this pull request as draft September 16, 2026 22:28
steipete added a commit that referenced this pull request Sep 26, 2026
Move remembered-session reads, writes, and retired-pointer cleanup through the existing SQLite workers. Keep conditional cleanup and source custody intact, await Doctor cleanup, and join accepted memory writes before a settled terminal exit.

Explicit session selection retires startup restore immediately, including an unchanged Home choice and A-to-B-to-A selection. Clear provisional labels through the same owner so displayed and submitted conversations agree.

Refs #150153; completes the focused TUI asynchronous-storage remainder from #152895. No schema, stored-value, public configuration, or protocol change.
steipete added a commit that referenced this pull request Sep 26, 2026
* fix(tui): preserve session choices through async persistence

Move remembered-session reads, writes, and retired-pointer cleanup through the existing SQLite workers. Keep conditional cleanup and source custody intact, await Doctor cleanup, and join accepted memory writes before a settled terminal exit.

Explicit session selection retires startup restore immediately, including an unchanged Home choice and A-to-B-to-A selection. Clear provisional labels through the same owner so displayed and submitted conversations agree.

Refs #150153; completes the focused TUI asynchronous-storage remainder from #152895. No schema, stored-value, public configuration, or protocol change.

* test(tui): wait for settled session and exit phases

* refactor(tui): own remembered-session read validation

* fix(tui): keep session-memory callback receiver independent
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…158639)

* fix(ui): preserve ownership when restoring saved split panes

Keep ownerless saved global panes unbound until an explicit conversation choice.
Preserve captured Home identity, drafts and peer layout through split creation,
route refresh, pending reads, close/reload and existing navigation intents.

Refs openclaw#150153; continues the saved-pane obligation from openclaw#152895.

* fix(ui): preserve shared agent selection in classic chat

Pin captured agent ownership only for split panes. Retain the existing classic global selection and companion retirement lifecycle; unchanged browser siblings reproduce and qualify the boundary.

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…#158845)

* fix(tui): preserve session choices through async persistence

Move remembered-session reads, writes, and retired-pointer cleanup through the existing SQLite workers. Keep conditional cleanup and source custody intact, await Doctor cleanup, and join accepted memory writes before a settled terminal exit.

Explicit session selection retires startup restore immediately, including an unchanged Home choice and A-to-B-to-A selection. Clear provisional labels through the same owner so displayed and submitted conversations agree.

Refs openclaw#150153; completes the focused TUI asynchronous-storage remainder from openclaw#152895. No schema, stored-value, public configuration, or protocol change.

* test(tui): wait for settled session and exit phases

* refactor(tui): own remembered-session read validation

* fix(tui): keep session-memory callback receiver independent
steipete added a commit that referenced this pull request Sep 28, 2026
* fix(build): refuse dist rebuild under a live managed Gateway

Stop pnpm build and run-node auto-build from deleting hashed dist modules
while a managed Gateway ExecStart still points at this checkout.

* chore(build): drop unused fence message field

* fix(build): also fence direct tsdown and run-node rebuilds

Cover the cleanTsdownOutputRoots path and refuse early in run-node so
live managed Gateway dist cannot be wiped outside build-all.

* fix(build): keep live Gateway stop off the rebuild path

Dispatch gateway stop/restart from existing dist, apply --profile
before service inspection, and fence only physically overlapping
checkouts.

* fix(build): keep live dist fence off tsdown declaration graph

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.

* fix(build): use import type for SpawnOptions in live-dist tests

* fix(build): dispatch source-only QA reports before the live dist fence

qa parity-report and qa coverage already run from source without
rebuilding private QA dist. Check that path before refusing a live
managed Gateway rebuild.

* fix(daemon): discover managed Gateway bindings across profiles

The live-dist fence needs every installed managed selector, not only the
current OPENCLAW_PROFILE. Reuse includeManagedOpenClaw scans and leave
findExtraGatewayServices semantics unchanged.

* fix(build): refuse live dist rebuild for every overlapping Gateway profile

A default-env build could still replace dist under a sibling profile
Gateway. Inspect all managed bindings, name offenders, and point operators
at stop or openclaw update.

* fix(daemon): keep managed Gateway binding discovery under lint limits

Move profile binding mapping out of inspect.ts, list managed services via
listManagedOpenClawGatewayServices, and use toSorted for profile naming.

* fix(build): keep live-dist refusal out of updater restore and system census

Propagate admissionRefused so update-gateway-build does not rm live output
roots after a pre-mutation fence refuse. Enumerate system-scope managed
units with explicit systemdReadTarget so user and system siblings both reach
the fence.

* test(build): pass a compare function to toSorted in the fence fixture

* fix(build): satisfy live-dist fence CI type, knip, and assertion gates

Treat toSorted comparators as possibly undefined, stop re-exporting the
unused binding type, and read launchd profile env through the record
owner instead of a type assertion.

* fix(daemon): inspect systemd template instances in the live-dist census

Discovered `[email protected]` files were forwarded as unit names, so the
fence queried a non-runnable template and fail-opened past a live instance
when a separate user Gateway was installed. Reuse the existing instance
resolution owner and cover user+system template inspection through the
service reader.

* fix(tooling): pin foreign-cwd tsconfig and clear CI gates

- pin TSX_TSCONFIG_PATH in the CLI shim only when the cwd lacks one, so
  fixture-spawned run-node.mts resolves workspace profile imports
- pass --import scripts/tsx.mjs to live-updater spawns and pin the
  tsconfig in run-node-lifecycle fixture envs (production loader parity)
- drop the unused systemd re-export for knip and move the template-
  instance test to service.systemd-scope.test.ts for the line cap

* fix(daemon): inspect registered Gateway services accurately

Read strict Windows service commands from registered actions and preserve
supported launcher encodings without treating dynamic CMD expansion as a
verified command. Retain exact task identity and bound systemd selection.

Use one platform inventory collector for the existing full and diagnostic
projections. Report incomplete inspection through Doctor while preserving
status JSON and the existing managed-service filters. Keep load-state
inspection behind a leaf capability instead of reverse facade imports.

Refs #151608, #151463.

* fix(daemon): classify service commands by position

Share runtime and root-option parsing so Node display names and profile values
cannot classify a Node service as a Gateway. Preserve literal shell, env and
generated launchd wrappers, and honor the executable selected by launchd.

Read systemd's single-quoted arguments through the existing parser and preserve
literal apostrophes when rendering. Keep strict Windows command rejection
separate from lenient diagnostics, and align the native-boundary fixtures with
that contract without weakening ownership or source-preservation assertions.

* fix(daemon): inspect direct registered task actions

Read literal executable actions from their registered Scheduled Task and
revalidate the action before returning command facts. Strict runtime inspection
uses the same registered command instead of a default launcher.

Keep executable paths out of managed launcher provenance. Direct actions remain
outside automatic update service management when no restorable CMD/VBS launcher
exists, preserving the prior stop and definition ownership boundary.

* test(windows): prove installed service upgrade paths

Extend the existing native Scheduled Task proof with verified immutable package
handoff and fixed fresh, published 2026.9.3, and published 2026.9.4 CLI cells.
Require live version/build identity, selected PID replacement, peer continuity,
strict registered-action inspection, and settled cleanup before evidence
publication and disposable installation retirement.

Keep source-only and repair modes, permissions, deadlines, and native lifecycle
owners intact. Direct executable fixtures remain disabled and preserve the
updater's unsupported-mutation boundary. Native execution remains pending.

* test(doctor): retain managed Windows launcher provenance

Keep the generated CMD path on the existing managed-service fixture before
and after reinstall so Doctor admission sees the installation it models.
Preserve all stop, install, restart, rollback, and direct-action refusal
expectations without changing production behavior.

* test(windows): exercise native autostart ownership boundaries

Extend the existing published-updater cell with its stopped, task-owned
Scheduled Task. Capture real admission, exercise native enable/disable,
and preserve the definition and files after foreign-owner refusal.

Test retained admission separately from restoration so legitimate same-root
refresh remains supported. Restore the original XML through the existing
fixture lifetime; do not broaden product control or workflow permissions.

Modeled owner tests, selected source checks, and independent review pass.
Actual Windows execution remains required before a native proof claim.

* test(windows): retain sanitized installed command failures

Keep unexpected command stdout and stderr in bounded failure diagnostics so
JSON-mode CLI errors survive native proof failures. Reuse the existing
terminal and support redaction owners before clipping; withhold incomplete
captures while preserving the existing truncation failure.

Move the existing command runner into its own test-support module and update
both consumers without changing timeout, exit, signal, or cleanup semantics.
Real-child regressions reproduce both privacy defects and pass with the
correction. The original installed Gateway failure remains undiagnosed.

* fix(daemon): preserve Windows probe budgets and Doctor cleanup eligibility

Use the existing cold PowerShell startup budget for Task Scheduler queries
without an explicit deadline. Keep periodic activation checks bounded and
preserve unknown results rather than treating timeouts as task absence.
The native probe test now exercises the production default.

Share Doctor's existing legacy cleanup classification with its registered
preview. Keep unsupported platforms, scopes and unrecognized Linux unit
names as findings without advertising removal or invoking unrelated cleanup.
Extract the classifier and complete cleanup test group without dropping
assertions or changing native mutation ownership.

Retain the failed installed Windows runs and their source identities;
new package and native upgrade qualification remain separate requirements.

* chore(daemon): retire stale Doctor size baseline

The split Doctor service module no longer needs a max-lines suppression.
Remove only its stale baseline entry so the shrink-only ratchet matches
actual source. Product, dependency, workflow and fixture bytes are unchanged.

* fix(build): keep native fixture import closures complete

Keep the legacy source-update transaction at its existing direct CLI call
site so native declaration-library consumers do not load its CLI-only source
resolver closure. Copy the exact PID helper inputs into the runtime fixture.

Use the real legacy-loader file URL in its existing subprocess invocation,
so execution and unused-file analysis share the same dependency reference.
Preserve all assertions, lifecycle guards and package runtime behavior.

Co-authored-by: Donnie Fiander <[email protected]>

* test(windows): retain sanitized service proof observations

Record bounded install and status facts before semantic assertions so a
successful CLI exit cannot hide the native inspection reason. Exclude
free-form stderr and private response fields, and preserve existing
execution, deadline, and cleanup assertions.

* test(windows): retain safe installed-service observations

Retain allowlisted install/status JSON before strict semantic assertions,
without copying private response fields or opaque successful stderr.
Compose service observation and exact sibling-refusal checks through one
internal options record and migrate every test/support caller together.

Preserve native process cleanup, readiness assertions and command budgets.

Co-authored-by: Donnie Fiander <[email protected]>

* test(update): isolate source updater fixture inputs

Give the synthetic compiler declared memory capacity through the existing
memory owner instead of inheriting competing CI workers. Keep real build
heap admission and all lifecycle assertions unchanged.

Use the established TypeScript loader for the Linux-only live-updater CLI
case so it reaches the platform refusal rather than failing during import.

Refs #152875. Retains the exact failing Linux CI evidence and contributor work.

Co-authored-by: Donnie Fiander <[email protected]>

* fix(windows): preserve native status inspection defaults

Keep the CLI RPC default distinct from an explicit timeout so Windows
service inspection can use its existing cold-start budget. Forward
explicit load-query deadlines through the Task Scheduler owner while
preserving lifecycle defaults and timeout diagnostics.

* fix(models): retain discovered models after refresh failures

Record successful legacy catalog results at the producer boundary so unavailable refreshes retain the accepted inventory. Preserve explicit outcomes, advisory SDK fallback behavior, and first-discovery starter policy.

* fix(models): preserve skipped catalog outcome semantics

Mark bundled static, configured, and advisory catalog projections with
explicit empty outcomes so legacy success inference cannot promote them
to observed account inventory. Preserve live outcomes and helper types.

Keep exact auth provenance histories and move existing fixture/policy
code into focused owners where required by the line-cap ratchet.

Validation: 447 producer and sibling cases, 56 shared self-hosted cases,
95 auth/policy cases, causal missing-outcome failures, maintained checks,
and independent review.

* test(plugin-sdk): keep discovery loader types acyclic

Move the shared loader type into a leaf consumed by both discovery
contract helpers. Preserve its public provider-test-contracts export
without a child-to-parent type import cycle.

Validation: maintained Madge check reports zero cycles; core, all core
test graphs, extension test types, lint, formatting and independent
review pass. Runtime behavior and previous catalog proof are unchanged.

* fix(plugin-sdk): mark generated static catalogs explicitly

Keep the generated non-live, non-strict catalog adapter from claiming
successful acquisition for manifest or configured rows. Preserve null,
errors, strict and custom callbacks, static catalogs, and public types.

Validation: three existing controls fail before the correction; all49
owner and sibling cases pass afterward, with types, lint, line caps and
fresh independent review clean.

* test(windows): honor omitted task XML defaults

Use the existing task XML setter for disabled installed fixtures and
normalize only the task-level Enabled setting in the enable roundtrip.
Keep all other definition, native state, cleanup, and sibling build
refusal assertions intact.

Co-authored-by: Donnie Fiander <[email protected]>

* test: preserve native and npm fixture environment

Use the canonical native service environment projection for installed Windows
fixtures, retaining private application and npm paths with case-aware overrides.
Keep credentials and Node options outside the projection.

Apply the exact isolated npm global-config fixture correction from #158197 so
version-selection tests reach their existing assertions after config discovery.

Validation: 16 focused cases, all selected changed checks, and independent P2
review passed. Product and dependency inputs are unchanged; Windows installed
upgrade and sibling-build qualification remains outstanding.

* test(windows): await installed readiness before status checks

Use the existing HTTP startup-readiness owner after install and update, while
retaining strict one-shot status, build identity, and sibling continuity checks.

Stop registered fixture services through the guarded owner before deleting Task
definitions. Proven absence skips only stop; unknown inspection or stop failure
retains the error and cleanup authority instead of bypassing the guard.

Validation: source-identical readiness/stop owner proof (71 cases), affected
services types, lint, formatting and ratchets passed. Fresh P2 review's request
to delete after failed stop was rejected against the retained-authority contract.
Native Windows completion remains unqualified; no deadline or assertion changed.

* fix(tests): wait for queued RPC admission before restart

Await the exact terminal chat event after deferred registration before
releasing the held first response. Preserve the actual queue assertion,
all delivery and restart checks, and the overall test deadline.

Refs #150153
Refs #152875

Source-equivalent carry of #158347 (4713210).

* test(windows): stop installed fixtures in their own profile

Invoke the guarded installed CLI through the existing managed command owner,
using the admitted Task entry, profile and environment. Vitest's synthetic
ambient state must not decide whether that Task can be stopped.

Keep the existing 180-second command lifetime and child join, without inheriting
an already-aborted test-body signal during cleanup. Unknown registration and
failed stop still retain authority; proven absence skips only stop.

Validation: affected services types, lint, formatting and independent P2 review
passed. Shared command-owner proof remains retained. Native completion is still
pending; no service guard, process assertion or test deadline was weakened.

* fix(update): retain native custody during partial-stop recovery

Compensate a failed native stop through the existing guarded service restart,
revalidating the original binding inside its operation lock. Require completed
recovery and preserve the original failure without starting a build or custom
shell command. Successful and failed-build custom restart contracts stay intact.

Four published-shell regressions fail on the former path and pass after this
repair; 21 unchanged controls, selected checks, and independent review pass.

Co-authored-by: Donnie Fiander <[email protected]>

* test: preserve threaded SQLite cleanup fixture metadata

Carry the exact qualified d103e23/#158407 fixture correction for incoming
compile-cache initialization. The non-isolated harness runs in threads;
retain its false/null metadata and forbidden Worker constructor without
changing assertions, order, or timeouts.

* test: align SQLite lifecycle proof with canonical host contract

Replace the provisional physical-thread metadata with the logical-host
fixture contract from merged #158209. Preserve every cleanup assertion and
the forbidden Worker constructor.

Carry merged #158409's literal dependency resolvers, caller update and
selection regression. Exact canonical postimages, the ordered cleanup case,
dependency-selection case, selected checks and independent review pass.

* test(windows): preserve installed command budgets and progress

The aggregate 240-second fixture deadline cut the published updater short
before its existing 180-second command budget. Allocate installed cells
360/900/900 seconds and matching 10/19/19-minute Actions envelopes, including
the existing teardown and runner margin. Source-native and command limits,
assertions, and the quiet watchdog stay unchanged.

Reuse the existing durable recorder for real phase progress, preserving
original failures and emitting only fixed labels. The Task-only 9.4 cell
needs one sibling fence, with no Startup fingerprint allowance.

The 32 focused cases, selected types and export scans, workflow validation,
owned lint, and independent review pass. Retain the unchanged main replay
lint-cap failure separately. Production and dependency inputs are unchanged.

* test(windows): retain installed updater failure progress

Read the isolated selected service update ledger before native fixture cleanup and retain only phase and step metadata. Preserve the original updater error and all existing execution budgets.\n\nValidation: 15 focused tests, incremental changed-file checks, and independent review passed. The moving-main ratchet failure on three untouched older files is retained separately.

* test(daemon): complete system template runtime fixture

Provide the loaded-runtime reader's required ControlGroup metadata. The missing
native response correctly made inspection unavailable and broke the template
regression after main integration; production behavior is unchanged.

Validation: the original fixture fails locally for the CI assertion, then all
76 service-scope and loaded-runtime cases pass after correction. Independent
P2 review is clean. No assertion, timeout, or package source changed.

* fix(daemon): ignore unrelated registered task profiles

Read-only Scheduled Task discovery can inspect a static unrelated command
without requiring an OpenClaw profile. Keep selected-service profile checks
strict, and preserve launcher, registration and deadline revalidation.

The installed Windows fixture exposed a false Doctor finding for a Helper
that only runs node.exe --version. Add its causal collector regression and
retain the selected-service rejection assertion. Receive the canonical
2b2ae31 SDK fixture fix so mutation occurs after real declaration emission.

Receiving tests and core/services/SDK types pass; focused lint and P2 review
are clean. The full changed gate still encounters the inherited OpenRouter
suppression defect already repaired on main. The production change requires
new package acceptance and native Windows proof before landing.

* fix(build): give external recovery steps for stale dist

The live-build refusal now names an external stop, successful rebuild, and
start sequence for every matching service. Explain that an already-current
update does not rebuild stale output, and document the default-profile
commands with failure-short-circuiting in the source update guide.

This changes guidance only, without altering admission or lifecycle policy.
The existing fence suite passes 37 cases with one platform skip; focused
lint, formatting and independent P2 review are clean.

* test(daemon): observe published updater settlement

Record launcher, command, and output lifecycle timestamps for the published
update command. After its current ledger run becomes terminal, retain at
most two bounded and sanitized process snapshots with creation and CPU/I/O
facts. Fence progress and snapshots to that same run; observations neither
refresh progress nor change command, cleanup, or watchdog budgets.

This diagnoses a published 9.3 command that timed out after its candidate
reported successful activation and verification. Preserve the failure and
avoid inferring early process exit from post-timeout cleanup observations.

34 focused cases, services types, scoped lint, formatting, and independent
P2 review pass. Native diagnostic execution remains required.

* fix(daemon): recognize the released waiting task launcher

Accept the exact waiting VBS form generated by the published 2026.9.3
installer during an owned service-definition audit. Keep custom launcher
behavior classified as an unknown edit and preserve all selector, command,
root, and native authority checks.

Receive the three reviewed postimages from ec74258. The actual audit
regression fails on the original implementation; 55 receiving cases pass.
The shared owner also verified 140 backup/rewrite cases, core/services types,
scoped lint and P2 review. This repairs the observed reconciliation warning;
it does not claim to explain the independent updater settlement timeout.

* test(daemon): sample unsettled updates before the command deadline

Keep the same two-snapshot cap, current-run binding and progress behavior. Capture an unfinished run at 300 seconds so a slower installation cannot prevent all process observations. Rename the diagnostic field to reflect both active and terminal observations. The original observer regression fails; 25 cases, scoped lint/types and independent P2 review pass. Command and cleanup budgets are unchanged.

* test(daemon): preserve CRCRLF task export comparisons

* fix(windows): enable a verified disabled task on explicit start

Receive the shared selected-service start repair, preserving published command fingerprints and optional Enabled metadata behavior. Keep the finalization process fixture's real entrypoint exports available. Source-build recovery ownership remains unchanged.

* docs(windows): clarify explicit start partial effects

Document that successful enablement remains an audited effect when the later launch fails. Preserve the existing explicit-start contract and require inspection before retrying; do not imply rollback after authority loss.

* docs: clarify source CLI recovery uses the existing build

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Donnie Fiander <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
steipete added a commit that referenced this pull request Sep 28, 2026
Retain public provider metadata and owned-request shape facts for the unresolved attribution boundary. Keep parser behavior, verdicts, cleanup, and capture limits unchanged. Refs #150153.
@steipete

Copy link
Copy Markdown
Contributor Author

Closing the combined extraction draft, which explicitly must not be merged. The focused service-discovery and live-build protections landed in #151608 and #152875, and current main refuses replacement while another Gateway uses the installation. Any remaining recovery or session-identity work should continue as focused changes against the current owners.

Closed in a sweep of maintainer PRs open longer than a week. Reopen with a current reproduction if this still matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant