Repository navigation
fix(state): repair mis-stamped v17 agent databases - #122171
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
force-pushed
the
codex/v17-same-version-repair
branch
from
August 11, 2026 18:04
0149abf to
c403d77
Compare
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 12, 2026
* fix(state): repair mis-stamped v17 agent databases * refactor(state): keep lease repair helpers internal
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.
Summary
state_leasestable as pending same-version agent-schema convergenceRoot cause
The v17 retirement ran only while upgrading an older
user_version. A database stamped v17 before the retirement completed took the current-version early return, and the general schema contract intentionally permits unrelated tables, so the retired lease table survived indefinitely.The canonical agent-schema owner now classifies that structure as pending convergence and removes it inside the existing
BEGIN IMMEDIATEtransaction before the same-version branch. This covers Doctor media repair, explicit maintenance, and writable runtime opens while keeping read-only access nonmutating.Proof
node scripts/run-vitest.mjs src/state/openclaw-agent-db-retired-lease-repair.test.ts src/infra/state-migrations.media-persistence.additive-schema.test.ts— 6 passednode scripts/run-vitest.mjs src/state/openclaw-agent-db.test.ts— 101 passed, 4 skippedpnpm formatandgit diff --check— passedpnpm plugin-sdk:api:check— passed with repair helpers module-privateProduction delta is +32 lines, justified by the explicit retired structural contract and shared same-version detection/repair boundary. Tests add 274 lines covering mis-stamped v17 repair, clean no-op/idempotence, both auth stores, schema ownership/version preservation, malformed-table rejection, transaction rollback, read-only nonmutation, writable convergence, index/stat cleanup, and integrity/foreign-key checks.