Skip to content

fix(cli): report stale plugin doctor config#81515

Merged
altaywtf merged 2 commits into
openclaw:mainfrom
BKF-Gitty:codex/81499-plugin-doctor-config
May 13, 2026
Merged

fix(cli): report stale plugin doctor config#81515
altaywtf merged 2 commits into
openclaw:mainfrom
BKF-Gitty:codex/81499-plugin-doctor-config

Conversation

@BKF-Gitty

Copy link
Copy Markdown
Contributor

Summary

  • Problem: openclaw plugins doctor could print stale plugin config warnings and still end with No plugin issues detected.
  • Why it matters: operators could read that final line as proof that plugin config was healthy, even when plugins.allow, plugins.entries, or plugins.slots.* still referenced a missing plugin.
  • What changed: plugins doctor now reuses the shared stale-plugin-config scanner, reports those findings under Plugin configuration:, and prints No plugin install-tree issues detected; configuration warnings remain. when only config findings exist.
  • What did NOT change (scope boundary): no plugin rollback, install/security scanner, cleanup, config mutation, JSON, or exit-code behavior changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: stale plugin config no longer ends with the plain success line from openclaw plugins doctor.
  • Real environment tested: OpenClaw source checkout in the local OpenClaw PR container.
  • Exact steps or command run after this patch:
OPENCLAW_CONFIG_PATH=/workspace/openclaw/.tmp/openclaw-81499-proof/openclaw.json \
OPENCLAW_STATE_DIR=/workspace/openclaw/.tmp/openclaw-81499-proof/state \
pnpm openclaw plugins doctor
  • Evidence after fix:
Plugin configuration:
- plugins.allow: stale plugin reference "lossless-claw" was found.
- plugins.entries.lossless-claw: stale plugin reference "lossless-claw" was found.
- plugins.slots.contextEngine: slot references missing plugin "lossless-claw".
- Run "openclaw doctor --fix" to remove stale plugin ids and dangling channel references.

No plugin install-tree issues detected; configuration warnings remain.
  • Observed result after fix: the command reports actionable stale-config findings and does not print No plugin issues detected. when warnings remain.
  • What was not tested: plugin rollback, plugin install/update/uninstall paths, scanner policy changes, JSON output because plugins doctor has no JSON mode.
  • Before evidence (optional but encouraged): the same command path previously printed config warnings followed by No plugin issues detected.

Root Cause (if applicable)

  • Root cause: plugins doctor only counted runtime plugin load errors, manifest/discovery errors, source shadowing, and compatibility notices when deciding its final verdict.
  • Missing detection / guardrail: stale plugin config warnings already existed in the shared doctor scanner, but plugins doctor did not include them.
  • Contributing context (if known): the full CLI can warn from source config while runtime config has already normalized or ignored stale plugin references, so the scanner must inspect the config file source snapshot.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/cli/plugins-cli.list.test.ts
  • Scenario the test should lock in: plugins.allow, plugins.entries.lossless-claw, and plugins.slots.contextEngine reference an unavailable lossless-claw plugin while runtime diagnostics are otherwise clean.
  • Why this is the smallest reliable guardrail: it exercises the plugins doctor command path and the real shared stale-config scanner without touching plugin install or cleanup behavior.
  • Existing test that already covers this (if any): src/commands/doctor/shared/stale-plugin-config.test.ts covers the scanner helper, but not the plugins doctor verdict.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

openclaw plugins doctor now reports stale plugin config references and distinguishes a healthy install tree from remaining config warnings.

Diagram (if applicable)

Before:
plugins doctor -> config warnings -> No plugin issues detected.

After:
plugins doctor -> plugin configuration findings -> install-tree-only summary

Security Impact (required)

  • New permissions/capabilities? (Yes/No): No
  • Secrets/tokens handling changed? (Yes/No): No
  • New/changed network calls? (Yes/No): No
  • Command/tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS host with OpenClaw PR container
  • Runtime/container: OpenClaw PR container via openclaw-shell
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted):
{
  "plugins": {
    "allow": ["lossless-claw"],
    "entries": {
      "lossless-claw": {
        "enabled": true
      }
    },
    "slots": {
      "contextEngine": "lossless-claw"
    }
  }
}

Steps

  1. Create the isolated config above.
  2. Run pnpm openclaw plugins doctor with OPENCLAW_CONFIG_PATH and OPENCLAW_STATE_DIR pointed at the isolated temp paths.
  3. Inspect the final doctor output.

Expected

  • Stale plugin config is reported as plugin doctor findings.
  • The command does not end with plain No plugin issues detected. while config warnings remain.

