Repository navigation
fix(doctor): restore Gateway before queued CLI maintenance - #189246
Merged
Merged
Conversation
Co-authored-by: steipete <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
roboclaw-bot
marked this pull request as ready for review
October 31, 2026 09:22
Co-authored-by: steipete <[email protected]>
Collaborator
Author
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 1, 2026
…189246) * fix(doctor): restore Gateway before queued CLI maintenance Co-authored-by: steipete <[email protected]> * fix(doctor): keep restoration admission safe for native tooling Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
RomneyDa
added a commit
that referenced
this pull request
Nov 17, 2026
Reserve Gateway restoration before releasing Doctor maintenance custody, and enforce that priority at every physical schema-owner acquisition. Preserve live custody, Gateway bootstrap, and uncertain-cleanup behavior. (cherry picked from commit 0a02f57) Co-authored-by: steipete <[email protected]> Co-authored-by: RomneyDa <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #189225
What Problem This Solves
Doctor can leave its managed Gateway stopped when queued CLI maintenance acquires state ownership before Doctor's restoration checks finish.
User Impact
The Gateway stopped by Doctor gets priority over queued CLI schema preparation until restoration settles. Existing database, update, and native service authority checks remain in place. Doctor and concurrent CLI processes need the repaired runtime; already-running older clients cannot observe the reservation.
Why This Change Was Made
Doctor must release its database root before configuration recovery and Gateway bootstrap, so holding that root through launch is unsafe. The existing physical state-record owner now provides a temporary fs-safe reservation acquired under Doctor's current ownership. Both new and already-waiting schema/process acquisitions check it; actual Gateway startup remains eligible for the normal physical lock. No TTL increase, new configuration, schema, or ownership stealing is introduced. Unknown native cleanup and open writers retain recovery custody.
Evidence
RED on main
8b1efb47c130: realbeginDoctorMaintenance/finish, physical state ownership, and a fake managed service reproduce the reported undergoing offline maintenance by sqlite-maintenance process failure after a queued foreign caller acquires the released root. GREEN: that caller is deferred and the service restarts with readiness verified by the fixture.A real child already synchronously waiting for schema ownership is deferred after Doctor releases the root. Controls cover actual installed
gateway --port, explicitgateway run, Gateway status, same-process access, unrelated databases, release, and abandoned reservations.Final focused Node proof: 71 passing tests, including full finish/settlement siblings, in 95.58 s wrapper time (31.43 s cold test-worker preparation). New queued-child and Doctor flow regressions took 0.296 s / 0.317 s. The existing state-owner sibling suite also passed. The old settlement fixture's unwritable
/syntheticstate was moved to an owned temporary directory; all refusal, authority, process-settlement, and service assertions remain.Targeted production/test noEmit types, core lint, formatting, and diff checks pass. Timeouts, nice and ionice were used. No containers or full product build; installed-package upgrade and real OS service managers were not exercised under this focused-only task. Exact-head CI results and remaining external gates are recorded below.
pr-simplify: the existing state-record owner supplies scheduling priority; it grants no database authority. Finish orchestration stays in the existing restoration module. Net production +133, regression +165, exactly allocated for the cross-process waiter, managed restoration, and isolated fixture. No manager, mutable lock payload, or compatibility reader.Fresh independent shared Codex autoreview, P0–P2, covers final commit
84c58e5d6910against parent8b1efb47c130with supplied owner/caller context: scoped-clean, zero findings. A separate review of the complete combined implementation also passed. Reviewers did not execute tests.Regression allocation is verified exactly from this commit. The repository-wide local test-line ratchet reached its 60-second bound without a verdict; CI supplies that full-repository gate.
First-head CI exposed an extracted-tooling dependency in the reservation parser. The correction uses the existing startup-safe root parser and retains that single source in the wrapper inventory. The existing closure guards fail RED before it; all 39 closure/extraction tests, the real reservation test, and the native provisioning private-store/cleanup control pass after it. Correction wrappers: 174.49 s / 61.66 s. No additional regression lines were added. Targeted types/lint/format/diff pass, and a fresh independent Codex P0–P2 correction review is scoped-clean, zero findings.
Three first-head failure groups are independently confirmed on untouched main
96ceb4856c20, with matching names/signatures and identical test/direct-owner sources: Visitor SDK host, writable-service runtime discovery, and runtime diagnostics. #189226 owns the two updater fixture repairs. Those inherited failures are recorded without suppressions or duplicate fixes.Corrected head
51799dc20098879e82bd2d9fce7b8d2631765d13: task-caused closure and native-provisioning groups now pass, as do production/test types, lint and build-artifacts. Main CI finished with six existing failure groups. Four updater fixture groups are owned by fix(ci): restore updater runtime contract coverage #189226; the additional Node-runtime and candidate-admission failures also match untouched main with identical test/direct-owner source.The sixth group, X-publication's unbound SDK host, has the identical test/full stack in earlier unrelated CI and byte-identical direct source. Existing ready repair fix(test): bind SDK hosts in direct Gateway fixtures #189244 supplies the fixture's real SDK host; its live diff was inspected. No corresponding main job is claimed for this E2E fixture.
Separate Darwin CI completed successfully on the exact reviewed head. No inherited failures were suppressed; no workflow rerun, prepare, or merge was requested.
Landing evidence
Parent landing ruling: 2026-10-31 10:00Z. Reviewed head remains
51799dc20098879e82bd2d9fce7b8d2631765d13.The five matching groups below are from the newest scheduled main run 41188672443, attempt 1, main
8ec6c76b5c138ed0be1b68f4101be502bf81d0b9. Their test names and error diagnostics match B's failed attempt; differing temporary directory names are incidental.124503082580target-schemarefuses incompatible inspected runtime requirements when a later lookup disagrees: identical expected/received node-runtime diagnostics. Main job.124503082951Node runtimeupdates the invoking package and rebinds its owned Gateway after a Node-prefix switch: expected hosted Node, received owned node-a path.refuses an incompatible service Node before using a compatible shell Node: promise resolves undefined instead of rejecting. Main job.124503082856candidate admissionblocks package updates when the target requires a newer Node runtime: identical expected/received node-runtime diagnostic mismatch. Main job.124503082835fresh Doctorrefuses incompatible registry targets before mutating a writable service launcher:resolveTargetNodeRuntimeexpected zero calls, actual one withengine >=26.12.1, empty recovery env and 1800000ms timeout. Main job.124503082797Visitorreopens existing profiles and grants and repairs a missing Visitor model policy;retains the original caller through Visitor Access:revoked after commit, revoked before commit, writer, admin) fail withGateway SDK resource host is not boundingetBoundLegacyPluginSdkResourceHostthrough shared-state admission. Current main job. The admin case has compiled source-map/anonymous-frame formatting differences in that run; its exact case/error/guard and source blobs match. The latest completed main job additionally has the identical line231 stack.124503082839X publication8b1efb47c130reproduces the exactrenews stale X authority for public creation and rejects revocation before commitcase,Gateway SDK resource host is not bound, and host231 -> shared-state24 -> state-worker81 -> workspace-store95/cache74 -> workspace617 -> reply345 stack. See the matching B CI job. This fixture is now fixed on main by #189244; no claim current main still fails it.The actual B CI checkout is
680806efa3c6c3f0f99d1bff3166e84828951415, with ordered parents61f3e9310ac0e73ca3785c1bff7ab11b0a6cfb49(main baseline) and the reviewed B head. Its tree matches a clean merge of those parents. All six failing tests, their directly determining owners, and package/lock inputs are byte-identical across the pinned base, actual CI baseline, tested merge and newest scheduled main. B does not change those failure inputs.The fresh X base run used qualified Node26.12.1/Linux x64, took 64.18s wrapper / 61.94s Vitest and executed the actual test. CI used Node24.22.1; exact runtime parity is not claimed. It used timeout, nice, ionice and supported build-skip flags, with a private frozen ignore-scripts dependency install. No containers/product build or guard bypass. An initial missing workspace dependency was a setup gap, not a product verdict.
Darwin workflow 41189375930 completed successfully on exact head
51799dc20098879e82bd2d9fce7b8d2631765d13. All of its native process identity, dependency cache, PR wrappers, materialized anchors, operation locks and selected-Git checks passed. Failed CI is retained as failed; no rerun, expected-failure suppression or unrelated duplicate repair.Fresh isolated X base-run failure signature
Pinned base:
8b1efb47c13011a10765f264cf46b97e72c12e78; clean source before/after; Node26.12.1 Linux x64. Focused invocation usedOPENCLAW_E2E_SKIP_BUILD=1andOPENCLAW_OXLINT_SKIP_PREPARE=1, timeout/nice/ionice, andnode scripts/run-vitest.mjs src/gateway/x-publication-owner-composition.e2e.test.ts --maxWorkers=1. It exited1 after executing the test; this is inherited-failure proof, not a passing replay.Work sessions
Co-authored-by: steipete [email protected]