Skip to content

support plugin/list.#13540

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

support plugin/list.#13540
xl-openai merged 2 commits intomainfrom
xl/plugins

Conversation

@xl-openai
Copy link
Collaborator

Introduce a plugin/list which reads from local marketplace.json.
Also update the signature for plugin/install.

@xl-openai xl-openai requested a review from sayan-oai March 5, 2026 04:57
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: 8ea5996f33

ℹ️ 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 5081 to +5089
let PluginInstallParams {
marketplace_name,
marketplace_path,
plugin_name,
cwd,
} = params;

let plugins_manager = self.thread_manager.plugins_manager();
let request = PluginInstallRequest {
plugin_name,
marketplace_name,
cwd: cwd.unwrap_or_else(|| self.config.cwd.clone()),
marketplace_path,
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 Restrict plugin/install to discovered marketplace files

plugin_install trusts marketplacePath from the request and forwards it directly into install resolution without verifying it came from plugin/list discovery. This lets a client install from any readable marketplace.json on disk, bypassing the intended home/repo marketplace boundary described for discovered entries.

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.

I think this is OK.

@sayan-oai sayan-oai mentioned this pull request Mar 5, 2026
Comment on lines +239 to +243
// Enabled state is keyed by `<plugin>@<marketplace>`, so duplicate
// marketplace files with the same declared name intentionally share
// the same config toggle.
enabled: configured_plugins
.get(&format!("{}@{marketplace_name}", plugin.name))
Copy link
Collaborator

Choose a reason for hiding this comment

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

like you say here, our downstream logic keys by plugin@marketplace, yet we return duplicate plugin@marketplace entries from plugin/list. Why? if we are effectively treating them as a single resolved plugin, shouldn't we enforce at most one resolved plugin per plugin@markeplace, and return that from plugin/list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update to keep the first one.

pub struct PluginSummary {
pub name: String,
pub source: PluginSource,
pub enabled: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

like you mentioned, we should probably include installed status in an enum here (something like: uninstalled, disabled, enabled).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do it as a follow up PR.

Comment on lines +4947 to +4951
MarketplaceError::InvalidMarketplaceFile { .. }
| MarketplaceError::PluginNotFound { .. }
| MarketplaceError::DuplicatePlugin { .. }
| MarketplaceError::InvalidPlugin(_) => {
self.send_invalid_request_error(request_id, err.to_string())
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think in plugin/install we treat an invalid/missing marketplace file as an internal error and not an invalid request. we should unify.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@xl-openai xl-openai force-pushed the xl/plugins branch 2 times, most recently from 53c6dd5 to 058a35b Compare March 5, 2026 22:33
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 piece of feedback that should be addressed, but approving to unblock

.into_iter()
.filter_map(|plugin| {
let plugin_key = format!("{}@{marketplace_name}", plugin.name);
if !seen_plugin_keys.insert(plugin_key.clone()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we silently drop here based on first seen, but in plugin/install we error on duplicates. so i think if there are duplicate plugins in a single marketplace file, plugin/list will return one, but plugin/install will fail on the same marketplace file.

is there a reason to keep the behavior different or should we unify on one (silent drop or error)?

Copy link
Collaborator Author

@xl-openai xl-openai Mar 6, 2026

Choose a reason for hiding this comment

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

This is a pretty annoying edge case, but I agree with you — I’ll handle both scenarios and just pick one.
I just don’t want to block plugin listing because of a minor issue on a marketplace.json file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yea good to merge without this, but we should track + address soon.

@xl-openai xl-openai merged commit 520ed72 into main Mar 6, 2026
71 of 75 checks passed
@xl-openai xl-openai deleted the xl/plugins branch March 6, 2026 02:58
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 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