fix(mcp): register the marketplace before installing the Claude Code plugin - #1007
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(mcp): register the marketplace before installing the Claude Code plugin#1007posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
…plugin `claude plugin install posthog` only resolves against marketplaces the user already has registered. Claude Code registers the official Anthropic marketplace (which carries the posthog plugin) when it starts interactively — the wizard shells straight into the non-interactive `plugin` subcommand, so on a machine that never opened Claude Code the catalog isn't there and the install dies with `Plugin "posthog" not found in any configured marketplace`. Register the marketplace first (skipping the add when it's already listed), install the plugin qualified against it, refresh a stale catalog and retry once, and fall back to the bare plugin name as a last resort. Known local-environment failures — a CLI too old for `plugin`, unreadable settings/marketplace JSON, ENOBUFS, network/clone failures, permissions, managed-settings restrictions — now produce a short user-facing hint instead of an exception capture. Remaining failures report under a constant message with the stderr, stage and binary basename moved into properties and home directories normalised to `~`, so one root cause is one issue. The TUI now renders those hints on the MCP done screen rather than treating a failed plugin install as silent best-effort. Also fixes a stale-state bug in the same path: with exactly one detected client, the recommended flow read `installMode` before its setter had landed, so it took the 'custom' branch and skipped the plugin install entirely. Generated-By: PostHog Code Task-Id: 262e7a1b-5564-4d76-8a68-f5126e86c990
🧙 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. |
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.
Problem
ClaudeCodeMCPClient.installPluginshells straight intoclaude plugin install posthogwith no marketplace registration step. Claude Code only resolves a plugin name against marketplaces the user already has, and it registers the official Anthropic marketplace (which carries theposthogplugin) when it starts interactively — the wizard uses the non-interactivepluginsubcommand, so on a machine that never opened Claude Code the catalog isn't there and the install dies withPlugin "posthog" not found in any configured marketplace.Nothing surfaced this:
installPluginsonlydebug()s the failure and the TUI treats plugins as best-effort, so users quietly walked away without the plugin even though MCP registration and the main flow succeeded. The Codex client next door already does the marketplace step, so this was an asymmetry rather than a missing capability.Separately, the catch block stuffed raw stderr — including the resolved binary path and user home directories — into the exception message, splitting one root cause across several error-tracking issues and spawning fresh ones for unactionable local-environment failures.
Changes
plugin, unreadable settings/marketplace JSON,ENOBUFS, network/clone failures, permissions, and managed-settings restrictions now return a short hint instead of callingcaptureException.~.installPluginsreturns hints alongside installed names, and the MCP screen renders them instead of silently moving on.installModebefore its setter had landed, took thecustombranch, and skipped the plugin install entirely.Test plan
pnpm build && pnpm test && pnpm fix— 1634 tests pass.clients/__tests__/claude-code.test.ts: marketplace registered when absent / skipped when present, stale-catalog refresh + retry, bare-name fallback, each expected-failure class hinting without a capture, and the stable message + scrubbed properties for unexpected failures.McpScreenagainst ink's real renderer (it's stubbed in the vitest config, so this was a manual pass) to confirm the done screen shows⚠ Claude Code plugin not installedwith the hint on failure, and still shows✔ Plugin installed for:on success.Created with PostHog Desktop from this inbox report.