Skip to content

fix(doctor): ignore disabled MCP servers in warnings - #131352

Merged
Patrick-Erichsen merged 1 commit into
openclaw:mainfrom
sunlit-deng:sunlit/fix/issue-131103
Aug 28, 2026
Merged

Patrick-Erichsen merged 1 commit into
openclaw:mainfrom
sunlit-deng:sunlit/fix/issue-131103

Conversation

@sunlit-deng

Copy link
Copy Markdown
Contributor

Closes #131103

What Problem This Solves

Fixes an issue where openclaw doctor reports an MCP sandbox allowlist warning for a server that is explicitly disabled in configuration.

Why This Change Was Made

The doctor-side MCP server projection now applies the same enabled: false exclusion as the runtime resolver. Active configured servers remain eligible for the warning, so this only removes the false positive for disabled definitions.

User Impact

Operators can keep disabled MCP server definitions in their configuration without receiving a misleading sandbox allowlist warning. Enabled MCP servers continue to receive the existing warning when their tools are not allowed in the sandbox.

Evidence

  • Real production CLI call chain: pnpm openclaw doctor --no-workspace-suggestions with an isolated config fixture and state directory; the command reaches src/commands/doctor-config-flow.ts and the changed MCP warning collector.
  • Canonical precedent: the existing runtime resolver in src/agents/tool-policy-declared-context.ts already excludes records where enabled === false.
$ OPENCLAW_CONFIG_PATH=<disabled-mcp-fixture> OPENCLAW_STATE_DIR=<isolated-state> pnpm openclaw doctor --no-workspace-suggestions
base e946d226f73c8827205b0efd94dcd82e199e48b7: Doctor warnings included "mcp.servers defines 1 MCP server (\"supabase\")..."
after-fix head ee6b744190938f917f0f249749d6414928938d0c: no MCP sandbox allowlist warning for disabled "supabase"
negative-control at the same head with enabled=true: Doctor warnings included "mcp.servers defines 1 MCP server (\"supabase\")..."
Proof script
set -eu

run_doctor() {
  fixture="$1"
  state_dir="$(mktemp -d)"
  env -u NODE_OPTIONS OPENCLAW_NO_RESPAWN=1 \
    OPENCLAW_CONFIG_PATH="$fixture" OPENCLAW_STATE_DIR="$state_dir" \
    pnpm openclaw doctor --no-workspace-suggestions
}

run_doctor <disabled-mcp-fixture>
run_doctor <enabled-mcp-fixture>
  • env -u NODE_OPTIONS pnpm test src/commands/doctor/shared/plugin-tool-allowlist-warnings.test.ts — 28 tests passed.
  • git diff --check — passed.

AI-assisted: built with Codex

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Aug 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 7:33 PM ET / 23:33 UTC.

ClawSweeper review

What this changes

The PR makes Doctor ignore MCP server entries explicitly marked disabled when producing sandbox allowlist warnings, with a regression test.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. This PR is still necessary because current main retains the false-positive Doctor path; the one-line owner-boundary repair matches the active runtime behavior and has focused coverage plus a supplied real CLI trace.

Priority: P2
Reviewed head: ee6b744190938f917f0f249749d6414928938d0c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behaviorally aligned repair with credible production-path terminal evidence and regression coverage.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed production owner is invoked from the Doctor configuration flow, and the PR body supplies an exact-head terminal trace showing the disabled-server warning disappears while enabled=true still produces it.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production owner is invoked from the Doctor configuration flow, and the PR body supplies an exact-head terminal trace showing the disabled-server warning disappears while enabled=true still produces it.
Evidence reviewed 5 items Introduced repair: The PR changes Doctor's MCP-server collector to exclude only object-shaped entries explicitly marked enabled: false, before warning generation consumes the list.
Production caller and failure boundary: Doctor imports this collector, passes its candidate configuration, and emits its returned warning text; before this PR, the current-main collector included disabled records.
Runtime and config contract: The MCP config type defines enabled: false as retaining a saved definition while excluding it from runtime/probe sessions; standard and Codex MCP projections also filter those entries.
Findings None None.
Security None None.

How this fits together

Doctor reads MCP configuration and sandbox tool policies to warn when active MCP tools would be hidden. Runtime MCP projections separately exclude disabled server definitions, so Doctor should use the same active-server meaning.

flowchart LR
  A[OpenClaw configuration] --> B[Doctor command]
  B --> C[Active MCP server collection]
  C --> D[Sandbox allowlist check]
  D --> E[Operator warning]
  A --> F[Runtime MCP projection]
  F --> G[Active MCP tools]
Loading

Before merge

  • Complete next step (P2) - The linked open PR already owns the narrow repair; it needs ordinary exact-head maintainer review rather than a replacement fix job.
Agent review details

Security

None.

PR surface

Source 0, Tests +20. Total +20 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 20 0 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 21 1 +20

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-1 (net 0); tests +20/-0 The repair changes one existing decision without production growth and adds focused regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #131103
Summary: This PR directly addresses the linked canonical report's disabled-server false positive.

Members:

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

Technical review

Best possible solution:

Merge this focused Doctor-side alignment so disabled MCP definitions no longer produce sandbox advice for tools that runtime will not expose.

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

Yes. Current-main source includes explicitly disabled records in the Doctor warning list, and the supplied exact-head CLI trace exercises disabled and enabled controls through the production command.

Is this the best way to solve the issue?

Yes. Filtering at Doctor's active-server collection matches the documented enabled contract and runtime projections; sharing their larger specialized resolvers would couple an operator diagnostic to unrelated runtime policy behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This corrects a deterministic but limited-scope Doctor false positive that can mislead sandbox configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owner is invoked from the Doctor configuration flow, and the PR body supplies an exact-head terminal trace showing the disabled-server warning disappears while enabled=true still produces it.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is invoked from the Doctor configuration flow, and the PR body supplies an exact-head terminal trace showing the disabled-server warning disappears while enabled=true still produces it.

Evidence

What I checked:

Likely related people:

  • steipete: Git blame attributes the current-main Doctor collector and the matching runtime collector to the commit that introduced both surfaces. (role: current diagnostic-surface introducer; confidence: high; commits: 5b605da38946; files: src/commands/doctor/shared/plugin-tool-allowlist-warnings.ts, src/agents/tool-policy-declared-context.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-28T01:04:48.844Z sha ee6b744 :: needs maintainer review before merge. :: none

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Patrick-Erichsen Patrick-Erichsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at exact head ee6b744190938f917f0f249749d6414928938d0c: the net-neutral Doctor collector fix aligns warnings with the runtime enabled: false contract; exact-head CI and the 28-test focused regression are green, fresh ClawSweeper has no findings, and independent verification found zero open threads or relevant main drift.

@Patrick-Erichsen
Patrick-Erichsen merged commit 4fd9392 into openclaw:main Aug 28, 2026
266 checks passed
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw doctor sandbox MCP allowlist warning counts enabled: false servers, diverging from the runtime resolver

2 participants