Repository navigation
fix(doctor): stop repeated bundledDiscovery migration noise on beta - #115208
Conversation
Beta versions (e.g. 2026.7.2-beta.5) are treated by SemVer as older than the cutover release (2026.7.2), so migrateLegacyConfigMachineState would re-infer plugins.bundledDiscovery = "compat" on every new CLI process. The inferred entry always went into importConfigMachineState's 'kept' bucket, which was then reported as a Doctor change — producing misleading "Auto-migrated legacy state" / "Kept existing shared SQLite ..." output on every restart. Fix: skip the inferred compat candidate when the canonical SQLite row already exists. A try/catch guards against temporary SQLite unavailability. Related to openclaw#115151 Co-Authored-By: Claude <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 11:30 AM ET / 15:30 UTC. ClawSweeper reviewWhat this changesThe branch avoids repeatedly reporting an inferred Merge readinessThis PR remains necessary as the focused candidate fix for the repeated beta Doctor migration report tracked by #115151. The proposed gate preserves first-run inference while preventing a pre-existing canonical SQLite value from being re-imported and reported as a new change; no discrete patch defect is supported by the available source, history, and proof evidence. Priority: P2 Review scores
Verification
How this fits togetherDoctor's legacy-config migration converts retired config-derived machine state into canonical shared SQLite state before CLI and gateway flows report migration changes. This change affects the inferred bundled-plugin discovery state so repeated preflight runs stop producing misleading migration output while fresh upgrades still retain the compatibility value. flowchart TD
A[Legacy config and version stamp] --> B[Doctor state migration]
C[Shared SQLite machine state] --> D{Canonical bundled-discovery value exists?}
B --> D
D -->|No| E[Infer compat and import state]
D -->|Yes| F[Skip redundant inferred import]
E --> G[Doctor migration report]
F --> G
G --> H[CLI status and gateway startup output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +32. Total +48 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the canonical SQLite state as the single source of truth and land this narrow inferred-candidate gate after rebasing or otherwise refreshing proof on current Do we have a high-confidence way to reproduce the issue? No independent current-main run was performed in this review, but the source path and supplied focused scenario make the defect reproducible with a beta version stamp, a non-empty plugin allowlist, and an existing Is this the best way to solve the issue? Yes. Gating only the inferred compatibility candidate when canonical state already exists is narrower than suppressing all kept-state reporting, so it preserves explicit migration diagnostics and first-run behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 58a3679c4923. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…eta (openclaw#115208) Beta versions (e.g. 2026.7.2-beta.5) are treated by SemVer as older than the cutover release (2026.7.2), so migrateLegacyConfigMachineState would re-infer plugins.bundledDiscovery = "compat" on every new CLI process. The inferred entry always went into importConfigMachineState's 'kept' bucket, which was then reported as a Doctor change — producing misleading "Auto-migrated legacy state" / "Kept existing shared SQLite ..." output on every restart. Fix: skip the inferred compat candidate when the canonical SQLite row already exists. A try/catch guards against temporary SQLite unavailability. Related to openclaw#115151 Co-authored-by: Claude <[email protected]>
…ifecycle-hooks * origin/main: fix(mattermost): key private channels as group on outbound routing (#96645) fix(ci): grant Telegram QA runtime scratch access (#115659) fix(telegram): stop retrying blocked recipients (#115640) fix(tts): persist generated speech in media store (#115647) fix(gateway): preserve complete streamed chat completions (#115652) fix(mac): prevent app auth from blocking node-host startup (#115533) fix(heartbeat): keep message-tool final replies private (#115629) fix(gateway): drain root work continuations before direct-stop process exit (#105848) fix(ollama): keep active streams within their idle timeout (#115648) fix(delivery): keep session keys out of inferred message targets (#115657) fix(ci): type code mode matrix catch callback (#115674) refactor(agents): centralize bundled CLI backend auth policy (#115633) refactor: remove 3,527 lines of runtime and test duplication (#115626) [AI] fix(doctor): stop repeated bundledDiscovery migration noise on beta (#115208) # Conflicts: # scripts/code-mode-model-matrix.ts
What Problem This Solves
Doctor preflight and
openclaw status --deeprepeatedly report a no-opplugins.bundledDiscoverymigration as an auto-migrated legacy state change on every beta CLI process, creating misleading log noise and unnecessary concern that every restart is re-running a migration.< 2026.7.2),migrateLegacyConfigMachineStatere-infersplugins.bundledDiscovery = "compat"on every new process. The entry always hits the SQLitekeptpath, which is then reported as a Doctor change — even though no state actually changed.try/catchguards against temporary SQLite unavailability.src/infra/state-migrations.config-machine-state.ts(inference gate),src/infra/state-migrations.config-machine-state.test.ts(regression test)plugins.bundledDiscoveryhandling,importConfigMachineStatebehavior, keeping/reporting logic for other migration entries, any other Doctor migration sourceChange Type (select all)
Scope (select all)
Linked Issue/PR
Motivation
Fixes #115151. The bug is fully resolved: after this patch, beta users will no longer see repeated "Kept existing shared SQLite plugins.bundledDiscovery state" messages on every CLI process restart.
Beta versions (e.g.
2026.7.2-beta.5) are treated by SemVer as older than the cutover release2026.7.2:compareOpenClawVersions("2026.7.2-beta.5", "2026.7.2")returns-1. This means theelse ifinference branch inmigrateLegacyConfigMachineStatefires on every new CLI process for any user on a beta version with a non-empty plugin allowlist. The result always goes intoimportConfigMachineState'skeptbucket (the SQLite row already exists), and the caller reports every kept key as a Doctor change. No data corruption was observed, but the repeated "Auto-migrated legacy state" message is misleading and causes unnecessary concern.Evidence
plugins.bundledDiscoverymigration reported as a Doctor change on every beta CLI process restartfix/repeated-bundled-discovery-115151compatand writes it — no regression for first-time migrationchanges: []— no misleading Doctor outputTest Files 1 passed (1), Tests 11 passed (11))2026.7.2-beta.10,2026.7.2-rc.1); other migration sources for the same repeated-kept pattern; browser or mobile app UI flowsRoot Cause
The version comparison
compareOpenClawVersions(meta.lastTouchedVersion, "2026.7.2") === -1follows SemVer rules where prerelease (2026.7.2-beta.5) < release (2026.7.2). This causes the inference to re-fire on every new CLI process for beta users.Regression Test Plan
state-migrations.config-machine-state.test.ts"does not re-report inferred bundledDiscovery on second pass with beta version": first pass writes compat, second pass returnschanges: []Existing tests unaffected (all pass):
User-visible / Behavior Changes
Beta users will no longer see the "Auto-migrated legacy state: Kept existing shared SQLite plugins.bundledDiscovery state" message on every
openclaw status --deeporopenclaw gateway restart. The canonical value is preserved identically.Security Impact
Human Verification
plugins.bundledDiscoveryconfig path (not affected); empty allowlist (inference not triggered); other migration entries (kept reporting unchanged)Compatibility / Migration
Best-fix Verdict
result.importedin changes, notresult.kept— would suppress useful kept reporting for explicit fields. (2) Track whether entry was inferred vs explicit and filter — more complex, no benefit over current approachAI Assistance
Risks and Mitigations
readConfigMachineStatethrows (corrupt SQLite, permission error), the try/catch ensures compat is still inferred (safe fallback)>= 2026.7.2) are not affected; beta users see the same canonical value, just without the misleading Doctor outputFixes #115151