Skip to content

fix: restore lint checks for MCP catalog snapshots - #199939

Closed
steipete wants to merge 2 commits into
mainfrom
steipete/fix-mcp-catalog-metadata-20261116
Closed

steipete wants to merge 2 commits into
mainfrom
steipete/fix-mcp-catalog-metadata-20261116

Conversation

@steipete

@steipete steipete commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Superseded by the merged repairs in #199909 and #199944. This PR will not be merged.

User Impact

Main already contains both the MCP metadata runtime repair and its lint follow-up. No additional change or migration is needed from this PR.

Why This Change Was Made

#199909 (f4d2e45592438dbaae12975e1c4223a991285b7a) fixed the MCP default-approval metadata failure introduced by #199804. #199944 (54070dcab8c21f2b24cf0bf4e9c9439ff44cb753) subsequently fixed the lint failure with an explicit suppression and its inventory entry. This alternative detached-snapshot implementation has no remaining concrete defect to repair on main, so it is retired rather than integrated again.

Evidence

On exact current main 3a3eed8695e68e182c4851285a3de90ca2cba0ff, the canonical focused lint command passes for src/agents/tool-search-prepared-catalog.ts, and all 14 tests in test/scripts/lint-suppressions.test.ts pass. Both peer merges are ancestors of that revision. The semantically unchanged peer JSON snapshot already passed independent qualification of the three original Cron MCP cases and the real nested-metadata reuse regression under Node and Bun.

The unmerged alternative at d756be168fbd4ed8b56d68042b67794a7ec810da also passed 32 focused cases and independent Codex review. Its required changed check retained an unrelated export-analyzer failure, subsequently repaired by #199948 (2ad689abdb6db8218ccf28dfcbc0dee4bee6a9b8), also present on the qualified current main. Measurements of this unmerged alternative are not evidence of a shipped main improvement. No final-head CI or merge is claimed for this PR.

@clawsweeper

clawsweeper Bot commented Nov 16, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T05:02:40.721453Z d756be1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Nov 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR clones MCP metadata before freezing it so optional undefined fields cannot crash tool-catalog preparation.

Example: An MCP tool has codexApproval: { mode: undefined }.

  • Before: Catalog preparation parses a fingerprint containing undefined and throws a SyntaxError before the tool runs.
  • After: Catalog preparation clones and freezes the metadata, allowing the current run's tool to execute.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is minimal and its regression exercises real catalog composition, but supplied validation remains test-only and the central repair is already on main.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: No · Fix scope: Complete
User problem: MCP tool preparation fails before execution when default approval metadata contains an undefined mode.
Reason: The original bug merits repair and the maintainer has chosen that direction, but main already contains the repair; replacing it has no demonstrated additional user benefit.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open for maintainer disposition: current main already fixes the same failure through #199909, while this maintainer-authored PR offers an alternative snapshot method and broader regression coverage; no introduced correctness defect was found.

Priority: P3
Reviewed head: 1f1e89fec4f7e236d7ff78d87064c091e92163f2
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should this PR be retired in favor of the merged repair, or retained for its cross-session regression and alternative snapshot implementation?
  • Recommendation: Retire the redundant runtime repair: Keep the merged implementation and consider carrying over only the distinct cross-session regression.
  • Why: The central runtime failure is already repaired, and the maintainer-authored keep-open guard requires explicit maintainer disposition.

Before merge

  • Await maintainer action - Decide whether this maintainer-authored PR should continue or be retired in favor of the merged repair.
  • Product: not worth merging - The original bug merits repair and the maintainer has chosen that direction, but main already contains the repair; replacing it has no demonstrated additional user benefit.

Findings

None.

Tests

  • Missing end-to-end proof: If retained, show a successful MCP call or scheduled MCP script through the shipped Gateway with no explicit approval mode, using redacted terminal output or logs.
Agent review details

How this fits together

The agent tool-search catalog prepares reusable immutable descriptors from native, MCP, and client tools while retaining executable tools within each run.

flowchart TD
  A[MCP materializer] --> B[Tool metadata]
  B --> C[Catalog registration]
  C --> D[Prepared descriptor cache]
  D --> E[Code Mode catalog]
  E --> F[Current run executor]
Loading

Technical review

Best possible solution:

Retain main's working snapshot owner and let the maintainer decide whether this PR's cross-session regression warrants a focused follow-up.

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

The pinned base fails by construction: the real materializer emits an undefined approval mode, stableStringify preserves it, and catalog preparation feeds that non-JSON fingerprint to JSON.parse; current main removes this path.

Is this the best way to solve the issue?

Cloning at the existing snapshot boundary is a small, coherent repair that preserves cache identity and run-local executors, but current main already solves the reported failure with a JSON snapshot.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b95a1b9f4b06; fix evidence: commit f4d2e4559243, main fix timestamp 2026-11-16T03:05:15Z.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3d4bd2a adds src/agents/tool-search-prepared-catalog.ts:113 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d4bd2a708bc; files: src/agents/tool-search-prepared-catalog.ts)

PR surface

Source 0, Tests +1. Total +1 across 2 files. Added test files: 0.

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

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: duplicate
Canonical: #199909
Summary: Both repairs address JSON parsing of a stable MCP metadata fingerprint containing undefined.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: The central runtime failure is already fixed on main; the remaining question concerns follow-up implementation and regression coverage.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

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 15, 2026, 11:16 PM ET / November 16, 2026, 04:16 UTC.

@steipete steipete changed the title fix: restore MCP calls with default approval metadata fix: restore lint checks for MCP catalog snapshots Nov 16, 2026
Baseline-Refresh: 9b4659cf34f0ca5a2cd87c9e11d3659e8c55832e
@steipete

Copy link
Copy Markdown
Contributor Author

The maintainer disposition is to close this PR as superseded by #199909 and #199944. Addressing both open items from the review of 1f1e89fec4f7e236d7ff78d87064c091e92163f2:

  1. Await maintainer action: retire this alternative. fix(agents): snapshot shareable MCP catalog metadata as JSON #199909 owns the runtime repair; fix(ci): core lint fails on main after the MCP catalog JSON snapshot change #199944 owns the subsequent lint repair. Current main retains the peer JSON snapshot and explicit lint exception at tool-search-prepared-catalog.ts:116–121, with its required suppression inventory at line 310.
  2. Product: not worth merging: agreed now that both repairs have landed. On exact 3a3eed8695e68e182c4851285a3de90ca2cba0ff, node scripts/run-oxlint.mjs src/agents/tool-search-prepared-catalog.ts passes and node scripts/test-projects.mts test/scripts/lint-suppressions.test.ts passes all 14 tests. The unchanged peer runtime expression already passed the original Cron and nested-metadata reuse cases under Node and Bun. No remaining concrete bug justifies another conflict integration.

The body now records the superseded disposition and preserves both peers' credit. This closes the alternative without merging it; no fresh review or CI run is requested for the closed PR.

@steipete steipete closed this Nov 16, 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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant