diff --git a/codex-rs/external-agent-migration/src/service_tests/plugins/basics.rs b/codex-rs/external-agent-migration/src/service_tests/plugins/basics.rs index f1539ccc55b1..8625534e61da 100644 --- a/codex-rs/external-agent-migration/src/service_tests/plugins/basics.rs +++ b/codex-rs/external-agent-migration/src/service_tests/plugins/basics.rs @@ -220,6 +220,30 @@ fn marketplace_import_sources_prefers_supported_declaration_over_materialization ); } +#[test] +fn marketplace_import_sources_infers_bundled_claude_code_marketplace() { + let (_root, external_agent_home, _codex_home) = fixture_paths(); + let settings = serde_json::json!({ + "enabledPlugins": { + "code-review@claude-code-plugins": true, + } + }); + + let import_sources = source_cla::marketplace_import_sources( + &settings, + &external_agent_home, + &external_agent_home, + ); + + assert_eq!( + import_sources.get("claude-code-plugins"), + Some(&MarketplaceImportSource { + source: "anthropics/claude-code".to_string(), + ref_name: None, + }) + ); +} + #[tokio::test] async fn detect_home_plugins_uses_local_settings_over_project_settings() { let (_root, external_agent_home, codex_home) = fixture_paths(); diff --git a/codex-rs/external-agent-migration/src/source_cla.rs b/codex-rs/external-agent-migration/src/source_cla.rs index 42965a551d09..b2620eaf1a3b 100644 --- a/codex-rs/external-agent-migration/src/source_cla.rs +++ b/codex-rs/external-agent-migration/src/source_cla.rs @@ -21,6 +21,8 @@ use crate::model::PluginsMigration; pub(super) const KNOWN_MARKETPLACES_PATH: &str = "plugins/known_marketplaces.json"; pub(super) const OFFICIAL_MARKETPLACE_NAME: &str = "claude-plugins-official"; pub(super) const OFFICIAL_MARKETPLACE_SOURCE: &str = "anthropics/claude-plugins-official"; +pub(super) const CLAUDE_CODE_MARKETPLACE_NAME: &str = "claude-code-plugins"; +pub(super) const CLAUDE_CODE_MARKETPLACE_SOURCE: &str = "anthropics/claude-code"; pub(super) const REWRITE_PROFILE: RewriteProfile = ClaSource::REWRITE_PROFILE; const COMMAND_MIGRATION_PROFILE: CommandMigrationProfile = CommandMigrationProfile::new( CommandRewriteProfile::new( @@ -101,16 +103,21 @@ pub(super) fn marketplace_import_sources( )); } - if has_enabled_plugin_for_marketplace(settings, OFFICIAL_MARKETPLACE_NAME) - && !import_sources.contains_key(OFFICIAL_MARKETPLACE_NAME) - { - import_sources.insert( - OFFICIAL_MARKETPLACE_NAME.to_string(), - MarketplaceImportSource { - source: OFFICIAL_MARKETPLACE_SOURCE.to_string(), - ref_name: None, - }, - ); + for (marketplace_name, marketplace_source) in [ + (OFFICIAL_MARKETPLACE_NAME, OFFICIAL_MARKETPLACE_SOURCE), + (CLAUDE_CODE_MARKETPLACE_NAME, CLAUDE_CODE_MARKETPLACE_SOURCE), + ] { + if has_enabled_plugin_for_marketplace(settings, marketplace_name) + && !import_sources.contains_key(marketplace_name) + { + import_sources.insert( + marketplace_name.to_string(), + MarketplaceImportSource { + source: marketplace_source.to_string(), + ref_name: None, + }, + ); + } } import_sources