Skip to content

fix(config): warn for missing official memory slot#82438

Merged
steipete merged 3 commits into
openclaw:mainfrom
giodl73-repo:fix-missing-memory-slot-82428
May 16, 2026
Merged

fix(config): warn for missing official memory slot#82438
steipete merged 3 commits into
openclaw:mainfrom
giodl73-repo:fix-missing-memory-slot-82428

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat a missing official external memory slot plugin as a config warning with the catalog install hint instead of a startup-blocking validation issue.
  • Preserve the hard validation failure for unknown/non-catalog missing memory slot IDs.
  • Update the memory-lancedb docs to make the npm install step explicit before slot configuration.
  • Repair a current-main doctor test fixture type shape that blocks the core test typecheck on the rebased branch.

Fixes #82428.

Tests

  • CI=1 node scripts/run-vitest.mjs src/flows/doctor-health-contributions.test.ts src/config/config.plugin-validation.test.ts src/config/recovery-policy.test.ts src/gateway/server-startup-config.recovery.test.ts
  • pnpm exec oxfmt --check --threads=1 src/config/validation.ts src/config/config.plugin-validation.test.ts docs/plugins/memory-lancedb.md src/flows/doctor-health-contributions.test.ts
  • git diff --check
  • pnpm check:changed

Real behavior proof

Behavior or issue addressed:
Configuring plugins.slots.memory = "memory-lancedb" before installing @openclaw/memory-lancedb no longer makes config validation reject the config with plugins.slots.memory: plugin not found: memory-lancedb. It now reports the official external plugin install warning, while unknown missing memory slot IDs still hard-fail.

Real environment tested:
Ubuntu 24.04 WSL source checkout at /root/src/openclaw-branches/base on branch fix-missing-memory-slot-82428, using a source-level harness that calls the real validateConfigObjectWithPlugins() validator with an empty plugin manifest registry to represent memory-lancedb not installed. The before comparison used a detached origin/main worktree with the same harness and shared local dependencies.

Exact steps or command run after this patch:

  1. Ran validateConfigObjectWithPlugins({ agents: { list: [{ id: "pi" }] }, plugins: { slots: { memory: "memory-lancedb" } } }, { pluginMetadataSnapshot: { manifestRegistry: { plugins: [], diagnostics: [] } } }) against a detached origin/main worktree.
  2. Ran the same validateConfigObjectWithPlugins() input against this branch.
  3. Ran the focused config/startup tests and changed-file gate listed above.

Evidence after fix:
Before (origin/main) returned:

{
  "ok": false,
  "warnings": [],
  "issues": [
    {
      "path": "plugins.slots.memory",
      "message": "plugin not found: memory-lancedb"
    }
  ]
}

After this patch returned:

{
  "ok": true,
  "warnings": [
    {
      "path": "plugins.slots.memory",
      "message": "plugin not installed: memory-lancedb — install the official external plugin with: openclaw plugins install @openclaw/memory-lancedb"
    }
  ],
  "issues": []
}

Observed result after fix:
The missing official external memory slot no longer produces an invalid config result, so the gateway startup config validation path can proceed while surfacing the actionable install command. The existing unknown-slot regression coverage still proves plugins.slots.memory = "missing-slot" fails with plugin not found: missing-slot.

What was not tested:
No full Docker restart loop was launched. The proof uses the real config validator source path with a mocked empty plugin registry snapshot rather than starting a gateway container.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels May 16, 2026
@clawsweeper

clawsweeper Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

Summary
The PR changes config validation so a missing official external memory-lancedb memory slot warns with an install hint, adds regression coverage, and updates the Memory LanceDB docs to show the install step.

Reproducibility: yes. Current-main source shows explicit missing plugins.slots.memory values become hard validation issues, and the linked issue plus PR body give a concrete memory-lancedb before/after validator path.

Real behavior proof
Sufficient (live_output): The PR body includes before/after live output from the real validateConfigObjectWithPlugins() path for the missing memory-lancedb behavior.

Next step before merge
A narrow PR-branch repair can address the validator edge case; merge remains maintainer-owned after the protected-label review.

