openclaw - 💡(How to fix) Fix Doctor misses legacy top-level plugin tools migration [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

QA impact: P2 for local gateway/Codex confidence, because plugin-tool failures look like runtime/tool-surface regressions even when the product contract is correct and the user only needs a deterministic migration.

Fix Action

Fixed

Code Example

{
  "id": "cortex",
  "tools": ["cortex_search", "cortex_remember"]
}

---

{
  "id": "cortex",
  "contracts": {
    "tools": ["cortex_search", "cortex_remember"]
  }
}

---

VITEST_MAX_WORKERS=1 pnpm test src/commands/doctor-plugin-manifests.test.ts
RAW_BUFFERClick to expand / collapse

TLDR

Beta.5 correctly requires plugins that register agent tools to declare them under contracts.tools, but openclaw doctor only migrates legacy top-level provider capability keys. It misses legacy top-level tools, so older local plugins can fail at runtime with plugin must declare contracts.tools... even though doctor could safely rewrite the manifest.

Impact

Product impact: P2 for beta.5 plugin compatibility. Existing local plugins that still use top-level tools can lose their agent tools after the stricter manifest contract enforcement.

QA impact: P2 for local gateway/Codex confidence, because plugin-tool failures look like runtime/tool-surface regressions even when the product contract is correct and the user only needs a deterministic migration.

What is wrong

Runtime enforcement is working as intended: plugin-owned tools must be declared in contracts.tools before registerTool/tool metadata registration. The gap is in the repair path:

  • src/plugins/registry.ts rejects undeclared tool registrations.
  • src/commands/doctor-plugin-manifests.ts migrates legacy top-level speechProviders, mediaUnderstandingProviders, and imageGenerationProviders into contracts.
  • The same doctor migration does not include legacy top-level tools.

A local Cortex manifest showed the affected legacy shape:

{
  "id": "cortex",
  "tools": ["cortex_search", "cortex_remember"]
}

That should become:

{
  "id": "cortex",
  "contracts": {
    "tools": ["cortex_search", "cortex_remember"]
  }
}

Reproduction

  1. Create or install a plugin manifest with top-level tools and no contracts.tools.
  2. Have the plugin register one of those tools.
  3. Run beta.5 with plugin loading enabled.
  4. Runtime rejects the plugin/tool registration because contracts.tools is absent.
  5. Run doctor repair; before this fix, doctor does not offer to migrate the legacy top-level tools field.

Proposed fix

Include tools in the existing legacy manifest contract migration list. If contracts.tools is empty, move top-level tools into it. If contracts.tools already exists, remove the duplicate legacy top-level tools and keep the contract value.

Validation

Focused local validation on a Lexar-backed checkout:

VITEST_MAX_WORKERS=1 pnpm test src/commands/doctor-plugin-manifests.test.ts

The focused doctor test file passed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING