Skip to content

refactor(agents): deduplicate bundle MCP adapters - #113240

Merged
steipete merged 1 commit into
mainfrom
codex/z-runner-dedup-2
Jul 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/z-runner-dedup-2

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The CLI and embedded runner families had accumulated parallel bundle-MCP adapter mechanics. A partial shared extraction covered a few scalar fields, but provider adapters still independently applied fresh/resume arguments, materialized temporary JSON, rotated per-attempt capture headers, and normalized the same server fields.

Why This Change Was Made

This completes the extraction with a runner-neutral server projection and one CLI runtime mechanism for argument injection, temporary JSON lifecycle, and capture-header updates. Claude, Codex, and Gemini keep their provider-specific schemas and persistence semantics. The adjacent auth-planning and tool-call-normalization paths were audited but intentionally left separate because their retry, cooldown, transcript-repair, and event-parsing contracts are not identical.

AI-assisted implementation; maintainer-commissioned LOC-reduction batch codex-z13-runner2.

User Impact

No user-visible behavior changes. The same MCP server configuration, auth placeholder handling, capture tokens, CLI arguments, file lifecycle, and provider-specific projections now flow through fewer production paths.

Evidence

  • Production LOC: +158 / -177 across 8 files, net -19; test LOC: +0 / -0.
  • node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --timing-json -- env CI=1 OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 corepack pnpm test src/agents/cli-runner/bundle-mcp.test.ts src/agents/cli-runner/bundle-mcp.codex.test.ts src/agents/cli-runner/bundle-mcp.gemini.test.ts src/agents/codex-mcp-config.test.ts — 4 files / 23 tests passed on Testbox tbx_01ky9a967bk4kdbvaa0m22f49t (run).
  • node scripts/check-changed.mjs -- src/agents/bundle-mcp-adapter.ts src/agents/cli-runner/bundle-mcp-runtime.ts src/agents/cli-runner/bundle-mcp-claude.ts src/agents/cli-runner/bundle-mcp-codex.ts src/agents/cli-runner/bundle-mcp-gemini.ts src/agents/cli-runner/bundle-mcp.ts src/agents/codex-mcp-config.ts — core/core-test typecheck, lint, formatting, guards, and import-cycle checks passed on Testbox tbx_01ky99z7g25fnstgnve6bh99kk (run).
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output — clean; no accepted/actionable findings, overall correctness 0.94.
  • git diff --check — passed.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 24, 2026
@steipete
steipete marked this pull request as ready for review July 24, 2026 05:47
@steipete
steipete force-pushed the codex/z-runner-dedup-2 branch from 59ff437 to 62cc59e Compare July 24, 2026 05:56
@steipete

steipete commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready verification complete for head 6e33a85689302d12e420894244a989ae9717618b.

  • Patch identity matches pre-rebase green head 59ff4373bdd8573b2c970ad8fa00bc8ac9a48577 (git patch-id --stable: 7de0488780254ec7be6062e0f9c741fc07137ba1).
  • Focused Testbox proof: 4 files / 23 tests passed on tbx_01ky9a967bk4kdbvaa0m22f49t (Actions 30070115272).
  • Changed gate: core/core-test typecheck, lint, formatting, guards, and import cycles passed on tbx_01ky99z7g25fnstgnve6bh99kk (Actions 30069870961).
  • Hosted exact-head CI for the patch passed, including openclaw/ci-gate (Actions 30070384701).
  • Fresh autoreview: no accepted/actionable findings (correctness 0.94).
  • Repo-native review artifacts validate as READY FOR /prepare-pr, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 113240 passed with hosted exact-or-recent-parent reuse.
  • ClawSweeper's latest comment is a review-started placeholder for the pre-rebase SHA and contains no Rank-up moves: entries.

Known proof gaps: no live provider call was run because this is deterministic, behavior-neutral config/argument projection; the provider adapters, changed gates, import-cycle guard, and hosted CI cover the changed contract.

@steipete
steipete force-pushed the codex/z-runner-dedup-2 branch from 62cc59e to 6e33a85 Compare July 24, 2026 06:00
@steipete
steipete merged commit 18ef074 into main Jul 24, 2026
117 checks passed
@steipete
steipete deleted the codex/z-runner-dedup-2 branch July 24, 2026 06:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant