mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
Migrate plugin commands into skills on install (#33411)
## What changed - Convert supported plugin command Markdown into generated skills when a plugin is installed. - Read command sources from the manifest's `commands` field, falling back to the plugin's `commands/` directory. - Load generated command skills alongside native plugin skills while preferring native skills with the same name. - Skip commands with unsupported templates, missing descriptions, name collisions, or generated skills larger than 4 KB, and keep migration failures from blocking plugin installation. ## Testing - Cover default and manifest-configured command paths, stale generated skill cleanup, size limits, native-skill precedence, invalid manifest fields, and non-fatal migration errors. GitOrigin-RevId: 67d910048544b160b191066569bca69b2b951ebc
This commit is contained in:
committed by
copyberry
parent
38b064c31b
commit
2cd6ed7509
@@ -1,3 +1,4 @@
|
||||
use crate::command_migration::migrate_plugin_commands;
|
||||
use crate::manifest::PluginManifest;
|
||||
use crate::manifest::load_plugin_manifest;
|
||||
use crate::manifest::parse_plugin_manifest;
|
||||
@@ -563,6 +564,9 @@ fn replace_plugin_root_atomically(
|
||||
fs::write(&manifest_path, contents)
|
||||
.map_err(|err| PluginStoreError::io("failed to write fallback plugin manifest", err))?;
|
||||
}
|
||||
if let Err(err) = migrate_plugin_commands(&staged_version_root) {
|
||||
tracing::warn!(%err, "failed to migrate plugin commands into skills");
|
||||
}
|
||||
|
||||
let target_version_root = target_root.join(plugin_version);
|
||||
if target_root.exists() && !target_version_root.exists() {
|
||||
|
||||
Reference in New Issue
Block a user