Skip to content

plugin: support local-based marketplace.json + install endpoint.#13422

Merged
xl-openai merged 2 commits intomainfrom
xl/plugins
Mar 5, 2026
Merged

plugin: support local-based marketplace.json + install endpoint.#13422
xl-openai merged 2 commits intomainfrom
xl/plugins

Conversation

@xl-openai
Copy link
Collaborator

Support marketplace.json that points to a local file, with

    "source":
    {
        "source": "local",
        "path": "./plugin-1"
    },

Add a new plugin/install endpoint which add the plugin to the cache folder and enable it in config.toml.

Copy link
Contributor

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

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: 736e85a549

ℹ️ 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".

@@ -1,14 +1,15 @@
mod manager;
mod manifest;
mod marketplace;
Copy link
Contributor

Choose a reason for hiding this comment

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

P0 Badge Add missing plugins::marketplace module

mod marketplace; is declared, and manager.rs imports super::marketplace::*, but this commit does not add codex-rs/core/src/plugins/marketplace.rs (or plugins/marketplace/mod.rs). The crate will not compile due to unresolved module/imports, so plugin/install cannot work at all.

Useful? React with 👍 / 👎.

sayan-oai

This comment was marked as outdated.

Copy link
Collaborator

@sayan-oai sayan-oai left a comment

Choose a reason for hiding this comment

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

one small comment about errors.

also want to clarify that we will add post-install validation after this? to check if a plugin's apps need to be installed in chatgpt, so we can return that to the client and have them trigger whatever app-install flow they have.

approving to unblock

}

pub fn is_invalid_request(&self) -> bool {
matches!(self, Self::Marketplace(_) | Self::Store(_))
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe nit, but MarketplaceError and PluginStoreError include IO error variants, so issues with things like reading marketplace.json and moving plugin to cache would get returned to client as invalid request errors, which is misleading

@xl-openai
Copy link
Collaborator Author

@codex review again

Copy link
Contributor

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

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: 78ce0d4ff4

ℹ️ 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 on lines +210 to +211
pub fn is_invalid_request(&self) -> bool {
matches!(self, Self::Marketplace(_) | Self::Store(_))
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Badge Classify only client-caused install errors as invalid requests

is_invalid_request() marks all Marketplace and Store failures as client errors. But those enums include Io variants (e.g., unreadable marketplace.json, copy/write failures), so server-side faults are returned as INVALID_REQUEST in plugin_install instead of internal errors. This misleads clients and hides operational failures.

Useful? React with 👍 / 👎.

Comment on lines +162 to +166
let relative_source_path = Path::new(path);
if relative_source_path
.components()
.any(|component| !matches!(component, Component::Normal(_)))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Canonicalize local source paths before enforcing directory bounds

The path check is purely lexical (Component::Normal) and does not resolve symlinks. A marketplace entry like ./plugin-link can pass validation even if plugin-link points outside .agents/plugins, bypassing the stated confinement rule and allowing installs from arbitrary directories.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't intended to be a strong security boundary. marketplace.json is trusted local configuration, and the current validation is only meant to reject obvious path traversal and malformed relative paths, not to defend against symlink-based escapes.

@xl-openai xl-openai merged commit 1e877cc into main Mar 5, 2026
31 checks passed
@xl-openai xl-openai deleted the xl/plugins branch March 5, 2026 00:08
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 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.

2 participants