Skip to content

fix(codex): feature-detect plugin marketplace subcommand before install#959

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/codex-plugin-marketplace-feature-detect
Draft

fix(codex): feature-detect plugin marketplace subcommand before install#959
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/codex-plugin-marketplace-feature-detect

Conversation

@posthog

@posthog posthog Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

The Codex plugin install crashed for users whose Codex CLI is too old to know the plugin marketplace subcommand. supportsPlugin() only checked that a codex binary was on PATH, so the wizard unconditionally ran codex plugin marketplace add PostHog/ai-plugin. Older versions parse plugin as a prompt and reject the rest (error: unexpected argument 'marketplace' found), which surfaced as a hard error in the plugin-install step instead of a graceful skip.

Changes

  • supportsPlugin() now feature-detects the subcommand by probing codex plugin marketplace --help (result cached), so incompatible versions are filtered out before install is attempted.
  • installPlugin() treats unexpected-argument / unrecognized-subcommand output as a clean skip rather than capturing an exception — mirroring the existing stale-cache retry handling.

Test plan

Covered by CI. Added unit tests for old-version detection (skip without capturing an exception), new-version support, and caching of the probe. Full suite green (pnpm build && pnpm test && pnpm fix).


Created with PostHog Code from this inbox report.

Older Codex CLI versions lack the `plugin marketplace` subcommand and parse
`plugin` as a prompt, rejecting the rest with `unexpected argument 'marketplace'
found`. The install was gated only by a binary-presence check, so it threw a hard
error on those versions.

supportsPlugin() now probes `codex plugin marketplace --help` (cached) so
unsupported versions are filtered out before install. installPlugin() also treats
the unexpected-argument / unrecognized-subcommand output as a clean skip rather
than capturing an exception.

Generated-By: PostHog Code
Task-Id: 3a5b7986-c802-4e26-95ef-e5399f15bcdb
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run 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:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants