fix(pi): rebuild the MCP wiring on createMcpAdapter (adapter ~2.15) - #981
Merged
Conversation
2.12.x added an exports map that breaks the wizard's jiti .ts subpath imports (index/server-manager/metadata-cache) — fresh prod installs resolved ^2.9.0 to 2.12.1, the posthog MCP never attached to pi tasks, and every 2.51.0 orchestrator run failed its dashboard step and aborted. Pin the version the lockfile and CI actually test. Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
gewenyu99
marked this pull request as ready for review
July 25, 2026 01:19
rafaeelaudibert
approved these changes
Jul 25, 2026
Try the .ts subpath (adapter ≤2.10, no exports map), fall back to resolving the package root and importing the file by absolute path, which exports maps cannot gate — so ≥2.12 packaging loads too. Proven against both versions from the packed tarball. Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
Fresh user installs resolve package.json ranges, not our lockfile — the pi-mcp-adapter 2.12 breakage shipped through exactly that gap. Pin every dep to the lockfile's resolved version; lockfile specifiers rewritten in place so resolutions are unchanged (verified by frozen install, trust policy untouched). Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
Blanket exact pins were overkill — revert to main's ranges everywhere except the jiti-live-loaded pi family (pi-mcp-adapter, pi-ai, pi-coding-agent), which gets tilde: patch drift allowed, the minor bumps that break packaging blocked. Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
… absolutely Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
…or the unexported warm internals Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
…~2.15 The file-config dance (write mcp.json, restore on cleanup) and the pre-warm reach into unexported internals existed because the adapter had no embedding API at 2.10. It does now: createMcpAdapter takes an isolated in-memory config, and lifecycle "eager" connects at extension load so direct tools register without a session_start. Instructions come from one standard-SDK handshake instead of the adapter's private client. Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
…l client version, diff noise out Generated-By: PostHog Code Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes 2.51.0 prod orchestrator runs losing the PostHog MCP (adapter 2.12's exports map broke our .ts subpath imports, every dashboard task failed): the extension is now built with createMcpAdapter — the adapter's supported embedding API — with an isolated in-memory config and eager lifecycle, deleting the mcp.json write/restore dance and the reach into unexported internals; server instructions come from one standard-SDK handshake, and the jiti-loaded pi family is tilde-pinned.