From d2cbc2aaaffe62a800dd4f2fffa85d0f6941632e Mon Sep 17 00:00:00 2001 From: xli-oai Date: Tue, 14 Apr 2026 16:50:19 -0700 Subject: [PATCH] Fix marketplace source test regressions --- codex-rs/app-server/tests/suite/v2/marketplace_add.rs | 7 ++++--- codex-rs/core/src/plugins/marketplace_add/source.rs | 2 +- codex-rs/utils/sandbox-summary/BUILD.bazel | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) 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 cf3c57360f..d4a13d137b 100644 --- a/codex-rs/app-server/tests/suite/v2/marketplace_add.rs +++ b/codex-rs/app-server/tests/suite/v2/marketplace_add.rs @@ -10,7 +10,8 @@ use tempfile::TempDir; use tokio::time::Duration; use tokio::time::timeout; -const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10); +const INIT_TIMEOUT: Duration = Duration::from_secs(30); +const REQUEST_TIMEOUT: Duration = Duration::from_secs(10); #[tokio::test] async fn marketplace_add_local_directory_source() -> Result<()> { @@ -28,7 +29,7 @@ async fn marketplace_add_local_directory_source() -> Result<()> { )?; std::fs::write(source.join("plugins/sample/marker.txt"), "local ref")?; let mut mcp = McpProcess::new(codex_home.path()).await?; - timeout(DEFAULT_TIMEOUT, mcp.initialize()).await??; + timeout(INIT_TIMEOUT, mcp.initialize()).await??; let request_id = mcp .send_marketplace_add_request(MarketplaceAddParams { @@ -39,7 +40,7 @@ async fn marketplace_add_local_directory_source() -> Result<()> { .await?; let response: JSONRPCResponse = timeout( - DEFAULT_TIMEOUT, + REQUEST_TIMEOUT, mcp.read_stream_until_response_message(RequestId::Integer(request_id)), ) .await??; diff --git a/codex-rs/core/src/plugins/marketplace_add/source.rs b/codex-rs/core/src/plugins/marketplace_add/source.rs index 19fec57ade..d7bd413887 100644 --- a/codex-rs/core/src/plugins/marketplace_add/source.rs +++ b/codex-rs/core/src/plugins/marketplace_add/source.rs @@ -126,10 +126,10 @@ fn normalize_git_url(url: &str) -> String { fn looks_like_local_path(source: &str) -> bool { source.starts_with("./") || source.starts_with("../") - || source.starts_with('/') || source.starts_with("~/") || source == "." || source == ".." + || Path::new(source).is_absolute() } fn resolve_local_source_path(source: &str) -> Result { diff --git a/codex-rs/utils/sandbox-summary/BUILD.bazel b/codex-rs/utils/sandbox-summary/BUILD.bazel index fd3e5371b6..7ac72b2cf3 100644 --- a/codex-rs/utils/sandbox-summary/BUILD.bazel +++ b/codex-rs/utils/sandbox-summary/BUILD.bazel @@ -3,4 +3,5 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "sandbox-summary", crate_name = "codex_utils_sandbox_summary", + unit_test_timeout = "short", )