Skip to content

doctor --fix silently adds and enables the uninstalled codex plugin (routing-altering) when openai is enabled #97180

Description

@inemtsev

Summary

On 2026.6.10, running openclaw doctor --fix (to reconcile an unrelated plugin version drift) silently added the external codex plugin to my config and enabled itplugins.allow += "codex" and plugins.entries.codex = { "enabled": true } — even though:

  • I have never configured codex,
  • the @openclaw/codex package is not installed on this machine, and
  • the codex plugin alters provider routing (it pulls openai/* into the Codex harness).

It appears to be the "enable codex when the openai plugin is enabled" coupling (cf. #70767) firing inside doctor --fix. Because my openai plugin is enabled, --fix decided I should have codex enabled too. The config write hot-reloaded live within ~2s.

It was harmless only by luck — the @openclaw/codex package wasn't installed, so nothing loaded and openai/* routing was unaffected (verified). On any machine where that package is present (it has auto-installed on upgrade historically), this would silently reroute all OpenAI traffic — including orchestrator + fallback chains — by merely running a health check.

Why I think this is a bug (not just a bad default)

  1. --fix injected config I never declared. A repair command should reconcile toward the user's declared intent, not add and enable a brand-new, routing-altering plugin.
  2. It enabled an uninstalled plugin. Writing enabled: true for a plugin whose package is absent yields an internally inconsistent config. (Doctor's own lint elsewhere flags "plugin not installed" for acpx — yet it happily enables codex which is equally not installed.)
  3. It contradicted its own diagnostic. Doctor warned: "ignored plugins.load.paths entry that points at OpenClaw's current bundled plugin directory; remove this redundant path." --fix left that path in place and instead deleted my explicit acpx: { "enabled": false } entry — destroying intent rather than fixing the flagged item (related: doctor --fix strips renamed config keys and disables the plugin instead of migrating #84985).
  4. It did not fix what it was run for — the actual plugin version drift it was invoked to reconcile was untouched.

Reproduction

  1. On 2026.6.10, have plugins.entries.openai.enabled = true and no codex entry in config.
  2. Run openclaw doctor --fix.
  3. Diff the config against the pre-fix backup doctor writes (openclaw.json.bak).

Actual config change made by --fix (sanitized)

  plugins.allow:
-   "acpx",
    ...
    "memory-core",
+   "codex"

  plugins.entries:
-   "acpx": { "enabled": false },
+   "codex": { "enabled": true }

  plugins.load.paths:
    # UNCHANGED — the redundant bundled acpx path doctor warned about was NOT removed
    [ ".../openclaw/dist/extensions/acpx" ]

Expected behavior

  • doctor --fix should not add and enable a plugin the user never configured — at minimum it should not enable a plugin whose package is not installed, and never one that silently changes provider routing without explicit confirmation.
  • It should fix the item it actually warned about (the redundant plugins.load.paths entry) and preserve explicit user enabled: false choices.

Environment

  • OpenClaw: 2026.6.10 (global npm package, Node 24.14.1, Linux)
  • Gateway: systemd user service on 127.0.0.1:18789
  • openai plugin enabled; codex never configured; @openclaw/codex not installed
  • Only bundled codex-related extension present is codex-supervisor; plain codex is an external catalog plugin

Related

Happy to provide the full sanitized config diff or logs if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions