Skip to content

[Bug]: Upgrade leaves repeated shared SQLite plugin install metadata conflict warnings for codex/discord #90418

Closed

Description

@ramitrkar-hash

Summary

After upgrading a local macOS install from 2026.5.18 to 2026.6.1, OpenClaw repeatedly reports a legacy state migration/plugin install index warning for codex and discord, even though the plugin update appears to complete and the gateway runs normally.

Environment

  • OpenClaw before: 2026.5.18 (50a2481)
  • OpenClaw after: 2026.6.1 (2e08f0f)
  • Platform: macOS arm64
  • Install/update mode: pnpm, stable channel
  • Gateway: LaunchAgent, loopback 127.0.0.1:18789
  • Plugins involved: @openclaw/codex, @openclaw/discord

Repro / observed flow

Ran supervised upgrade:

openclaw update --tag 2026.6.1 --yes --timeout 3600 --no-restart

Update completed:

Update Result: OK
  Root: /opt/homebrew/lib/node_modules/openclaw
  Before: 2026.5.18
  After: 2026.6.1

Steps:
  ✓ global update
  ✓ global install swap
  ✓ openclaw doctor

Then plugin update ran:

Updating plugins...
Installing @openclaw/codex into ~/.openclaw/npm/projects/openclaw-codex-8902d781d4…
Linked peerDependency "openclaw" -> /opt/homebrew/lib/node_modules/openclaw
Installing @openclaw/discord into ~/.openclaw/npm/projects/openclaw-discord-c0892df945…
Linked peerDependency "openclaw" -> /opt/homebrew/lib/node_modules/openclaw
npm plugins: 2 updated, 0 unchanged.

But the following warning appeared during the update, during openclaw gateway restart --wait 120s, and again during openclaw channels status --json:

[state-migrations] Legacy state migration warnings:
- Left plugin install index in place because shared SQLite state has conflicting plugin install metadata for: codex, discord

Doctor warnings:
- Left plugin install index in place because shared SQLite state has conflicting plugin install metadata for: codex, discord

Expected behavior

After a successful plugin update, the install index/shared SQLite metadata should either:

  1. reconcile the new plugin install records automatically, or
  2. emit a one-time actionable repair command that clears the stale/conflicting records safely.

The warning should not keep recurring on normal health/status/restart flows if the runtime is healthy.

Actual behavior

The warning repeats across multiple commands even though runtime validation succeeds.

Post-upgrade validation:

openclaw --version -> OpenClaw 2026.6.1 (2e08f0f)
openclaw gateway status -> CLI version 2026.6.1, Gateway version 2026.6.1, connectivity probe ok
openclaw health --json -> ok=true, plugins loaded include codex and discord, plugin errors=[]
openclaw channels status --json -> Discord and Telegram running; all enabled Discord accounts eventually connected

Impact

This looks non-fatal, but it is noisy and confusing during upgrades. It makes operators unsure whether codex/discord plugin installs are clean or whether a stale install index may affect future plugin repair/update behavior.

Suggested fix

  • Add a deterministic migration/repair path for conflicting shared SQLite plugin install metadata.
  • If automatic repair is unsafe, include exact operator guidance in the warning, e.g. a specific openclaw doctor --fix/plugin repair command or a dry-runable cleanup command.
  • Suppress repeated warnings after the runtime has proven that the affected plugins are installed, linked, and loaded cleanly, or downgrade to a status note with remediation.