Actual

  • Matches expected.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: focused Vitest coverage for plugins doctor; real pnpm openclaw plugins doctor output with a stale lossless-claw config.
  • Edge cases checked: healthy command output remains No plugin issues detected.; source-config scanner catches stale refs even when runtime config is sanitized.
  • What you did not verify: plugin rollback, install/update/uninstall, security scanner behavior, config cleanup mutation, exit-code changes.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No): Yes
  • Config/env changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: plugins doctor now does one additional config snapshot read and stale-config scan.
    • Mitigation: reuses existing doctor scanner and keeps behavior read-only.

Validation

  • pnpm run docs:list: pass
  • pnpm test src/cli/plugins-cli.list.test.ts src/commands/doctor/shared/stale-plugin-config.test.ts: pass
  • pnpm exec oxfmt --check src/cli/plugins-cli.ts src/cli/plugins-cli.list.test.ts docs/cli/plugins.md: pass
  • pnpm exec oxlint src/cli/plugins-cli.ts src/cli/plugins-cli.list.test.ts: pass
  • pnpm tsgo: pass
  • git diff --check: pass
  • pnpm check:changed: fails in unrelated all-project typecheck on src/plugins/registry.runtime-config.test.ts:45 and :46; those files are outside this PR diff.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S proof: supplied External PR includes structured after-fix real behavior proof. labels May 13, 2026
@clawsweeper

clawsweeper Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR wires openclaw plugins doctor into the shared stale-plugin-config scanner, adds focused CLI/docs coverage for stale config warnings, and makes a lint-equivalent install-scanner edit.

Reproducibility: yes. Current main has a clear source reproduction path: the shared scanner can detect stale plugin config, but plugins doctor currently omits that state from its success decision.

Real behavior proof
Sufficient (live_output): The PR body includes an after-fix command and copied CLI output from an OpenClaw checkout showing stale config warnings and the revised summary.

Next step before merge
No automated repair job is indicated; the remaining path is ordinary maintainer review and CI/merge gating.

Security
Cleared: The diff only changes local CLI reporting, docs/tests, and an equivalent regex-to-includes lint edit; I found no new security or supply-chain concern.

Review details

Best possible solution:

Land the focused diagnostic fix if maintainers accept this remediation-summary route, and keep or adjust the linked issue handling if updater cleanup remains separate.

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

Yes. Current main has a clear source reproduction path: the shared scanner can detect stale plugin config, but plugins doctor currently omits that state from its success decision.

Is this the best way to solve the issue?

Yes for the PR's scoped bug. Reusing the existing source-config scanner is the narrow maintainable fix without changing updater rollback, config mutation, JSON, or exit-code behavior.

What I checked:

Likely related people:

  • steipete: Git blame and commit metadata tie the current plugins doctor command, stale-config scanner, and adjacent install-security scanner behavior to recent commits by this contributor. (role: recent area contributor; confidence: high; commits: 756379b11ddf, 439e39626220; files: src/cli/plugins-cli.ts, src/commands/doctor/shared/stale-plugin-config.ts, src/plugins/install-security-scan.runtime.ts)

Remaining risk / open question:

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

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 13, 2026
@BKF-Gitty BKF-Gitty force-pushed the codex/81499-plugin-doctor-config branch from 600d33c to b45a4be Compare May 13, 2026 19:58
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 13, 2026
@altaywtf altaywtf self-assigned this May 13, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 13, 2026
@altaywtf altaywtf requested a review from a team as a code owner May 13, 2026 21:00
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label May 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui extensions: memory-lancedb Extension: memory-lancedb scripts Repository scripts commands Command implementations docker Docker and sandbox tooling extensions: codex size: XL and removed size: S proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 13, 2026
@altaywtf altaywtf force-pushed the codex/81499-plugin-doctor-config branch from 9dc72d8 to 23bc849 Compare May 13, 2026 21:01
@openclaw-barnacle openclaw-barnacle Bot removed app: web-ui App: web-ui extensions: memory-lancedb Extension: memory-lancedb scripts Repository scripts commands Command implementations docker Docker and sandbox tooling extensions: codex labels May 13, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label May 13, 2026
@altaywtf altaywtf merged commit b8ea609 into openclaw:main May 13, 2026
112 of 115 checks passed
@altaywtf

Copy link
Copy Markdown
Member

Merged via squash.

Thanks @BKF-Gitty!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Merged via squash.

Prepared head SHA: 23bc849
Co-authored-by: BKF-Gitty <263413630+BKF-Gitty@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Merged via squash.

Prepared head SHA: 23bc849
Co-authored-by: BKF-Gitty <263413630+BKF-Gitty@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Merged via squash.

Prepared head SHA: 23bc849
Co-authored-by: BKF-Gitty <263413630+BKF-Gitty@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2026.5.12-beta.5 plugin update disables lossless-claw after @beta fallback and leaves stale contextEngine config

2 participants