Repository navigation
fix: restore MCP discovery after provider normalization - #149662
Conversation
Own the normalized assembly array before copying tool metadata so plugin collection views cannot rewrap later host wrappers. Preserve plugin-owned element execution fences and cover both normalization routes through MCP catalog registration and disposal.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 12:01 AM ET / 04:01 UTC. ClawSweeper reviewWhat this changesCopies the normalized tool array so later wrappers preserve MCP discovery metadata while retaining plugin execution guards, with regression coverage for both normalization routes. Merge readiness✅ Ready for maintainer review Keep open: this is a focused, useful repair that fetched main still needs. No actionable correctness or security defect was found, and the related routing PR explicitly delegates the runtime repair here. Priority: P2 Review scores
Verification
How this fits togetherAgent tool assembly combines configured tools with provider-specific schema normalization before publishing the searchable API catalog. MCP ownership metadata lets that catalog expose the correct server namespaces and dispatch calls through guarded tool objects. flowchart LR
A[Configured tools] --> B[Tool policy filtering]
B --> C[Provider normalization]
C --> D[Host-owned array]
D --> E[Metadata-preserving wrappers]
E --> F[MCP API catalog]
F --> G[Guarded tool execution]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +71. Total +73 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep collection ownership in the normalization owner while preserving tool metadata and the existing plugin execution fences. Do we have a high-confidence way to reproduce the issue? Yes, from source: provider collection mapping rewraps host wrappers and loses their identity-bound MCP metadata before catalog registration. The focused regression models that path; no local runtime reproduction was executed. Is this the best way to solve the issue? Yes. Copying the assembly array at the existing normalization boundary fixes both routes without changing shared collection semantics, plugin APIs, persisted settings, or execution admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9854595b8073. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Extend the canonical assembly-array fixture from #149662 with an admitted provider that returns cloned tools. Preserve its metadata, catalog, successful execution, abort-wrapper and post-disposal assertions. The production Array.from owner remains unchanged on main.
Record that the earlier MCP code-mode failures came from the product regression fixed by #149662. Keep Docker seed on the 16-class and align runner guidance with main's build-artifacts and runtime-topology settings.
Extend the canonical assembly-array fixture from #149662 with an admitted provider that returns cloned tools. Preserve its metadata, catalog, successful execution, abort-wrapper and post-disposal assertions. The production Array.from owner remains unchanged on main.
* fix: preserve Windows credential reads with fs-safe 0.12.0 * test: preserve compiled fs-safe configuration checks on Windows * test: drain workspace page routes before closing fixtures * ci: move heavy main checks to 16-vCPU runners * perf(cli): avoid eager protocol schemas in cron registration * test: align prerelease workflow expectation with main CI * test: resume pending MCP Code Mode fixture calls * test(agents): cover cloned admitted normalizers Extend the canonical assembly-array fixture from #149662 with an admitted provider that returns cloned tools. Preserve its metadata, catalog, successful execution, abort-wrapper and post-disposal assertions. The production Array.from owner remains unchanged on main. * ci: spread Control UI checks across twelve shards * docs(ci): align runner guidance with current placement * ci: route trusted hybrid preflight to Blacksmith * test: align hybrid preflight runner table * ci: retain real-Gateway failure diagnostics Keep captured browser JSON and screenshots in an attempt-specific artifact when the real-Gateway CI job fails. Reuse the ordinary Control UI upload policy with seven-day retention and ignore absent captures, while preserving test commands and sanitized proof uploads. Extend the existing workflow guard and document that diagnostic artifacts are not sanitized public proof. The new guard fails before the fix; all 18 focused alias, workflow, and command cases pass afterward. Workflow lint, selected changed-file checks, and independent review pass. * fix(ui): preserve agent panel intent while route data loads A reused Agents page retained its initialized flag after its route data became pending. Roster initialization could then navigate through the default Overview panel, replacing an intended Files route. Require current route data before navigation and panel work, and clear initialization when the pending update applies. Keep explicit Settings selection revisions authoritative when the loader completes. Four focused regression cases fail before the repair with the reproduced Overview URL; 136 adjacent cases, targeted lint, formatting and independent review pass afterward. * ci: publish allowlisted UI failure summaries Keep raw browser reports and screenshots out of automatic CI artifacts. Write an explicit public projection from the existing failure owner and select only its fixed filename in ordinary and real-Gateway jobs. Raw captures remain local, and fixed private filenames keep sensitive labels out of logged paths. Older frozen targets without the summary produce no matching artifact. Preserve original failures and manual sanitized proof capture. Sensitive-sentinel regressions cover nested state, route parameters, labels, errors, models and content, including evaluation, screenshot and storage failures. All 10 helper cases, six workflow/command cases, workflow validation, plain Node import and selected changed-file checks pass; independent review found no actionable issues. * fix: align FileTransfer with fs-safe 0.12.0 Upgrade the FileTransfer dependency introduced by #148881 to the same exact version used by core, OpenShell and 1Password. Regenerate the importer with pnpm 12.3.4 and retain all other lock entries. Strengthen the existing orphan-WAL collision regression with equal-length, different-content bytes so recovery exercises the shared hash path and preserves the existing quarantine. Frozen installation, the 16-case sidecar suite, 18 tool-policy cases and 23 UI/diagnostic cases pass on the integrated source; independent review found no actionable issues. * test(ui): retain safe Canvas failure diagnostics * test(gateway): model live child execution in stop proof * test(ui): inspect HTML sandbox after render readiness * test(cron): cover event schedules after API state updates * ci: count hosted rows after hybrid preflight routing
…claw#149662) Own the normalized assembly array before copying tool metadata so plugin collection views cannot rewrap later host wrappers. Preserve plugin-owned element execution fences and cover both normalization routes through MCP catalog registration and disposal.
…149124) * fix: preserve Windows credential reads with fs-safe 0.12.0 * test: preserve compiled fs-safe configuration checks on Windows * test: drain workspace page routes before closing fixtures * ci: move heavy main checks to 16-vCPU runners * perf(cli): avoid eager protocol schemas in cron registration * test: align prerelease workflow expectation with main CI * test: resume pending MCP Code Mode fixture calls * test(agents): cover cloned admitted normalizers Extend the canonical assembly-array fixture from openclaw#149662 with an admitted provider that returns cloned tools. Preserve its metadata, catalog, successful execution, abort-wrapper and post-disposal assertions. The production Array.from owner remains unchanged on main. * ci: spread Control UI checks across twelve shards * docs(ci): align runner guidance with current placement * ci: route trusted hybrid preflight to Blacksmith * test: align hybrid preflight runner table * ci: retain real-Gateway failure diagnostics Keep captured browser JSON and screenshots in an attempt-specific artifact when the real-Gateway CI job fails. Reuse the ordinary Control UI upload policy with seven-day retention and ignore absent captures, while preserving test commands and sanitized proof uploads. Extend the existing workflow guard and document that diagnostic artifacts are not sanitized public proof. The new guard fails before the fix; all 18 focused alias, workflow, and command cases pass afterward. Workflow lint, selected changed-file checks, and independent review pass. * fix(ui): preserve agent panel intent while route data loads A reused Agents page retained its initialized flag after its route data became pending. Roster initialization could then navigate through the default Overview panel, replacing an intended Files route. Require current route data before navigation and panel work, and clear initialization when the pending update applies. Keep explicit Settings selection revisions authoritative when the loader completes. Four focused regression cases fail before the repair with the reproduced Overview URL; 136 adjacent cases, targeted lint, formatting and independent review pass afterward. * ci: publish allowlisted UI failure summaries Keep raw browser reports and screenshots out of automatic CI artifacts. Write an explicit public projection from the existing failure owner and select only its fixed filename in ordinary and real-Gateway jobs. Raw captures remain local, and fixed private filenames keep sensitive labels out of logged paths. Older frozen targets without the summary produce no matching artifact. Preserve original failures and manual sanitized proof capture. Sensitive-sentinel regressions cover nested state, route parameters, labels, errors, models and content, including evaluation, screenshot and storage failures. All 10 helper cases, six workflow/command cases, workflow validation, plain Node import and selected changed-file checks pass; independent review found no actionable issues. * fix: align FileTransfer with fs-safe 0.12.0 Upgrade the FileTransfer dependency introduced by openclaw#148881 to the same exact version used by core, OpenShell and 1Password. Regenerate the importer with pnpm 12.3.4 and retain all other lock entries. Strengthen the existing orphan-WAL collision regression with equal-length, different-content bytes so recovery exercises the shared hash path and preserves the existing quarantine. Frozen installation, the 16-case sidecar suite, 18 tool-policy cases and 23 UI/diagnostic cases pass on the integrated source; independent review found no actionable issues. * test(ui): retain safe Canvas failure diagnostics * test(gateway): model live child execution in stop proof * test(ui): inspect HTML sandbox after render readiness * test(cron): cover event schedules after API state updates * ci: count hosted rows after hybrid preflight routing
Post-merge proof (2026-09-16 UTC): merged as
e83ea6e7f095b249ade7d0c9e87a04854e8db81d. Main CI 35055114649, attempt 1 passed on that exact commit at 04:35:32 UTC: all 76 jobs passed or were intentionally skipped, including successful build, Docker owner lanes, and the required aggregate gate.Related: #149522
What Problem This Solves
Fixes admitted MCP tools disappearing from the Code Mode API catalog after provider normalization, causing
Unknown API file: mcp/index.d.ts.User Impact
Agents can discover and call configured MCP tools after tool assembly. No configuration change or migration is required.
Why This Change Was Made
Provider hooks return plugin-owned collection views. Mapping host tool wrappers over that collection rewraps the wrappers and loses their identity-bound MCP metadata. The normalization owner now copies the assembly array before metadata transfer while retaining fenced tool elements. The regression covers both runtime-plan and provider normalization, final catalog attribution, execution, and denial after plugin disposal.
This isolates the two runtime files from the separate CI-routing proposal. Production grows by two lines; tests grow by 71 lines. Shared plugin collection semantics and execution fences remain intact.
Evidence
187145699a1b1a419621a35d5970635b2442e9c9: all five fixture MCP tools survived materialization and policy, then lost their metadata during tool assembly and were classified as core tools.55cde55c266ece3ad5e2fd6c47bf357ac62e4f8dwith runtime repaire9f50210f4590c9d0affd70b3dc15a0bb7c87af2, passed the packaged MCP discovery/execution scenario in 24 seconds. This is supporting proof, not qualification of this PR head. Its fixture-only TS2352 was corrected before this extraction.640981025463821eb9028da0fe3355c83b2734ddrepair exactly. The unfixed owner and relevant collection/wrapper/catalog dependencies remain unchanged on this PR's frozen main base3c5854d129c4dc1d57332a7d154ce7edc36d4098.git diff --checkand a read-only oxfmt 0.65 check passed; the pinned hosted formatting/type/lint gates also passed.036820b8ea2b7e2eca330971b073c805767d7846(attempt 1; tested merge7ba062221e273c41a310a155971fca9edb40d6a9). ClawSweeper review is clean for that head, with no remaining rank-up move.ef93dfcbb0daf5d5bda66b79b52f635bd4abee02: package integrity, npm 12 installation, and the singlemcp-code-mode-gatewayscenario. The scenario passed once in 48 seconds, with no retry or timeout. It uses a deterministic mock provider and an ephemeral Gateway.61486037f29ec389634eeb8fb828c16da31be43cf08b9d68229715d9c345ac80. The artifact-only image tuple is run35053493803/ attempt1/ artifact10429762702, image archive SHA-25611b71ebfe0de05ecacfa1fe6396931e4800cc3ac45204e6b7d1f2b2a51e728c3.10430805401(docker-e2e-mcp-code-mode-gateway), SHA-2564cacb69232cda00344f335da41a0f2182651927667d7968d84e275aa0d6ce2fe, records this fixture verdict (selected fields):{"ok":true,"finalText":"MCP_CODE_MODE_FILE_OK note=fixture-note-alpha unclear=none improvement=virtual-api-files-were-clear-and-needed-one-exec","plannedTools":["exec"],"sessionLogMentions":{"apiCall":0,"apiFileList":1,"apiFileRead":2,"mcpNamespace":1,"mcpTool":1,"toolSearchPollution":0}}No local install or local Vitest result is claimed. Remote source/package identity, normal CI, and the actual packaged MCP execution qualify this head.
CONTRIBUTING.mdreserves changelog generation for release tooling.