Security
Cleared: The diff only changes config validation, docs, and tests; it adds no dependency, workflow, secret, package-resolution, or code-execution surface, and blocked plugin diagnostics remain fatal.

Review findings

  • [P2] Keep non-memory official plugins fatal — src/config/validation.ts:1557-1562
Review details

Best possible solution:

Narrow the warning-only path to official external plugins that can own the memory slot, keep wrong slot IDs fatal, and then land the validator/docs fix through normal maintainer review.

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

Yes. Current-main source shows explicit missing plugins.slots.memory values become hard validation issues, and the linked issue plus PR body give a concrete memory-lancedb before/after validator path.

Is this the best way to solve the issue?

No. The intended memory-lancedb behavior is narrow and maintainable, but the diff uses official catalog membership instead of memory-slot capability, so it also softens invalid non-memory slot ids.

Full review comments:

  • [P2] Keep non-memory official plugins fatal — src/config/validation.ts:1557-1562
    formatMissingOfficialExternalPluginWarning(memorySlot) returns a warning for any cataloged official external plugin, not only memory plugins. With this change, a config like plugins.slots.memory = "brave" and an empty registry becomes warning-only even though the memory slot contract requires an active memory plugin id. Please restrict this path to official memory-capable plugins, or add catalog capability metadata, so wrong slot ids still fail validation.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.88

Acceptance criteria:

  • CI=1 node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts
  • pnpm exec oxfmt --check --threads=1 src/config/validation.ts src/config/config.plugin-validation.test.ts docs/plugins/memory-lancedb.md
  • git diff --check

What I checked:

  • Live PR state: GitHub API shows the PR is open, non-draft, mergeable, at head 447d511, and labeled maintainer plus proof: sufficient. (447d51170a32)
  • Current-main hard failure path: Current main sends an explicit missing plugins.slots.memory value to pushMissingPluginIssue without warnOnly, matching the reported hard validation failure before this PR. (src/config/validation.ts:1549, 4b940f66fda0)
  • PR diff softens slot validation by catalog membership: The PR sets warnOnly for the memory slot when formatMissingOfficialExternalPluginWarning(memorySlot) returns a value, which checks official catalog membership rather than memory capability. (src/config/validation.ts:1557, 447d51170a32)
  • Memory slot contract: The config contract says plugins.slots.memory selects the plugin that owns the memory slot, and public docs describe it as the active memory plugin id. (src/config/types.plugins.ts:41, 4b940f66fda0)
  • Official catalog includes non-memory plugins: The official external plugin catalog includes entries such as brave with web-search metadata and an install hint, so the PR's broad catalog check would also warn for a non-memory plugin placed in plugins.slots.memory. (scripts/lib/official-external-plugin-catalog.json:30, 4b940f66fda0)
  • Related user report and proof: The linked issue reports the 2026.5.12 Docker crash loop for uninstalled memory-lancedb, and the PR body provides before/after live validator output for the intended memory-lancedb case.

Likely related people:

  • hclsys: Commit b3e42bf added catalog-backed install hints for missing official external plugins in config validation and tests, which this PR extends to memory-slot validation. (role: install-hint validation contributor; confidence: high; commits: b3e42bf32792; files: src/config/validation.ts, src/config/config.plugin-validation.test.ts)
  • joshavant: Commit 0240cc5 recently changed official external plugin install recovery and catalog metadata used by the install-hint path. (role: adjacent official-plugin install contributor; confidence: medium; commits: 0240cc578c2c; files: scripts/lib/official-external-plugin-catalog.json, src/cli/plugins-install-command.ts, src/commands/doctor/shared/missing-configured-plugin-install.ts)
  • Vincent Koc: Local blame in this partial checkout maps the current config validation, config-validation tests, catalog, and Memory LanceDB docs snapshot to this recent boundary commit; deeper local history is graft-limited. (role: recent area contributor; confidence: low; commits: c2c7396ffb69; files: src/config/validation.ts, src/config/config.plugin-validation.test.ts, docs/plugins/memory-lancedb.md)

