Skip to content

refactor(agents): separate MCP catalog metadata contracts - #192302

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/mcp-catalog-metadata-contracts
Nov 3, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/mcp-catalog-metadata-contracts

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

MCP catalog metadata is consumed by discovery, materialization and public catalog projections, but its declarations currently live alongside session execution and lifecycle contracts.

Move the four complete catalog data declarations into one private catalog type owner and migrate their internal consumers together. Route the existing public McpToolCatalog TYPE export directly to that owner. Preserve runtime bodies, value imports, catalog shapes and session callbacks, leases, authority and cleanup behavior. No new public names or performance claim.

Validation on the integrated candidate:

  • 17 named suites / 291 tests passed, including all 11 touched behavioral suites and the agent-tools prefix-stability control. Current senderless-catalog and App preparation/lifetime/cleanup cases remain covered.
  • Production and owning test types, scoped lint/format, applicable line/mock/test ratchets and active plugin-boundary checks passed. Test/support lines decrease by six; no allocation or baseline changes.
  • Normal full build and an emitted public catalog consumer passed. The build reported four UI asset-budget warnings.
  • One canonical SDK/API comparison completed. It reports 167 reachable declaration changes with unchanged direct public declarations and no entrypoint additions or removals; catalog-origin moves, export grouping and inferred-type ordering differences were classified.
  • Fresh integrated review completed with zero findings across three assessments. Reviews analyze source text and do not independently attest execution of the native checks.

Exact-head hosted CI and applicable security gates completed successfully. Merged as f32ee258e30983f699abbe4fd3c4d3ad0114f563. No live or paid provider workload ran.

Post-merge follow-up: a metadata helper that landed after the source pin retained the retired type import. The one-line correction routes it to the canonical catalog owner without changing helper bodies or runtime contracts. The same production typecheck failed before and passed after; both owning test-type projects and four suites / 65 tests passed, along with scoped lint/format and fresh review. The follow-up used the scoped red-main direct-push route; its CI was not complete at publication.

@vincentkoc vincentkoc self-assigned this Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M labels Nov 3, 2026
Baseline-Refresh: a77b479583876129b81e36639a69d1e286597cbf
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR moves four MCP catalog type declarations into a dedicated internal module and updates consumers while preserving public SDK exports.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The inspected source change is coherent and preserves contracts, but completed type, emitted SDK, build, and behavioral qualification is not yet available.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, type-only refactor changes no runtime behavior; source hooks and reviews are reported, while build, type, SDK compatibility, and behavioral qualification remain explicitly pending.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction separates metadata contracts from execution contracts without changing behavior, defaults, configuration, or public API names.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: the focused type extraction preserves existing contracts, and no actionable defect was found; the draft still has reported merge conflicts and pending qualification.

Priority: P3
Reviewed head: ab2bc50554af387d41a3ca54d9095fc47e7ac183

Before merge

  • Complete next step - The author should resolve GitHub’s reported merge conflicts while preserving current main’s MCP behavior.

Findings

None.

Agent review details

How this fits together

MCP servers supply catalog metadata that the agent runtime projects into tool inventories, native tool policy, and Gateway MCP Apps; the public harness SDK exposes the same catalog contract.

flowchart LR
  A[MCP servers] --> B[Catalog projection]
  C[Catalog type contracts] -.-> B
  B --> D[Session runtime]
  B --> E[Tool inventories and policy]
  D --> F[Gateway MCP Apps]
  C -.-> G[Public harness SDK]
Loading

Technical review

Best possible solution:

Retain the dedicated catalog type owner, direct consumer imports, and unchanged public SDK names, then complete the draft’s integration and qualification.

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

No runtime bug is claimed; source inspection confirms catalog-only consumers currently share a type module with session execution and lifecycle contracts.

Is this the best way to solve the issue?

The extraction is a small, coherent solution: it preserves all four declarations, migrates internal consumers, retains public exports, and adds no competing runtime path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e1a9f2c7a4fa.

Provenance checked

  • Catalog contracts and execution contracts keeps the original intent (7043705: The earlier runtime and transport seam refactor supplied the catalog declarations in pi-bundle-mcp-types.ts; later catalog policy and MCP Apps additions remain intact.)
  • Catalog diagnostics keeps the original intent (c037ab5: Doctor needed to report failed MCP tool schema loading; the diagnostic fields and their consumers are preserved.)
  • Metadata ownership and SDK exports keeps the original intent (refactor(plugins): decouple tool metadata from runtime loading #132932: Keep metadata dependency-light while preserving runtime policy ownership and the shipped harness SDK surface.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Pinned introduced diff: The four declarations move unchanged; remaining production edits retarget type-only imports and exports, without changing execution or authorization logic. (src/agents/agent-bundle-mcp-catalog.types.ts:10, ab2bc50554af)
  • Public contract retained: The existing McpToolCatalog and SessionMcpRuntime public type names remain exported from agent-harness-runtime; only the internal source of McpToolCatalog changes. (src/plugin-sdk/agent-harness-runtime.ts:550, ab2bc50554af)
  • Current main context: Fetched main still contains the combined catalog and execution type owner; comparison with the merge base shows no changes to the inspected types, runtime, or materializer paths. (src/agents/agent-bundle-mcp-types.ts:36, e1a9f2c7a4fa)
  • Draft and qualification state: REST confirms MEMBER authorship, the reviewed head, draft status, and mergeable=false with dirty state; the full body explicitly leaves behavioral, type, build, SDK compatibility, and CI qualification pending. (ab2bc50554af)
  • Checks do not establish qualification: The reported checks contain successful routing and labeling jobs and skipped jobs, rather than completed behavioral, type, build, or SDK compatibility validation. (ab2bc50554af)
  • Earlier metadata ownership decision: refactor(plugins): decouple tool metadata from runtime loading #132932 established dependency-light metadata ownership while retaining execution policy owners and shipped SDK exports; this extraction follows that direction without claiming a runtime speed improvement. (87b71210c8d1)

PR surface

Source -3, Tests -6. Total -9 across 34 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 20 113 116 -3
Tests 14 23 29 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 34 136 145 -9

Labels

Label changes:

  • add P3: This is an internal type ownership cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal type ownership cleanup with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the declared type, SDK compatibility, build, and affected-consumer qualification on the integrated candidate.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 3, 2026, 5:12 PM ET / 22:12 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 3, 2026 23:05
@vincentkoc
vincentkoc enabled auto-merge (squash) November 3, 2026 23:12
@vincentkoc
vincentkoc merged commit f32ee25 into main Nov 3, 2026
204 checks passed
@vincentkoc
vincentkoc deleted the refactor/mcp-catalog-metadata-contracts branch November 3, 2026 23:17
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant