Skip to content

feat: load from plugins#12864

Merged
xl-openai merged 4 commits intomainfrom
xl/plugins
Mar 1, 2026
Merged

feat: load from plugins#12864
xl-openai merged 4 commits intomainfrom
xl/plugins

Conversation

@xl-openai
Copy link
Copy Markdown
Collaborator

Support loading plugins.

Plugins can now be enabled via [plugins.] in config.toml. They are loaded as first-class entities through PluginsManager, and their default skills/ and .mcp.json contributions are integrated into the existing skills and MCP flows.

err.message
);
}
for plugin in loaded_plugins
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can this be logged in plugins_manager.plugins_for_config ?


impl Error for SkillParseError {}

pub fn load_skills(config: &Config) -> SkillLoadOutcome {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Cleanup of functions not longer in use.

@xl-openai xl-openai force-pushed the xl/plugins branch 5 times, most recently from 0842dc7 to b68896a Compare February 27, 2026 08:19
Copy link
Copy Markdown
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 main question about different config sources for loading plugins

return PluginLoadOutcome::default();
}

if !force_reload && let Some(outcome) = self.cached_outcome() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

plugins() is reading the global config stack reloaded from disk, but plugins_for_config() above reads from the session's resolved config_layer_stack.

yet both write to/read from the same cache slot.

so skills_for_cwd() can reuse plugin roots from a different config stack

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

configured_plugins_from_stack currently reads only from the user layer, so the behavior is consistent for now. We should decide whether we actually need per-cwd plugin loading at all.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added a comment to the function.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hmm, i dont see a need for per-cwd plugin loading right now

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually maybe it would be useful. Let me add it back.

Copy link
Copy Markdown
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.

moving back to per-cwd cache, other than that lgtm

@xl-openai
Copy link
Copy Markdown
Collaborator Author

@codex review again

Copy link
Copy Markdown
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: 08033c8c0e

ℹ️ 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 +103 to +104
if !force_reload && let Some(outcome) = self.cached_outcome_for_cwd(cwd) {
return outcome;
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.

P1 Badge Invalidate plugin cache when plugin config changes

plugins_for_layer_stack reuses cached plugin outcomes based only on cwd. Since plugins_for_config always calls it with force_reload = false, edits to [plugins] (or plugin paths) for the same cwd can keep returning stale skill roots/MCP servers, including during app-server refresh flows, until some separate clear_cache happens.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes but there will be a force_reload endpoint later.

Comment on lines +143 to +144
Features::from_config(&config_toml, &config_profile, FeatureOverrides::default());
features.enabled(Feature::Plugins)
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.

P2 Badge Use resolved feature flags when deciding plugin enablement

Plugin gating is recomputed from raw layer-stack TOML with FeatureOverrides::default() instead of the already-resolved Config.features. If runtime profile/override selection differs from config_toml.profile, plugin loading can be incorrectly disabled/enabled for the session.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it is ok.

Copy link
Copy Markdown
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

let installed = config.mcp_servers.get().clone();
let missing = collect_missing_mcp_dependencies(mentioned_skills, &installed);

P1 Badge Check MCP dependencies against effective server set

maybe_prompt_and_install_mcp_dependencies uses config.mcp_servers to decide what is already installed, but plugin servers are merged only via McpManager. As a result, plugin-provided dependencies are treated as missing, users get incorrect install prompts, and maybe_install_mcp_dependencies can write duplicate MCP entries into global config.

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

@xl-openai xl-openai merged commit 752402c into main Mar 1, 2026
31 checks passed
@xl-openai xl-openai deleted the xl/plugins branch March 1, 2026 18:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants