Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ pub(super) fn run_cleanup(
overrides.extend([
"analytics.enabled=false".to_string(),
"features.plugins=true".to_string(),
"features.remote_plugin=true".to_string(),
]);
let mut client = CodexClient::spawn_stdio(codex_bin, &overrides)?;
client.initialize()?;
Expand Down Expand Up @@ -199,7 +198,6 @@ fn spawn_client(
overrides.extend([
"analytics.enabled=true".to_string(),
"features.plugins=true".to_string(),
"features.remote_plugin=true".to_string(),
]);
let environment = vec![(
OsString::from(ANALYTICS_CAPTURE_ENV_VAR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ fn smoke_config_overrides(responses_base_url: &str) -> Result<Vec<String>> {
Ok(vec![
"analytics.enabled=true".to_string(),
"features.plugins=true".to_string(),
"features.remote_plugin=true".to_string(),
format!("model={}", quoted(MOCK_MODEL_SLUG)?),
format!("model_provider={}", quoted(MOCK_PROVIDER_ID)?),
format!(
Expand Down
2 changes: 0 additions & 2 deletions codex-rs/app-server/tests/suite/v2/plugin_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,6 @@ chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = true
"#
),
)
Expand Down Expand Up @@ -2057,7 +2056,6 @@ chatgpt_base_url = "{}/backend-api/"

[features]
plugins = true
remote_plugin = true
connectors = true
"#,
server.uri()
Expand Down
47 changes: 32 additions & 15 deletions codex-rs/app-server/tests/suite/v2/plugin_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ plugins = true
)
}

fn write_remote_plugins_disabled_config_with_base_url(
codex_home: &std::path::Path,
base_url: &str,
) -> std::io::Result<()> {
std::fs::write(
codex_home.join("config.toml"),
format!(
r#"chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = false
"#,
),
)
}

#[tokio::test]
async fn plugin_list_skips_invalid_marketplace_file_and_reports_error() -> Result<()> {
let codex_home = TempDir::new()?;
Expand Down Expand Up @@ -197,7 +214,6 @@ async fn plugin_installed_prefers_remote_curated_conflicts_when_remote_plugin_en

[features]
plugins = true
remote_plugin = true
plugin_sharing = false

[plugins."linear@openai-curated"]
Expand Down Expand Up @@ -1987,10 +2003,11 @@ async fn plugin_list_uses_cached_global_remote_catalog_and_refreshes_it() -> Res
}

#[tokio::test]
async fn plugin_list_includes_openai_curated_remote_collection_when_requested() -> Result<()> {
async fn plugin_list_includes_openai_curated_remote_collection_when_remote_plugin_disabled_and_requested()
-> Result<()> {
let codex_home = TempDir::new()?;
let server = MockServer::start().await;
write_plugins_enabled_config_with_base_url(
write_remote_plugins_disabled_config_with_base_url(
codex_home.path(),
&format!("{}/backend-api/", server.uri()),
)?;
Expand Down Expand Up @@ -2092,10 +2109,11 @@ async fn plugin_list_includes_openai_curated_remote_collection_when_requested()
}

#[tokio::test]
async fn plugin_list_propagates_explicit_openai_curated_remote_collection_errors() -> Result<()> {
async fn plugin_list_propagates_openai_curated_remote_collection_errors_when_remote_plugin_disabled()
-> Result<()> {
let codex_home = TempDir::new()?;
let server = MockServer::start().await;
write_plugins_enabled_config_with_base_url(
write_remote_plugins_disabled_config_with_base_url(
codex_home.path(),
&format!("{}/backend-api/", server.uri()),
)?;
Expand Down Expand Up @@ -2148,10 +2166,11 @@ async fn plugin_list_propagates_explicit_openai_curated_remote_collection_errors
}

#[tokio::test]
async fn plugin_list_skips_explicit_openai_curated_remote_collection_for_api_auth() -> Result<()> {
async fn plugin_list_skips_openai_curated_remote_collection_for_api_auth_when_remote_plugin_disabled()
-> Result<()> {
let codex_home = TempDir::new()?;
let server = MockServer::start().await;
write_plugins_enabled_config_with_base_url(
write_remote_plugins_disabled_config_with_base_url(
codex_home.path(),
&format!("{}/backend-api/", server.uri()),
)?;
Expand Down Expand Up @@ -2391,7 +2410,8 @@ async fn plugin_list_does_not_append_global_remote_when_marketplace_kinds_are_ex
}

#[tokio::test]
async fn plugin_installed_includes_remote_shared_with_me_plugins() -> Result<()> {
async fn plugin_installed_includes_remote_shared_with_me_plugins_when_remote_plugin_disabled()
-> Result<()> {
let codex_home = TempDir::new()?;
let server = MockServer::start().await;
std::fs::write(
Expand Down Expand Up @@ -2493,7 +2513,8 @@ plugin_sharing = true
}

#[tokio::test]
async fn plugin_installed_includes_workspace_directory_without_plugin_sharing() -> Result<()> {
async fn plugin_installed_includes_workspace_directory_without_plugin_sharing_when_remote_plugin_disabled()
-> Result<()> {
let codex_home = TempDir::new()?;
let server = MockServer::start().await;
std::fs::write(
Expand Down Expand Up @@ -2590,7 +2611,6 @@ async fn plugin_installed_includes_created_by_me_when_remote_plugins_enabled() -

[features]
plugins = true
remote_plugin = true
plugin_sharing = false
"#,
server.uri()
Expand Down Expand Up @@ -2681,7 +2701,6 @@ async fn plugin_installed_starts_remote_installed_bundle_sync() -> Result<()> {

[features]
plugins = true
remote_plugin = true
plugin_sharing = false
"#,
server.uri()
Expand Down Expand Up @@ -2750,10 +2769,10 @@ plugin_sharing = false
}

#[tokio::test]
async fn plugin_list_fetches_workspace_directory_kind_without_remote_plugin_flag() -> Result<()> {
async fn plugin_list_fetches_workspace_directory_kind_when_remote_plugin_disabled() -> Result<()> {
let codex_home = TempDir::new()?;
let server = MockServer::start().await;
write_plugins_enabled_config_with_base_url(
write_remote_plugins_disabled_config_with_base_url(
codex_home.path(),
&format!("{}/backend-api/", server.uri()),
)?;
Expand Down Expand Up @@ -2848,7 +2867,6 @@ async fn plugin_list_fetches_user_plugins_in_created_by_me_remote_marketplace()

[features]
plugins = true
remote_plugin = true
plugin_sharing = false
"#,
server.uri()
Expand Down Expand Up @@ -4032,7 +4050,6 @@ chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = true
"#
),
)
Expand Down
1 change: 0 additions & 1 deletion codex-rs/app-server/tests/suite/v2/plugin_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,6 @@ chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = true
"#
),
)
Expand Down
3 changes: 0 additions & 3 deletions codex-rs/app-server/tests/suite/v2/plugin_share.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ chatgpt_base_url = "{}/backend-api"

[features]
plugins = true
remote_plugin = true
plugin_sharing = false
"#,
server.uri()
Expand Down Expand Up @@ -1050,7 +1049,6 @@ chatgpt_base_url = "{}/backend-api"

[features]
plugins = true
remote_plugin = true
plugin_sharing = false
"#,
server.uri()
Expand Down Expand Up @@ -1204,7 +1202,6 @@ chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = true
"#
),
)
Expand Down
1 change: 0 additions & 1 deletion codex-rs/app-server/tests/suite/v2/plugin_uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = true
"#
),
)
Expand Down
4 changes: 1 addition & 3 deletions codex-rs/app-server/tests/suite/v2/recommended_plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ async fn first_turn_after_external_login_waits_for_recommended_plugins() -> Resu
let config = std::fs::read_to_string(&config_path)?;
std::fs::write(
config_path,
format!(
"{config}\n[features]\napps = true\nplugins = true\nremote_plugin = true\ntool_suggest = true\n"
),
format!("{config}\n[features]\napps = true\nplugins = true\ntool_suggest = true\n"),
)?;

let sqlite_home = codex_home.path().to_string_lossy();
Expand Down
33 changes: 14 additions & 19 deletions codex-rs/app-server/tests/suite/v2/skills_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ plugins = true
)
}

fn write_remote_plugins_enabled_config_with_base_url(
codex_home: &std::path::Path,
base_url: &str,
) -> std::io::Result<()> {
std::fs::write(
codex_home.join("config.toml"),
format!(
r#"chatgpt_base_url = "{base_url}"

[features]
plugins = true
remote_plugin = true
"#,
),
)
}

fn write_plugin_with_skill(
repo_root: &std::path::Path,
plugin_name: &str,
Expand Down Expand Up @@ -175,7 +158,7 @@ fn write_cached_local_curated_plugin_with_skill(codex_home: &std::path::Path) ->
}

#[tokio::test]
async fn runtime_remote_plugin_enablement_excludes_local_curated_plugin_skills() -> Result<()> {
async fn runtime_remote_plugin_toggle_updates_local_curated_plugin_skills() -> Result<()> {
let codex_home = TempDir::new()?;
let cwd = TempDir::new()?;
let server = MockServer::start().await;
Expand Down Expand Up @@ -206,6 +189,18 @@ enabled = true
let mut mcp = TestAppServer::new(codex_home.path()).await?;
timeout(DEFAULT_TIMEOUT, mcp.initialize()).await??;

let disablement_request_id = mcp
.send_experimental_feature_enablement_set_request(ExperimentalFeatureEnablementSetParams {
enablement: BTreeMap::from([("remote_plugin".to_string(), false)]),
})
.await?;
let disablement_response: JSONRPCResponse = timeout(
DEFAULT_TIMEOUT,
mcp.read_stream_until_response_message(RequestId::Integer(disablement_request_id)),
)
.await??;
let _: ExperimentalFeatureEnablementSetResponse = to_response(disablement_response)?;

let initial_skills_list_request_id = mcp
.send_skills_list_request(SkillsListParams {
cwds: vec![cwd.path().to_path_buf()],
Expand Down Expand Up @@ -266,7 +261,7 @@ async fn skills_list_loads_remote_installed_plugin_skills_from_cache() -> Result
let server = MockServer::start().await;
let expected_skill_path =
std::fs::canonicalize(write_cached_remote_plugin_with_skill(codex_home.path())?)?;
write_remote_plugins_enabled_config_with_base_url(
write_plugins_enabled_config_with_base_url(
codex_home.path(),
&format!("{}/backend-api/", server.uri()),
)?;
Expand Down
15 changes: 9 additions & 6 deletions codex-rs/core-plugins/src/discoverable_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ use wiremock::matchers::query_param;
#[tokio::test]
async fn returns_fallback_plugins_when_remote_disabled_for_codex_auth() {
let codex_home = tempdir().expect("tempdir should succeed");
write_file(
&codex_home.path().join(CONFIG_TOML_FILE),
r#"[features]
plugins = true
remote_plugin = false
"#,
);
let curated_root = curated_plugins_repo_path(codex_home.path());
write_openai_curated_marketplace(&curated_root, &["sample", "slack", "openai-developers"]);

Expand Down Expand Up @@ -69,8 +76,7 @@ async fn returns_api_curated_fallback_plugins_for_direct_provider_auth() {
let curated_root = curated_plugins_repo_path(codex_home.path());
write_openai_api_curated_marketplace(&curated_root, &["sample", "slack", "openai-developers"]);

let mut plugins = load_plugins_config(codex_home.path(), codex_home.path()).await;
plugins.remote_plugin_enabled = true;
let plugins = load_plugins_config(codex_home.path(), codex_home.path()).await;
let plugins_manager = PluginsManager::new(codex_home.path().to_path_buf());
plugins_manager.set_auth_mode(Some(AuthMode::ApiKey));
let auth = CodexAuth::from_api_key("test-api-key");
Expand Down Expand Up @@ -153,7 +159,6 @@ async fn omits_openai_curated_but_keeps_configured_marketplaces_for_remote_codex
&format!(
r#"[features]
plugins = true
remote_plugin = true

[marketplaces.{bundled_marketplace_name}]
source_type = "git"
Expand Down Expand Up @@ -188,8 +193,7 @@ async fn includes_openai_curated_when_remote_enabled_without_auth() {
let curated_root = curated_plugins_repo_path(codex_home.path());
write_openai_curated_marketplace(&curated_root, &["slack"]);

let mut plugins = load_plugins_config(codex_home.path(), codex_home.path()).await;
plugins.remote_plugin_enabled = true;
let plugins = load_plugins_config(codex_home.path(), codex_home.path()).await;
let plugins_manager = PluginsManager::new(codex_home.path().to_path_buf());
let discoverable_plugins = list_discoverable_plugins(
&plugins_manager,
Expand Down Expand Up @@ -788,7 +792,6 @@ async fn expands_cached_remote_plugins_by_loaded_apps() {
&codex_home.path().join(CONFIG_TOML_FILE),
r#"[features]
plugins = true
remote_plugin = true
"#,
);

Expand Down
Loading
Loading