Skip to content

[codex] Support npm marketplace plugin sources#29375

Merged
charlesgong-openai merged 4 commits into
mainfrom
dev/charlesgong/support-npm-marketplace-sources
Jun 26, 2026
Merged

[codex] Support npm marketplace plugin sources#29375
charlesgong-openai merged 4 commits into
mainfrom
dev/charlesgong/support-npm-marketplace-sources

Conversation

@charlesgong-openai

@charlesgong-openai charlesgong-openai commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Why

Marketplace source deserialization treated {"source":"npm", ...} as unsupported. The loader logged and skipped the entry, so npm-backed plugins never appeared in plugin list --available and plugin add returned "plugin not found".

Codex plugins are installed from a plugin root, not from an npm dependency tree. For npm-backed marketplace entries, Codex should fetch the published package contents without running package scripts or installing unrelated dependencies.

What changed

  • Add npm marketplace plugin sources with package, optional semver version or version range, and optional HTTPS registry.
  • Reject unsafe npm source fields before materialization, including invalid package names, non-semver version selectors, plaintext or credential-bearing registry URLs, and registry query/fragment data.
  • Materialize npm plugins with npm pack --ignore-scripts, then unpack the resulting tarball through the existing hardened plugin bundle extractor.
  • Enforce npm archive and extracted-size limits, require the standard npm package/ archive root, and verify the extracted package.json name matches the requested package before installing.
  • Keep plugin listings, install-source descriptions, CLI JSON/human output, app-server v2 PluginSource, TUI source summaries, regenerated schema fixtures, and app-server documentation in sync.

Impact

Marketplaces can distribute Codex plugins from public or configured private HTTPS npm registries using the same install flow as existing materialized plugin sources. npm must be available on PATH when an npm-backed plugin is installed.

Fixes #27831

Validation

  • just write-app-server-schema
  • just test -p codex-core-plugins -p codex-app-server-protocol -p codex-app-server -p codex-cli
    • npm/schema/core-plugin coverage passed in the run.
    • The full focused command finished with 1739 passed, 11 failed, and 6 timed out; the failures were unrelated local app-server environment failures from sandbox-exec: sandbox_apply: Operation not permitted plus one missing test_stdio_server helper binary.
  • Installed an npm-published Codex plugin package through a throwaway local marketplace and throwaway CODEX_HOME to exercise the real npm materialization path end to end.

@@ -748,6 +774,117 @@ fn normalize_optional_git_selector(value: &Option<String>) -> Option<String> {
.map(str::to_string)
}

fn normalize_npm_package(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main npm validator

@@ -0,0 +1,229 @@
use crate::plugin_bundle_archive::unpack_plugin_bundle_tar_gz;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main fetcher

@charlesgong-openai charlesgong-openai force-pushed the dev/charlesgong/support-npm-marketplace-sources branch 2 times, most recently from 9db763c to 8f1493d Compare June 25, 2026 18:14
@charlesgong-openai charlesgong-openai force-pushed the dev/charlesgong/support-npm-marketplace-sources branch from cc63980 to 048cae4 Compare June 25, 2026 19:15
@charlesgong-openai charlesgong-openai marked this pull request as ready for review June 25, 2026 19:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 048cae405c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core-plugins/src/marketplace.rs Outdated
Comment thread codex-rs/tui/src/chatwidget/plugin_catalog.rs
Comment thread codex-rs/core-plugins/src/npm_source.rs
Comment thread codex-rs/core-plugins/src/marketplace.rs Outdated
@charlesgong-openai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 👍

Reviewed commit: a2504d2771

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server/README.md Outdated
Comment thread codex-rs/app-server-protocol/src/protocol/v2/plugin.rs
@charlesgong-openai charlesgong-openai merged commit 6509f31 into main Jun 26, 2026
31 checks passed
@charlesgong-openai charlesgong-openai deleted the dev/charlesgong/support-npm-marketplace-sources branch June 26, 2026 21:24
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support npm package sources in marketplace.json plugin entries (currently silently ignored)

2 participants