Skip to content

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

Closed

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 it — plugins.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.

Activity

  1. clawsweeper commented on Jun 27, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 27, 2026, 1:24 AM ET / 05:24 UTC.

    Summary
    Keep open: current main and v2026.6.10 still auto-enable and allowlist codex during doctor repair for OpenAI routes that resolve to the Codex runtime, and the related broader opt-out and legacy-migration work do not replace this doctor-specific config mutation report.

    Reproducibility: yes. at source level. Current main has a doctor repair test matching the reported shape and expecting plugins.entries.codex.enabled = true plus plugins.allow += "codex"; I did not run doctor --fix because this review must keep the checkout read-only.

    Root-cause cluster
    Relationship: canonical
    Canonical: #97180
    Summary: This issue is the narrow doctor-specific tracker for silent Codex plugin enablement/allowlist mutation; related OpenAI/Codex opt-out and migration items overlap but do not replace it.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Next step
    Manual review is needed because the source repro is clear but changing it requires a product/compatibility decision about Codex as an automatic OpenAI runtime dependency.

    Review details

    Best possible solution:

    Keep this doctor-specific tracker open and align doctor repair with explicit plugin/operator intent after maintainers decide the OpenAI-through-Codex dependency contract.

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

    Yes, at source level. Current main has a doctor repair test matching the reported shape and expecting plugins.entries.codex.enabled = true plus plugins.allow += "codex"; I did not run doctor --fix because this review must keep the checkout read-only.

    Is this the best way to solve the issue?

    No merged solution is the clear best fix yet. The source path is clear, but the best repair needs maintainer confirmation on whether doctor should auto-enable Codex for official OpenAI routes or warn and preserve explicit plugin state.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The correct fix depends on maintainer policy for whether official openai/* routes must materialize Codex as a runtime dependency during doctor repair or should warn and preserve explicit plugin/operator intent.
    • The issue also reports acpx disabled-entry removal, stale bundled load-path handling, and unrelated plugin drift not being fixed; those secondary symptoms are not proven by the Codex auto-enable source path and may need narrower follow-up if they remain.

    Codex review notes: model internal, reasoning high; reviewed against fbfadbd806e1.

    Label changes

    Label changes:

    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.

    Label justifications:

    • P2: This is a normal-priority doctor/config repair bug with bounded but real provider-routing impact for OpenAI users.
    • impact:auth-provider: The reported repair can change OpenAI model routing by enabling the Codex runtime plugin and expanding the plugin allowlist.
    • maturity:stable: The affected doctor/setup surface maps to cli-install-update-onboard-doctor, scored M4 Stable in the maturity shortlist.
    Evidence reviewed

    What I checked:

    Likely related people:

    • joshavant: Authored the merged doctor repair that enables plugins.entries.codex and adds codex to allowlists when OpenAI/Codex-runtime routes require the Codex plugin. (role: introduced behavior; confidence: high; commits: c5b33523266c; files: src/commands/doctor/shared/codex-route-warnings.ts, src/commands/doctor/shared/codex-route-warnings.test.ts)
    • pashpashpash: Authored the merged OpenAI routing change that made canonical openai/* agent routes use the Codex runtime by default and ensured the Codex plugin for that path. (role: feature-history contributor; confidence: medium; commits: 1c3399010815; files: src/agents/openai-routing.ts, src/commands/codex-runtime-plugin-install.ts, src/commands/doctor/shared/codex-route-warnings.ts)
    • steipete: Closed the earlier OpenAI-to-Codex doctor companion repair as the wrong surface and authored adjacent OpenAI provider identity and doctor auth migration work. (role: adjacent decision and migration contributor; confidence: medium; commits: d92b3b5cc2bd, 4c33aaa86c16; files: src/commands/doctor/shared/codex-route-warnings.ts, src/commands/doctor-auth-flat-profiles.ts)
    • brokemac79: Authored the merged disabled-Codex-plugin doctor lint surface adjacent to the route-harness availability checks. (role: recent area contributor; confidence: medium; commits: 90712f6d5e64; files: src/commands/doctor/shared/codex-route-warnings.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:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.
    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.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    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.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 27, 2026
  3. locked as resolved and limited conversation to collaborators on Sep 6, 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: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:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions