Skip to content

[codex] Cache plugin metadata for tool suggestions#27812

Merged
mzeng-openai merged 11 commits into
mainfrom
dev/mzeng/cache-discoverable-plugin-metadata
Jun 18, 2026
Merged

[codex] Cache plugin metadata for tool suggestions#27812
mzeng-openai merged 11 commits into
mainfrom
dev/mzeng/cache-discoverable-plugin-metadata

Conversation

@mzeng-openai

@mzeng-openai mzeng-openai commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Why

built_tools runs for every sampling request, and local plugin discovery was repeatedly rereading plugin manifests, skills, MCP configuration, and app declarations to build the same tool-suggest metadata.

That source-derived metadata is stable until the existing plugin manager reloads its cache. Runtime eligibility still needs to reflect the current install, disable, policy, app-overlap, and authentication state.

What changed

  • Add a bounded, in-memory tool-suggest metadata cache owned by PluginsManager.
  • Key cached metadata by plugin identity and source, while applying authentication routing each time the metadata is projected.
  • Invalidate the metadata alongside the existing loaded-plugin cache, including its normal configuration, marketplace refresh, and remote-installed-plugin invalidation paths.
  • Guard against an in-flight load repopulating stale metadata after invalidation.
  • Keep marketplace membership and all runtime eligibility filtering live rather than introducing a separate catalog or revision model.

Impact

Repeated sampling requests reuse already-loaded plugin capability metadata while retaining the existing plugin-manager lifecycle as the single freshness boundary.

Validation

  • just test -p codex-core-plugins — 252 passed
  • Added focused coverage for cache invalidation and authentication reprojection.

@mzeng-openai mzeng-openai force-pushed the dev/mzeng/cache-discoverable-plugin-metadata branch 2 times, most recently from d689a92 to a362009 Compare June 16, 2026 05:00
@mzeng-openai mzeng-openai changed the title [codex] Cache discoverable plugin metadata for tool suggestions [codex] Cache discoverable plugin capabilities Jun 16, 2026
@mzeng-openai mzeng-openai changed the base branch from main to dev/mzeng/plugin-catalog-snapshots June 16, 2026 05:00
@mzeng-openai mzeng-openai changed the title [codex] Cache discoverable plugin capabilities [codex] Reuse revision-stable plugin catalogs for tool suggestions Jun 16, 2026
@mzeng-openai mzeng-openai changed the base branch from dev/mzeng/plugin-catalog-snapshots to main June 16, 2026 19:22
@mzeng-openai mzeng-openai force-pushed the dev/mzeng/cache-discoverable-plugin-metadata branch 2 times, most recently from 9f04dc4 to 4a170e8 Compare June 16, 2026 20:56
@mzeng-openai mzeng-openai changed the title [codex] Reuse revision-stable plugin catalogs for tool suggestions [codex] Cache plugin metadata for tool suggestions Jun 17, 2026
@mzeng-openai mzeng-openai marked this pull request as ready for review June 17, 2026 22:01

@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: 7ab980a023

ℹ️ 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/tool_suggest_metadata.rs Outdated
@mzeng-openai mzeng-openai force-pushed the dev/mzeng/cache-discoverable-plugin-metadata branch from 1d96b38 to c30b4dc Compare June 18, 2026 07:25
@mzeng-openai mzeng-openai merged commit a52a3b5 into main Jun 18, 2026
46 of 47 checks passed
@mzeng-openai mzeng-openai deleted the dev/mzeng/cache-discoverable-plugin-metadata branch June 18, 2026 19:25
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants