Skip to content

Read cached metadata for installed Git plugins#20825

Merged
xli-oai merged 2 commits into
mainfrom
xli-codex/cross-repo-plugin-list-metadata
May 10, 2026
Merged

Read cached metadata for installed Git plugins#20825
xli-oai merged 2 commits into
mainfrom
xli-codex/cross-repo-plugin-list-metadata

Conversation

@xli-oai
Copy link
Copy Markdown
Contributor

@xli-oai xli-oai commented May 2, 2026

Summary

  • Populate plugin/list interface metadata for installed Git-sourced marketplace plugins from the active cached plugin bundle.
  • Preserve marketplace category precedence so list behavior matches plugin/read.
  • Keep existing fallback behavior when the cache or manifest is missing or invalid.

Test Plan

  • cd codex-rs && just fmt
  • cd codex-rs && cargo test -p codex-core-plugins list_marketplaces_installed_git_source_reads_metadata_from_cache_without_cloning
  • cd codex-rs && cargo test -p codex-app-server plugin_list_returns_installed_git_source_interface_from_cache
  • cd codex-rs && just fix -p codex-core-plugins
  • cd codex-rs && just fix -p codex-app-server
  • git diff --check

Server-truth check: OpenAI monorepo app-server generated types already expose PluginSummary.interface, and the webview consumes it for plugin cards. This PR keeps the protocol/schema unchanged and fills the existing field from the cached installed bundle for Git-backed cross-repo plugins.

@xli-oai xli-oai added the oai PRs contributed by OpenAI employees label May 2, 2026 — with ChatGPT Codex Connector
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request May 3, 2026
@xli-oai xli-oai marked this pull request as ready for review May 5, 2026 01:46
@xli-oai
Copy link
Copy Markdown
Contributor Author

xli-oai commented May 5, 2026

@codex review

Copy link
Copy Markdown
Contributor Author

xli-oai commented May 5, 2026

Note on the small installed / enabled diff in list_marketplaces_for_config:

This does not remove the behavior. The previous code computed the values inline when building ConfiguredMarketplacePlugin:

installed: installed_plugins.contains(&plugin_key),
enabled: enabled_plugins.contains(&plugin_key),

The PR hoists those exact same checks into local variables because the new cached-metadata path needs installed before the struct is built:

let installed = installed_plugins.contains(&plugin_key);
let enabled = enabled_plugins.contains(&plugin_key);

if installed && matches!(&plugin.source, MarketplacePluginSource::Git { .. }) {
    // read active cached plugin root and use its plugin.json interface metadata
}

Then the struct gets the same values:

installed,
enabled,

Concrete example: for toolkit@debug, installed is still exactly installed_plugins.contains("toolkit@debug"), and enabled is still exactly enabled_plugins.contains("toolkit@debug"). The only behavior change is that installed Git-sourced plugins can use cached bundle metadata for interface before the list entry is returned.

id: plugin_key.clone() became id: plugin_key because plugin_key is not used after the struct is created, so moving it avoids an unnecessary clone without changing the duplicate-source behavior described by the existing comment.

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

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

PluginId::new(plugin.name.clone(), marketplace_name.clone())
&& let Some(plugin_root) = self.store.active_plugin_root(&plugin_id)
&& let Some(manifest) = load_plugin_manifest(plugin_root.as_path())
{
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.

we display remote plugin detail iff plugin is:

  1. installed
  2. marketplace is git backed
  3. plugin root is valid
  4. plugin manifest exists

@xli-oai xli-oai force-pushed the xli-codex/cross-repo-plugin-list-metadata branch 2 times, most recently from f62303e to e4cac3f Compare May 6, 2026 04:05
@xli-oai
Copy link
Copy Markdown
Contributor Author

xli-oai commented May 10, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Chef's kiss.

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

@xli-oai xli-oai force-pushed the xli-codex/cross-repo-plugin-list-metadata branch from 6fd0a0f to b45d8bf Compare May 10, 2026 23:10
@xli-oai xli-oai merged commit 2abdeb3 into main May 10, 2026
26 checks passed
@xli-oai xli-oai deleted the xli-codex/cross-repo-plugin-list-metadata branch May 10, 2026 23:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants