Skip to content

refactor(mcp): trim internal server exports - #108076

Merged
steipete merged 2 commits into
mainfrom
codex/burn-mcp-dead-exports
Jul 15, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/burn-mcp-dead-exports

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Shrinks the enforced unused-export ratchet for the MCP subsystem without hiding real dynamic contracts or preserving dead public facades.

Why This Change Was Made

Models src/mcp/openclaw-tools-serve.ts! as the stdio entry spawned by generated system-agent MCP configs, replacing its optional unused-file allowlist entry. This accounts for five live config exports: the surface env constant, tool-id type, approval resolver, surface resolver, and tool-selection resolver.

Removes the redundant channel bridge reexport, keeps the initial-connect retry predicate private, and replaces the dead public server factory with a production-owned createChannelMcpRuntime boundary shared by stdio serving and tests. The original dead export names disappear; no facade relocation.

User Impact

No user-visible or CLI behavior change. Internal MCP assembly keeps one canonical production path while the shrink-only baseline becomes eight entries smaller.

Evidence

  • Dead-export baseline: 276 -> 268, +0/-8; exact regeneration byte-stable and pnpm deadcode:exports green.
  • Focused MCP/config tests: 30 passed.
  • Scoped formatting and type-aware lint: green.
  • Core types and full test types: green.
  • Fresh whole-diff autoreview: clean, 0.97.
  • Non-test source/config excluding the baseline: +74/-76, net -2 LOC.
  • Blacksmith warmup was unavailable before proof (scheduler HTTP 429, then dispatch HTTP 500); the ready local dependency tree supplied the exact generator, lint, type, and focused-test proof.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jul 15, 2026
@steipete
steipete merged commit 92d06e5 into main Jul 15, 2026
122 of 129 checks passed
@steipete
steipete deleted the codex/burn-mcp-dead-exports branch July 15, 2026 06:47
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 16, 2026
* refactor(mcp): remove dead internal exports

* chore(deadcode): refresh export baseline
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* refactor(mcp): remove dead internal exports

* chore(deadcode): refresh export baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant