Skip to content

Refactor plugin config and cache path#13333

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

Refactor plugin config and cache path#13333
xl-openai merged 2 commits intomainfrom
xl/plugins

Conversation

@xl-openai
Copy link
Copy Markdown
Collaborator

Update config.toml plugin entries to use <plugin_name>@<marketplace_name> as the key.
Plugin now stays in [plugins/cache/marketplace-name/plugin-name/$version/]
Clean up the plugin code structure.
Add plugin install functionality (not used yet).

@xl-openai xl-openai requested a review from sayan-oai March 3, 2026 06:47
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: 2c36d0e447

ℹ️ 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 +159 to +163
if plugin_name.is_empty() || marketplace_name.is_empty() {
return Err(PluginStoreError::InvalidPluginKey(format!(
"invalid plugin key `{plugin_key}`; expected <plugin>@<marketplace>"
)));
}
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 Reject path separators in plugin/cache key segments

parse_plugin_key only checks for empty strings, but plugin_root/install later join these values into filesystem paths. Keys like ../../etc@test (or manifest names with //absolute roots) can escape plugins/cache, letting plugin load/install read, overwrite, or delete paths outside codex home via remove_existing_target and recursive copy.

Useful? React with 👍 / 👎.

Ok((plugin_name, marketplace_name))
}

fn validate_plugin_key_segment(
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.

optional nit: maybe just inline the two calls in parse_plugin_key? there's already a lot of standalone functions in this file


ConfigService::new_with_defaults(self.codex_home.clone())
.write_value(ConfigValueWriteParams {
key_path: format!("plugins.{}", result.plugin_key),
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.

we separate by . here but ConfigService::parse_key_path splits on ., so this would cause weird key splitting I think.

.map(|_| plugin_name)
}

fn parse_plugin_key(plugin_key: &str) -> Result<(&str, &str), PluginStoreError> {
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.

should we just make this a type rather than a specifically-formatted string? like PluginId {name, marketplace}, or something?

@xl-openai xl-openai merged commit 9b004e2 into main Mar 3, 2026
51 of 53 checks passed
@xl-openai xl-openai deleted the xl/plugins branch March 3, 2026 23:00
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 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