Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Handle @ in local marketplace paths (#34959)

Philipp Spiess7d748d3bbcbd
diff --git a/codex-rs/app-server/tests/suite/v2/marketplace_add.rs b/codex-rs/app-server/tests/suite/v2/marketplace_add.rs
index 0e82a802b2..0f30629cf1 100644
--- a/codex-rs/app-server/tests/suite/v2/marketplace_add.rs
+++ b/codex-rs/app-server/tests/suite/v2/marketplace_add.rs
@@ -13,7 +13,7 @@ const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
#[tokio::test]
async fn marketplace_add_local_directory_source() -> Result<()> {
let codex_home = TempDir::new()?;
- let source = codex_home.path().join("marketplace");
+ let source = codex_home.path().join("[email protected]/marketplace");
std::fs::create_dir_all(source.join(".agents/plugins"))?;
std::fs::create_dir_all(source.join("plugins/sample/.codex-plugin"))?;
std::fs::write(
@@ -33,7 +33,7 @@ async fn marketplace_add_local_directory_source() -> Result<()> {
let request_id = mcp
.send_marketplace_add_request(MarketplaceAddParams {
- source: "./marketplace".to_string(),
+ source: "./[email protected]/marketplace".to_string(),
ref_name: None,
sparse_paths: None,
})
diff --git a/codex-rs/core-plugins/src/marketplace_add/source.rs b/codex-rs/core-plugins/src/marketplace_add/source.rs
index 6845129e5b..043c6a3f7d 100644
--- a/codex-rs/core-plugins/src/marketplace_add/source.rs
+++ b/codex-rs/core-plugins/src/marketplace_add/source.rs
@@ -101,7 +101,8 @@ fn split_source_ref(source: &str) -> (String, Option<String>) {
if let Some((base, ref_name)) = source.rsplit_once('#') {
return (base.to_string(), non_empty_ref(ref_name));
}
- if !source.contains("://")
+ if !looks_like_local_path(source)
+ && !source.contains("://")
&& !is_ssh_git_url(source)
&& let Some((base, ref_name)) = source.rsplit_once('@')
{