fix(codex): feature-detect plugin marketplace subcommand before install#959
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(codex): feature-detect plugin marketplace subcommand before install#959posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
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
🧙 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
The Codex plugin install crashed for users whose Codex CLI is too old to know the
plugin marketplacesubcommand.supportsPlugin()only checked that acodexbinary was on PATH, so the wizard unconditionally rancodex plugin marketplace add PostHog/ai-plugin. Older versions parsepluginas 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 probingcodex 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.