Repository navigation
fix: recover gateway startup state migrations - #120687
galiniliev wants to merge 1 commit into
Conversation
|
Codex review: found issues before merge. Reviewed August 9, 2026, 12:47 AM ET / 04:47 UTC. ClawSweeper reviewWhat this changesThe PR updates Doctor’s legacy agent-database relocation and makes installed-plugin inventory fingerprints ignore non-semantic rebuild metadata so gateway startup can converge. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked by patch quality or review findings - 7 items remain Keep this PR open: it still redirects the durable agent-database registry before the final SQLite sidecar safety check, so a late nonempty WAL/journal can leave discovery targeting a database that was never moved. Priority: P1 Review scores
Verification
How this fits togetherGateway startup runs Doctor migrations before reporting ready. Doctor relocates legacy per-agent SQLite databases and persists plugin inventory facts that startup preflight compares on subsequent launches. flowchart LR
A[Legacy agent database] --> B[Doctor migration]
B --> C[Sidecar safety check]
C --> D[Registry and file relocation]
D --> E[Gateway preflight]
F[Plugin inventory] --> G[Semantic fingerprint]
G --> E
E --> H[Gateway ready]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +533, Tests +747. Total +1280 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Move the final sidecar rejection/cleanup ahead of the registry redirect, then add a regression that proves a blocked late-sidecar move preserves both filesystem and registry ownership. Do we have a high-confidence way to reproduce the issue? Yes—source establishes a current-head path: a nonempty WAL/journal appearing after initial planning causes the later sidecar gate to reject relocation after the registry has already moved. This was not executed because the review is read-only. Is this the best way to solve the issue? No—the semantic fingerprint portion is well-scoped, but the relocation sequence must gate sidecars before committing the durable registry change or restore that record on failure. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7f3cc6995bc6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
627134e to
8d9172c
Compare
Co-authored-by: Copilot <[email protected]> Copilot-Session: e61bf540-058b-4337-ae97-98fb7c39ef02
8d9172c to
a7933a7
Compare
|
Closed after the viable replacement landed:
The source branch had maintainer edits disabled, was conflicting/dirty, and still contained an unresolved persistent-state relocation ordering defect. The landed replacement therefore uses a materially different, current-main owner-boundary repair for the remaining plugin install-record work; the separate agent-database slice had already landed through #120906. Galin Iliev's investigation and historical intent are credited in #121045, and every semantic replacement commit preserved Galin's |
What Problem This Solves
Fixes an issue where gateway startup could repeatedly refuse readiness after bundled-plugin rebuild or persistence convergence, reporting:
OpenClaw plugin migration inputs changed during startup convergence; refusing to report the gateway ready.It also recovers legacy agent database relocation without changing the durable database owner or registry intent.Why This Change Was Made
The migration fingerprint included non-semantic, runtime-generated plugin inventory fields that can change across bundled-plugin rebuild and persistence convergence: collection and nested ordering, package-build metadata, and file timestamps. The repair fingerprints the semantic persisted inventory contract, while relocation preserves durable database ownership and registry intent.
User Impact
Operators can run
openclaw doctor --fixto recover the affected legacy agent database placement, and subsequent gateway launches converge normally instead of repeatedly refusing readiness after generated plugin inventory changes.Evidence
openclaw doctor --fixrelocated the mismatch toagents/openclaw/agent/openclaw-agent.sqlite.pnpm openclaw gateway runlaunches reachedready.pnpm check:test-typespassed attbx_01kzhax5rvz5x0njrmnw3cqk0r; GitHub Actions run 31272571006.This is local behavioral and CI proof; no live provider or channel proof is claimed.