Remaining risk / open question:

  • The current PR would make a non-memory official external plugin id such as brave in plugins.slots.memory warning-only instead of a hard validation error.

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

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Fixed the blocked-memory-slot finding by keeping registry-blocked official external memory slots as hard validation failures while preserving warning-only behavior for genuinely missing uninstalled official memory plugins. Added regression coverage for blocked memory-lancedb diagnostics.\n\nValidation:\n- CI=1 node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts src/config/recovery-policy.test.ts src/gateway/server-startup-config.recovery.test.ts\n- pnpm exec oxfmt --check --threads=1 src/config/validation.ts src/config/config.plugin-validation.test.ts docs/plugins/memory-lancedb.md src/flows/doctor-health-contributions.test.ts\n- git diff --check\n- pnpm check:changed\n\n@clawsweeper re-review

@giodl73-repo
giodl73-repo force-pushed the fix-missing-memory-slot-82428 branch 2 times, most recently from 4270b77 to 447d511 Compare May 16, 2026 06:22
@steipete
steipete force-pushed the fix-missing-memory-slot-82428 branch from 447d511 to 1188470 Compare May 16, 2026 12:17
@steipete

Copy link
Copy Markdown
Contributor

Verification before merge:

Behavior addressed: configs that explicitly select the official external memory-lancedb memory slot now validate with a warning instead of blocking Gateway startup. The selected-slot warning says Gateway will run without persistent memory until the plugin is installed, while stale entries/allowlist hints stay generic and non-memory official plugins in the memory slot remain fatal.
Real environment tested: local macOS checkout on rebased PR branch fix-missing-memory-slot-82428, head 1188470.
Exact steps or command run after this patch:

  • pnpm docs:list
  • node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts
  • pnpm exec oxfmt --check --threads=1 src/config/validation.ts src/config/config.plugin-validation.test.ts docs/plugins/memory-lancedb.md
  • git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review
    Evidence after fix: focused config validation passes with 33 tests; oxfmt check and diff whitespace check pass; codex-review reports no accepted/actionable findings.
    Observed result after fix: selected missing memory-lancedb slot is warning-only with the explicit no-persistent-memory warning; stale memory-lancedb entry/allow references get install hints only; blocked memory-lancedb and brave-in-memory-slot stay hard validation failures.
    What was not tested: full package upgrade survivor / live Gateway restart loop; CI is running on the pushed PR head.

giodl73-repo and others added 3 commits May 16, 2026 13:20
Preserve hard validation failures for official external memory slot plugins that are blocked by registry diagnostics, while keeping missing uninstalled official memory plugins warning-only.

Co-authored-by: Copilot <[email protected]>
@steipete
steipete force-pushed the fix-missing-memory-slot-82428 branch from 1188470 to 0a9af33 Compare May 16, 2026 12:21
@steipete

Copy link
Copy Markdown
Contributor

Rebased verification update:

Behavior addressed: same as above, now rebased on latest origin/main.
Real environment tested: local macOS checkout on PR branch fix-missing-memory-slot-82428, head 0a9af335891fd0b850674cbf91c84208dd06cc57.
Exact steps or command run after this patch:

  • node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts
  • pnpm exec oxfmt --check --threads=1 src/config/validation.ts src/config/config.plugin-validation.test.ts docs/plugins/memory-lancedb.md
  • git diff --check
    Evidence after fix: focused config validation passes with 33 tests; oxfmt check and diff whitespace check pass.
    Observed result after fix: selected missing memory-lancedb slot is warning-only with the explicit no-persistent-memory warning; stale memory-lancedb entry/allow references get install hints only; blocked memory-lancedb and brave-in-memory-slot stay hard validation failures.
    What was not tested: full package upgrade survivor / live Gateway restart loop; CI is running on the pushed PR head. The inherited check-test-types failure also exists on current origin/main at e6d0455.

@steipete

Copy link
Copy Markdown
Contributor

Correction to the rebased verification note: rebased PR head is 0a9af33.

@steipete
steipete merged commit 1426112 into openclaw:main May 16, 2026
111 of 113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR proof: sufficient ClawSweeper judged the real behavior proof convincing. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway crash-loops when plugins.slots.memory references an uninstalled plugin; bundled memory-lancedb docs don't flag install step

2 participants