fix: register PostHog marketplace before Claude Code plugin install#479
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix: register PostHog marketplace before Claude Code plugin install#479posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
`claude plugin install posthog` fails for users who haven't pre-registered the PostHog marketplace — the dominant variant of the `Claude Code plugin install failed` exception (Error Tracking: ~1,977 occurrences across 842 distinct users in 90 days). The sibling Codex client already runs `marketplace add` first; mirror that here. Also detect the rarer `Marketplace configuration file is corrupted` stderr and surface a clearer message pointing at the user's local config so the captured exception is actionable instead of generic. The stale-cache retry mirrors the Codex pattern (clear `~/.claude/plugins/marketplaces/posthog` and try once more). Tests cover the new marketplace-add step, the stale-cache retry, the corrupt-config branch, the "already added" passthrough, and the existing install-step failure modes. Generated-By: PostHog Code Task-Id: c34c6418-2898-44cb-9459-60ddf9221364
🧙 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.installPlugin()(src/steps/add-mcp-server-to-clients/clients/claude-code.ts:143-159) callsclaude plugin install posthogdirectly without ever registering the PostHog marketplace, so any user without the marketplace pre-configured getsPlugin "posthog" not found in any configured marketplace. Error Tracking shows ~1,977 occurrences ofClaude Code plugin install failedacross 842 distinct users over the last 90 days, with that variant dominant. A rarer variant (Marketplace configuration file is corrupted: local.source.source: Invalid input, 1 user) flows through the same path and gets captured as a generic wizard exception with no recovery hint.The sibling Codex client (
codex.ts:93-132) already registers the marketplace and even retries on a stale local cache; the Claude Code client skipped that step entirely.Changes
claude-code.ts:installPlugin()now runsclaude plugin marketplace add PostHog/ai-pluginviaspawnSyncbeforeclaude plugin install posthog, mirroring the Codex pattern. Stale-cache stderr (already added from a different source) triggers a one-shot retry that clears~/.claude/plugins/marketplaces/posthog.already added/already existsstderr is treated as a no-op (continue to install).claude-code.ts: corrupted-config stderr is detected and captured with a clearer message pointing the user at their local~/.claude/plugins/config instead of the genericClaude Code plugin install failed.claude-code.test.ts: adds coverage for the marketplace-add step, the "already added" passthrough, the stale-cache retry, the corrupt-config branch, and a generic marketplace-add failure. Existing install-step branches kept intact.Test plan
pnpm buildpnpm test -- claude-code— 15/15 passpnpm test— full suite passes (one provision-cli timeout was flaky under parallel load, passes in isolation and onmain)pnpm lint— 0 errorsCreated with PostHog Code