Repository navigation
refactor(config): migrate MCP transport aliases before runtime - #162256
Conversation
|
🦞👀 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: blocked before merge. Reviewed October 1, 2026, 1:02 AM ET / 05:02 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch moves MCP transport alias conversion into Doctor and bundle loading, converts canonical transport into CLI output format later, and removes an unshipped SDK helper. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain The refactor remains useful, but the earlier P1 compatibility finding is unresolved: valid type-only MCP configurations can reach runtime without migration and select the wrong transport. Priority: P2 Review scores
Verification
How this fits togetherMCP configuration connects OpenClaw agents to external tools. Operator settings and plugin bundles feed shared configuration preparation, which supplies embedded execution, CLI backends, and Agents API sessions. flowchart TD
A[Operator configuration] --> C[Config admission]
B[Plugin bundles] --> D[Bundle normalization]
E[Doctor repair] --> A
C --> F[Shared MCP configuration]
D --> F
F --> G[Embedded and Agents API execution]
F --> H[CLI format conversion]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -9, Tests +68, Docs +3. Total +62 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Complete canonical MCP admission through the existing migration owner before removing runtime compatibility, preserving transport precedence and backed-up operator settings. Do we have a high-confidence way to reproduce the issue? Yes, from source: admit a valid URL server with type http and no transport, then pass it through shared MCP configuration into embedded execution or Agents API. The branch selects SSE or omits the server; no target code was executed during this read-only review. Is this the best way to solve the issue? No, the cutover is incomplete: Doctor and bundle normalization are appropriate owners, but ordinary configuration admission must prepare canonical input before compatibility readers are removed. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0783e3f28d4e. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
19ad936 to
9509431
Compare
Integrate the exact main base already exercised by CI run 36818914037. The merged tree matches its tested source before lowering the two stale budgets by one, following the upstream removal in #162256.
…law#162256) * refactor(config): normalize MCP transport aliases before runtime * refactor(sdk): remove unshipped MCP transport re-export * test(doctor): extract MCP migration coverage * test(doctor): include shared MCP migration fixture
Main migrates MCP transport aliases before runtime (#162256) and retired the SDK re-export of the alias resolver, so the native app catalog reads the canonical server.transport field the same way the agentsapi plugin does.
…161747) * feat: use MCP plugin apps across conversations and workspace files Extend the opt-in MCP Apps host with discovery and entrypoints, settings, rich forms, scoped file editing, multimodal context, deep links, and native Codex session preparation. Preserve existing requester, approval, runtime, and file authority owners. Co-authored-by: steipete <[email protected]> * fix: keep app context compact and review large tool payloads Reuse the canonical bounded plugin approval preview without rejecting otherwise valid large App arguments. Keep the same one-shot approval and live-authority gates. Bound context-strip icons and scrolling so attachments leave the composer usable. Co-authored-by: steipete <[email protected]> * fix: reveal pending input above fullscreen MCP apps Keep App fullscreen rendering in the existing browser top layer and return to inline for same-conversation questions or approvals without replacing the iframe. Consolidate host-context, resource, and input notifications under the existing bridge lifetime. Co-authored-by: steipete <[email protected]> * test: preserve full attempt inputs in native assignment fixtures Co-authored-by: steipete <[email protected]> * fix: release session access when MCP app launch preparation fails Preserve the upstream optional ifMatch contract and document unconditional-save semantics explicitly. Co-authored-by: steipete <[email protected]> * fix(ui): defer question controls and preserve canonical keyboard values Co-authored-by: steipete <[email protected]> * fix(mcp): preserve app authority through startup and user turns Co-authored-by: steipete <[email protected]> * fix(codex): share native app startup across concurrent discoveries Co-authored-by: steipete <[email protected]> * docs(mcp): explain native app prompting and request limits Co-authored-by: steipete <[email protected]> * feat: use MCP plugin apps across conversations and workspace files Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: f2f8d735-c1ac-4a0d-84f3-1576113c1baf * fix(mcp): keep form contracts and test helpers with their owners Co-authored-by: steipete <[email protected]> * feat: use MCP plugin apps across conversations and workspace files Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 2513c3ef-4af8-4722-b802-ffa426df486a * fix(codex): revalidate MCP App authority before native retries Co-authored-by: steipete <[email protected]> * test(ui): provide chat identity fixture context dependencies Co-authored-by: steipete <[email protected]> * feat: use MCP plugin apps across conversations and workspace files Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 85c132dc-d926-46ca-b57e-2d9e01f15487 * fix: integrate MCP app owners with current main * fix(gateway): accept option labels from installed clients for rich forms * chore(format): anchor the native apps formatter ignore * perf(ui): load the MCP app link parser on demand Keep startup click interception parser-free and capture the normalized href before lazy navigation. Preserve ordinary, modified and download links; drop malformed plugin links and cancel pending navigation on disposal. Router/parser proof: 17 tests passed in 4.50s wall. Startup gzip: 374086 -> 373613 B; 159 B still above the unchanged 373454 B limit. * perf(ui): register MCP app English with lazy consumers Move the MCP App catalog out of startup English and register it synchronously at every consumer. Keep the shared namespace anchor and host catalog composition so all text and source order remain byte-identical. i18n verification passes without baseline changes. Startup gzip: 373613 -> 373103 B, 351 B below the unchanged 373454 B limit. * fix(ui): intercept only well-formed MCP app links Require the plugin/app/tool shape before cancelling browser navigation so ordinary ChatGPT plugin pages keep their default behavior. Preserve lazy strict parsing and accepted native and web app links. * fix(gateway): watch MCP app files directly so loaded macOS hosts still notify Watch the bound file to avoid FSEvents directory event drops under load. Re-arm on atomic replacement, retry ENOENT once on the next immediate turn, and retain subscription authority and cleanup. Cover replacement followed by a plain write through the registered resource routes. * fix(gateway): use the errno guard when rearming MCP app watches Use the shared filesystem error guard instead of an unchecked type assertion. Keep the single immediate ENOENT retry and all subscription behavior unchanged. * fix(codex): read the canonical MCP transport field Main migrates MCP transport aliases before runtime (#162256) and retired the SDK re-export of the alias resolver, so the native app catalog reads the canonical server.transport field the same way the agentsapi plugin does. * fix(gateway): keep MCP app file subscriptions alive across rename gaps Keep resource subscriptions alive while editors move the old file aside before installing its replacement. Poll missing paths at 250 ms, return to the inode watcher when the file reappears, and release polling on subscription close. Recheck after polling registration to cover replacement before its first stat; share the rearm guard so late callbacks cannot leak watchers. * test(codex): type the rooted thread policy support from attempt fixtures The rooted policy support that main added types its lifecycle input from the raw thread signature, while this branch's binding fixtures carry full attempt params. Derive it from the shared attempt-thread fixture type, as the sibling policy-refresh support already does. * test(ui): exercise the MCP app link probe through the click boundary The eager link probe was exported only for its unit test, which the production dead-export scan rejects. Keep it module-private and assert the same accepted and rejected links through real click interception. * style(lint): clear MCP app lint errors CI run 36988865432 jobs check-lint-core-1 and check-lint-core-2 rejected shadowed stat callback variables, a returning Promise executor, and reassigned projection parameters. Rename the inner variables and use local projection bindings and an executor block without changing behavior. * test(agents): align bundle MCP fixture ownership CI run 36988865432 job checks-node-changed-compact-large-14 failed seven merge cases because the fixture omitted the loader-required pluginIdsByServer map. Type the fixture against the producer contract and verify ownership survives only for unshadowed enabled bundle servers, preserving the migrated transport behavior. * fix(auto-reply): register turns before MCP context leasing CI run 36988865432 job checks-node-changed-compact-large-33-2 exposed an asynchronous MCP lease before synchronous run registration. Prepare App context after ownership registration and image admission, revalidate requester authority around the lease, and retain commit and rollback settlement with the execution outcome owner. * test(gateway): admit MCP shutdown requests through current policy CI run 36988865432 job checks-node-changed-compact-large-9 timed out because the fixture ignored an admission rejection before its upstream call. Publish matching Gateway and runtime config, create the session through its RPC owner, and observe early request settlement while preserving all shutdown ordering and cleanup assertions. * refactor(apple): drop the label-only question toggle Periphery flagged toggleOption(questionID:label:) as dead: production selects by canonical value since the rich-form change, and only tests still called the label overload. Tests now toggle by value; the ambiguous-label case becomes an unknown-value no-op. --------- Co-authored-by: steipete <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…penclaw#161747) * feat: use MCP plugin apps across conversations and workspace files Extend the opt-in MCP Apps host with discovery and entrypoints, settings, rich forms, scoped file editing, multimodal context, deep links, and native Codex session preparation. Preserve existing requester, approval, runtime, and file authority owners. Co-authored-by: steipete <[email protected]> * fix: keep app context compact and review large tool payloads Reuse the canonical bounded plugin approval preview without rejecting otherwise valid large App arguments. Keep the same one-shot approval and live-authority gates. Bound context-strip icons and scrolling so attachments leave the composer usable. Co-authored-by: steipete <[email protected]> * fix: reveal pending input above fullscreen MCP apps Keep App fullscreen rendering in the existing browser top layer and return to inline for same-conversation questions or approvals without replacing the iframe. Consolidate host-context, resource, and input notifications under the existing bridge lifetime. Co-authored-by: steipete <[email protected]> * test: preserve full attempt inputs in native assignment fixtures Co-authored-by: steipete <[email protected]> * fix: release session access when MCP app launch preparation fails Preserve the upstream optional ifMatch contract and document unconditional-save semantics explicitly. Co-authored-by: steipete <[email protected]> * fix(ui): defer question controls and preserve canonical keyboard values Co-authored-by: steipete <[email protected]> * fix(mcp): preserve app authority through startup and user turns Co-authored-by: steipete <[email protected]> * fix(codex): share native app startup across concurrent discoveries Co-authored-by: steipete <[email protected]> * docs(mcp): explain native app prompting and request limits Co-authored-by: steipete <[email protected]> * feat: use MCP plugin apps across conversations and workspace files Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: f2f8d735-c1ac-4a0d-84f3-1576113c1baf * fix(mcp): keep form contracts and test helpers with their owners Co-authored-by: steipete <[email protected]> * feat: use MCP plugin apps across conversations and workspace files Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 2513c3ef-4af8-4722-b802-ffa426df486a * fix(codex): revalidate MCP App authority before native retries Co-authored-by: steipete <[email protected]> * test(ui): provide chat identity fixture context dependencies Co-authored-by: steipete <[email protected]> * feat: use MCP plugin apps across conversations and workspace files Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 85c132dc-d926-46ca-b57e-2d9e01f15487 * fix: integrate MCP app owners with current main * fix(gateway): accept option labels from installed clients for rich forms * chore(format): anchor the native apps formatter ignore * perf(ui): load the MCP app link parser on demand Keep startup click interception parser-free and capture the normalized href before lazy navigation. Preserve ordinary, modified and download links; drop malformed plugin links and cancel pending navigation on disposal. Router/parser proof: 17 tests passed in 4.50s wall. Startup gzip: 374086 -> 373613 B; 159 B still above the unchanged 373454 B limit. * perf(ui): register MCP app English with lazy consumers Move the MCP App catalog out of startup English and register it synchronously at every consumer. Keep the shared namespace anchor and host catalog composition so all text and source order remain byte-identical. i18n verification passes without baseline changes. Startup gzip: 373613 -> 373103 B, 351 B below the unchanged 373454 B limit. * fix(ui): intercept only well-formed MCP app links Require the plugin/app/tool shape before cancelling browser navigation so ordinary ChatGPT plugin pages keep their default behavior. Preserve lazy strict parsing and accepted native and web app links. * fix(gateway): watch MCP app files directly so loaded macOS hosts still notify Watch the bound file to avoid FSEvents directory event drops under load. Re-arm on atomic replacement, retry ENOENT once on the next immediate turn, and retain subscription authority and cleanup. Cover replacement followed by a plain write through the registered resource routes. * fix(gateway): use the errno guard when rearming MCP app watches Use the shared filesystem error guard instead of an unchecked type assertion. Keep the single immediate ENOENT retry and all subscription behavior unchanged. * fix(codex): read the canonical MCP transport field Main migrates MCP transport aliases before runtime (openclaw#162256) and retired the SDK re-export of the alias resolver, so the native app catalog reads the canonical server.transport field the same way the agentsapi plugin does. * fix(gateway): keep MCP app file subscriptions alive across rename gaps Keep resource subscriptions alive while editors move the old file aside before installing its replacement. Poll missing paths at 250 ms, return to the inode watcher when the file reappears, and release polling on subscription close. Recheck after polling registration to cover replacement before its first stat; share the rearm guard so late callbacks cannot leak watchers. * test(codex): type the rooted thread policy support from attempt fixtures The rooted policy support that main added types its lifecycle input from the raw thread signature, while this branch's binding fixtures carry full attempt params. Derive it from the shared attempt-thread fixture type, as the sibling policy-refresh support already does. * test(ui): exercise the MCP app link probe through the click boundary The eager link probe was exported only for its unit test, which the production dead-export scan rejects. Keep it module-private and assert the same accepted and rejected links through real click interception. * style(lint): clear MCP app lint errors CI run 36988865432 jobs check-lint-core-1 and check-lint-core-2 rejected shadowed stat callback variables, a returning Promise executor, and reassigned projection parameters. Rename the inner variables and use local projection bindings and an executor block without changing behavior. * test(agents): align bundle MCP fixture ownership CI run 36988865432 job checks-node-changed-compact-large-14 failed seven merge cases because the fixture omitted the loader-required pluginIdsByServer map. Type the fixture against the producer contract and verify ownership survives only for unshadowed enabled bundle servers, preserving the migrated transport behavior. * fix(auto-reply): register turns before MCP context leasing CI run 36988865432 job checks-node-changed-compact-large-33-2 exposed an asynchronous MCP lease before synchronous run registration. Prepare App context after ownership registration and image admission, revalidate requester authority around the lease, and retain commit and rollback settlement with the execution outcome owner. * test(gateway): admit MCP shutdown requests through current policy CI run 36988865432 job checks-node-changed-compact-large-9 timed out because the fixture ignored an admission rejection before its upstream call. Publish matching Gateway and runtime config, create the session through its RPC owner, and observe early request settlement while preserving all shutdown ordering and cleanup assertions. * refactor(apple): drop the label-only question toggle Periphery flagged toggleOption(questionID:label:) as dead: production selects by canonical value since the rich-form change, and only tests still called the label overload. Tests now toggle by value; the ambiguous-label case becomes an unknown-value no-op. --------- Co-authored-by: steipete <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
MCP transport selection differed between embedded and CLI execution when canonical
transportcoexisted with a staletype. Node-host server aliases also lacked the matching Doctor migration.User Impact
Doctor migrates supported aliases in both
mcp.serversandnodeHost.mcp.servers, preserving explicit canonical transport and the original config backup. Runtime reads canonical transport. External bundle ingestion still accepts its native format, and CLI serialization supplies the backend's requiredtypefield after connection and OAuth preparation.Unknown imported HTTP types are rejected by native execution, including after requester overrides. Without an overriding canonical transport, their original type remains available for downstream CLI validation. Supported stdio-to-HTTP overrides remain intact.
Why This Change Was Made
Doctor owns persisted-key normalization; bundle ingestion and CLI output own their external formats. This removes the competing runtime interpretation and the unused merge callback. Doctor-lane dependency: retain the root and node-host transform in the shared early runner.
The SDK transport convenience export and loader parameter exposure were introduced by #160931 (
b4ae783fbfd) and are absent from the latest stablev2026.9.7, reverified during landing preparation. AgentsAPI now uses the existing public string normalizer. One unshipped export is removed; the API diff also reports the reachable mapper-parameter removal. No published SDK export or budget is removed or raised.Production (
src/**andextensions/**, excluding tests/support/fixtures): +66/-75/net -9.Evidence
pnpm test … --maxWorkers=1; core types pass in 44.94s; assertion guard passes in 24.03s; native SDK API diff passes in 134.81s; SDK export and surface checks pass (4,587 public exports).22ddcc01dc7passed build/tarball validation in 504.42s. Published 2026.9.7 droveopenclaw update --yes --no-restart --tag=<candidate.tgz> --jsonin 136.35s (complete cell 146.87s). Installed build identity, canonical config, precedence, URLs/headers/commands, and exact original backup bytes were verified. This uses isolated state and makes no service-restart claim.codex-rs/config/src/mcp_types.rsat8f38d5a877da8c5c2c0b5158e72bb5f2290a3157.Testbox leases:
tbx_01m3t5yxwr3shfwhv1tdgf2pdj(package/update);tbx_01m3temnsn388czbr1cev9ywsv(test extraction);tbx_01m3tp9xknr7r3s85qy06tyqky(final checks).Significant overlaps: main's #162070 typing cleanup is retained; #154043 adds separate exports in the same SDK barrel and does not rewrite these hunks.
The exact public surface budget is now reconciled on main by
63df802414bca131ce64f2790d580c14777d69ff: 4587 exports / 2693 callable exports. Independent canonical-counter proof reproduced the stale-budget assertion (9.35s), generated the same two shrink-only values, and passed the full original surface-report test file (15.05s) plus the surface guard. Complete cell: 38.35s on Testboxtbx_01m3v582erc4b8yp848hy2q1cg, run. No duplicate budget change or increase was applied.