Activity

  1. clawsweeper commented on Jun 4, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 4, 2026, 1:09 PM ET / 17:09 UTC.

    Summary
    Keep this open: current main still has a conflict branch that leaves the legacy plugin install index in place, so a user with conflicting codex/discord install metadata can keep seeing the same warning across doctor/status/restart flows.

    Reproducibility: yes. source inspection gives a high-confidence reproduction path for the repeated warning: leave a conflicting legacy plugins/installs.json beside a shared SQLite installed_plugin_index, then run a legacy-state migration path. I did not run the full macOS upgrade scenario locally.

    Next step
    A focused repair can target the legacy install-index conflict policy and add regression coverage without adding config or changing plugin APIs.

    Review details

    Best possible solution:

    Teach the legacy install-index migration to deterministically retire superseded official plugin records after successful current install validation, while keeping clear doctor guidance for true metadata conflicts.

    Do we have a high-confidence way to reproduce the issue?

    Yes, source inspection gives a high-confidence reproduction path for the repeated warning: leave a conflicting legacy plugins/installs.json beside a shared SQLite installed_plugin_index, then run a legacy-state migration path. I did not run the full macOS upgrade scenario locally.

    Is this the best way to solve the issue?

    Yes, the requested direction is the right layer: this should be fixed in core legacy state/plugin install index migration rather than in codex or discord plugin code. The narrowest maintainable fix is safe reconciliation for superseded records plus actionable guidance for conflicts that cannot be proven safe.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • I did not run the full macOS upgrade flow, so the exact codex/discord metadata shape is taken from the issue report plus the current conflict-handling source path.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against e11e4e89351a.

    Label changes

    Label changes:

    • add P2: This is a normal upgrade/state cleanup bug with confusing repeated warnings but no reported runtime outage.
    • add impact:other: The affected surface is persistent plugin install metadata and upgrade diagnostics, which is maintainer-visible but outside the more specific impact labels.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.

    Label justifications:

    • P2: This is a normal upgrade/state cleanup bug with confusing repeated warnings but no reported runtime outage.
    • impact:other: The affected surface is persistent plugin install metadata and upgrade diagnostics, which is maintainer-visible but outside the more specific impact labels.
    Evidence reviewed

    Acceptance criteria:

    • node scripts/run-vitest.mjs src/commands/doctor-state-migrations.test.ts
    • node scripts/run-vitest.mjs src/cli/update-cli/post-core-plugin-convergence.test.ts

    What I checked:

    • Issue report: The report gives a concrete v2026.5.18 to v2026.6.1 macOS upgrade flow where the update and plugin sync succeeded, but the same legacy state migration warning recurred during update, gateway restart, and channels status.
    • Current conflict behavior: Current main detects conflicting legacy/current install records and returns the warning without reaching the archive call, leaving the legacy index source available for the next migration pass. (src/infra/state-migrations.ts:1501, e11e4e89351a)
    • Recurring detection path: Legacy state detection treats an existing legacy plugin install index file as a pending migration preview every time it exists. (src/infra/state-migrations.ts:2628, e11e4e89351a)
    • Doctor warning surface: The doctor health flow runs legacy state migrations when preview entries exist and prints any returned warnings as Doctor warnings. (src/flows/doctor-health-contributions.ts:357, e11e4e89351a)
    • Existing test locks repeated-conflict behavior: The migration test expects the conflicting install metadata warning and also expects the legacy source file to remain unarchived, matching the report's repeated-warning mechanism. (src/commands/doctor-state-migrations.test.ts:1513, e11e4e89351a)
    • Product contract context: Plugin install metadata is documented as machine-managed state stored in the shared SQLite installed_plugin_index row, so a noisy unresolved conflict belongs in core state/doctor handling. Public docs: docs/cli/plugins.md. (docs/cli/plugins.md:358, e11e4e89351a)

    Likely related people:

    • @steipete: Blame and shortlog point to Peter Steinberger on the current legacy migration comparator, post-core convergence comments, and most sampled state/update files. (role: recent area contributor; confidence: high; commits: 118060157d21, 28be124cc108, 38cb5aefc81a; files: src/infra/state-migrations.ts, src/commands/doctor-state-migrations.test.ts, src/cli/update-cli/post-core-plugin-convergence.ts)
    • @vincentkoc: Vincent Koc authored the v2026.6.1 release baseline and appears in recent history for update CLI and installed-plugin-index-adjacent paths. (role: release and adjacent update contributor; confidence: medium; commits: 2e08f0f4221f, a24af4910018, d4fb7d893d9d; files: src/infra/state-migrations.ts, src/cli/update-cli/update-command.ts, src/plugins/installed-plugin-index-store.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    on Jun 4, 2026
  3. jarvis-drakon commented on Jun 5, 2026

    @jarvis-drakon

    Confirming this on OpenClaw 2026.6.1 (2e08f0f), fresh-ish host upgraded in place. Same recurring openclaw doctor warning, doesn't clear across gateway restarts:

    - Left plugin install index in place because shared SQLite state has
      conflicting plugin install metadata for: acpx, brave, codex, shieldcortex-realtime, whatsapp
    - Left plugin-state sidecar in place because 1 row already existed in
      shared state: telegram/telegram.bot-info-cache/default
    

    Root cause (reproduced locally): the data is already migrated — the shared installed_plugin_index row in ~/.openclaw/state/openclaw.sqlite contains all the listed plugins. The migrator nonetheless refuses to retire the legacy ~/.openclaw/plugins/installs.json because the fingerprints mismatch, so it conservatively leaves the legacy file → warning recurs forever:

    field shared SQLite row legacy installs.json
    host_contract_version 2026.6.1 2026.5.28
    compat_registry_version 5680dbd9… 83616130…
    policy_hash differ differ
    migration_version 1 1

    The legacy file's refreshReason is source-changed, suggesting an @latest-spec plugin re-resolves on boot and rewrites the legacy fingerprint, perpetuating the mismatch even after the shared state is authoritative.

    Suggested reconcile rule: when the shared row already contains the records and carries a newer host_contract_version, treat the legacy file as stale → retire it (rename .migrated / delete) rather than flagging a conflict. Precedence by host_contract_version would make doctor --fix idempotent.

    Same underlying issue as #90213 and closed #90040 (no native reconcile path). Happy to provide the full sqlite dump if useful.

  4. clentjewell commented on Jun 6, 2026

    @clentjewell

    Confirming this issue on macOS arm64 (Mac mini), upgrading from an earlier version to 2026.6.1.

    Plugins affected: @openclaw/brave-plugin and @openclaw/whatsapp (rather than codex/discord, but same symptom and root cause).

    Context: Both plugins were originally installed to ~/.openclaw/npm/node_modules/ (old-style). After upgrading to 2026.6.1, running openclaw plugins update brave and openclaw plugins update whatsapp created new project-based installs under ~/.openclaw/npm/projects/, but the SQLite state retained entries for both the old and new paths — hence "conflicting plugin install metadata".

    What we tried:

    • openclaw plugins update brave/whatsapp — installs to new project dirs but SQLite conflict remains
    • openclaw plugins install @openclaw/brave-plugin --force — same result
    • openclaw plugins doctor — reports "No plugin issues detected" despite the warnings
    • openclaw gateway install --force — gateway healthy, warnings persist on every CLI invocation

    Workaround in progress: Overnight uninstall + clean reinstall of both plugins (openclaw plugins uninstall brave && openclaw plugins install @openclaw/brave-plugin). Will report back if that clears the SQLite state.

    Functional impact: None — gateway runs normally, Slack connected, web search (brave) operational. Purely cosmetic but noisy on every openclaw invocation. Would be good to have openclaw plugins doctor detect and repair this case.

  5. segway-virtus commented on Jun 8, 2026

    @segway-virtus

    Confirming this on Windows 10, OpenClaw 2026.6.5-beta.2 with @openclaw/feishu (same root cause as codex/discord/brave/whatsapp reported above).

    What happened

    After upgrading from 2026.6.1 → 2026.6.5-beta.2, openclaw gateway status persistently reported:

    Plugin version drift: 1 active official plugin not on gateway 2026.6.5-beta.2
    - feishu: 2026.5.20 (npm)
    

    openclaw plugins update feishu resolved to 2026.5.20 (stable), not the beta, actually downgrading the plugin.

    Root cause (3-layer storage mismatch)

    The plugin version is tracked across three independent stores — all must agree:

    Layer Location Issue
    A. npm disk ~/.openclaw/npm/projects/openclaw-feishu-<hash>/node_modules/ File on disk was 2026.6.5-beta.2 but gateway loaded 2026.5.20
    B. SQLite metadata ~/.openclaw/state/openclaw.sqlite → installed_plugin_index.install_records_json Recorded 2026.5.20, ignores manual npm install
    C. Legacy JSON index ~/.openclaw/plugins/installs.json Stale 2026.5.20 record conflicted with SQLite, causing doctor to leave index in place

    Additionally: openclaw plugins update resolves via compat registry → defaults to latest stable (2026.5.20), not beta (2026.6.5-beta.2), so it can silently downgrade.

    Resolution (manual, for feishu on Windows)

    1. Delete legacy installs.json and refresh registry:

      rm ~/.openclaw/plugins/installs.json
      openclaw plugins registry --refresh
      
    2. Direct npm install in the managed projects directory (bypass openclaw plugins update which resolves to stable):

      cd ~/.openclaw/npm/projects/openclaw-feishu-<hash>
      npm install @openclaw/feishu@2026.6.5-beta.2 --legacy-peer-deps
      
    3. Patch SQLite install_records_json to match the actual version on disk:

      import sqlite3, json
      db = sqlite3.connect('~/.openclaw/state/openclaw.sqlite')
      row = db.execute("SELECT install_records_json, plugins_json, index_key FROM installed_plugin_index LIMIT 1").fetchone()
      records = json.loads(row[0])
      records['feishu']['version'] = '2026.6.5-beta.2'
      records['feishu']['resolvedVersion'] = '2026.6.5-beta.2'
      # also update plugins_json[].packageVersion for feishu entry
      db.execute("UPDATE installed_plugin_index SET install_records_json=?, plugins_json=? WHERE index_key=?", ...)
      db.commit()
    4. Restart gateway: openclaw gateway restart

    After these steps, openclaw gateway status shows no plugin version drift.

    Full technical writeup available if helpful — happy to share.

  6. abelaibricker commented on Jun 8, 2026

    @abelaibricker

    Confirmando o mesmo sintoma em outro setup (Linux Ubuntu 24, OpenClaw 2026.6.1 / 2e08f0f, systemd user service):

    • Upgrade: 2026.5.28 → 2026.6.1
    • Plugins afetados: acpx, codex, slack (3 plugins non-bundled)
    • Warning aparece em: doctor, gateway restart, channels status, no boot do gateway (state-migrations subsystem)

    openclaw plugins registry --refresh não resolve (já rodado). plugins update slack reporta "up to date (2026.6.1)" mas o warning persiste.

    Observação extra: o state-migrations arquiva o legacy installs.json apenas se não houver conflito de versão, e como há (5.28 vs 6.1), o arquivo legacy nunca é arquivado. Workaround atual: ignorar o warning (issue #90040 já fechou como "stderr-only em --json"), mas seria útil ter um openclaw plugins registry --reconcile-install-index ou doctor --fix scoped pra isso, como o reporter original sugeriu.

    Caso relacionado/irmão: #90040 (CLOSED como already-implemented, mas só pro caso de --json corruption).

  7. 100yenadmin commented on Jun 14, 2026

    @100yenadmin
    Contributor

    Confirming the same stale shared-state/legacy-index class on a macOS LaunchAgent install.

    Environment:

    • OpenClaw: 2026.6.5 (5181e4f)
    • Plugin involved here: @martian-engineering/lossless-claw
    • Local context: upgraded lossless-claw to 0.12.0 under an hour before this repair run

    What now reports correctly:

    • openclaw plugins list reports Lossless Context Management as 0.12.0.
    • Active package metadata under ~/.openclaw resolves @martian-engineering/lossless-claw@0.12.0.
    • openclaw plugins install @martian-engineering/lossless-claw@0.12.0 --force succeeds.
    • openclaw plugins registry --refresh --json computes a refreshed registry where lossless-claw install/package metadata is 0.12.0.
    • Runtime loads and works with the upgraded plugin. A fresh post-restart LCM compaction succeeded with gpt-5.4-mini: tokensBefore=242272, tokensAfter=37035, createdSummaryId=sum_490d8869519781bf, no truncation marker on the new summaries.

    What remains stale:

    • ~/.openclaw/plugins/installs.json still has installRecords.lossless-claw.spec as @martian-engineering/lossless-claw@0.11.2.
    • The same legacy index has version, resolvedVersion, and resolvedSpec at 0.11.2.
    • The plugin entry inside that file still has packageVersion: 0.11.2.
    • CLI/gateway runs still warn:
      Left plugin install index in place because shared SQLite state has conflicting plugin install metadata for: acpx, codex, lossless-claw, tokenjuice

    Commands that did not clear the stale legacy index:

    openclaw plugins install @martian-engineering/lossless-claw@0.12.0 --force
    openclaw plugins registry --refresh --json
    openclaw plugins list

    So this is non-fatal for runtime in this case, but the repair/refresh path appears incomplete: registry --refresh --json can compute the correct 0.12.0 state, while the stale plugins/installs.json state is left in place and keeps producing the conflict warning.

    Expected behavior:

    • A targeted reinstall plus registry refresh should either reconcile the stale legacy install index for the affected plugin, archive/retire the stale legacy index when shared SQLite is authoritative, or expose a narrow repair command for this exact case.
    • It should not require broad openclaw doctor --fix, because doctor currently wants to touch unrelated cron/security/bootstrap items too.
  8. jmar5439 commented on Jun 15, 2026

    @jmar5439

    same here

  9. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions