Repository navigation
fix(config): migrate and validate recovery snapshots before restore - #120475
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
August 8, 2026 04:56
This was referenced Aug 8, 2026
steipete
added a commit
that referenced
this pull request
Aug 8, 2026
…undled plugin The test added in #120475 deterministically times out (120s budget) on cold module caches: its repair-enabled preflight walks collectChannelLegacyStateMigrationPlans and the plugin doctor contract registry, which cold-compile all 38 bundled plugin runtimes (~200s measured under the Vitest transform); the second table case only passed on the warmed worker. Bind persistence is core config-migration behavior, so stub the two contract-resolving surfaces (bundled channel legacy artifacts, plugin doctor contract registry) with narrow importActual partial mocks; cheap raw-config helpers stay real. 2 tests now pass in ~27s cold.
steipete
added a commit
that referenced
this pull request
Aug 8, 2026
…ration drift Repair the main-owned landing-gate failure from #120475, whose declaration emission changed the session-catalog baseline without regenerating this manifest.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 9, 2026
This was referenced Oct 24, 2026
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.
What Problem This Solves
Doctor's
.last-goodrecovery restores hash-matching snapshot bytes without current-schema validation or migration. A snapshot written by an older release (e.g. containing legacygateway.bind: "localhost") gets restored verbatim, the schema then rejects it, and the gateway is left with an invalid active config — the "recovered into a broken state" loop reported as a perpetual crash-restart.Fixes #114965 and resolves #112962 (whose direct-normalization claim did not reproduce — canonical bind modes survive load byte-for-byte on main and on the reported release; the actual defect was this recovery path).
Why This Change Was Made
Maintainer decision on the open #114965 question (reject vs migrate): migrate-and-validate. A recovery path that refuses schema-obsolete snapshots discards valid user config that merely needs alias migration; repo doctrine is "doctor migrates, verifies, then runtime assumes the new shape". Rejection remains the fail-closed fallback when migration+validation still fails — an invalid snapshot is never written and the active file plus diagnostics are preserved.
.bakand.last-goodrecovery now share one canonical candidate-preparation and atomic-replacement flow (apply canonical Doctor migrations to authored bytes → enforce include/env ownership → resolve includes for validation only → current plugin-aware schema validation → write only migrated valid authored config). Their distinct backup-eligibility rules remain separate deliberately (different trust/audit semantics — documented inline). Provenance of the hazard: ffb1628 introduced.last-goodrecovery without validation; f937775 (#117100) fixed.bakonly.User Impact
Config recovery can no longer resurrect legacy shapes the runtime rejects. A
.last-goodcontainingbind: "localhost"/0.0.0.0restores as canonicalloopback/lan; truly invalid snapshots are refused with the active config untouched.Evidence
localhost→loopback,0.0.0.0→lan, invalid-snapshot refusal with active bytes untouched,.bakparity, Doctor persistence, canonical-load byte identity, and real gateway startup (re-verified after review).pnpm tsgo:core+tsgo:core:test, import-cycle check (0 runtime cycles), fullpnpm build, deadcode scans,git diff --check: all pass.gpt-5.6-sol, high): clean (0.96), plus worker-side review.