Use the API plugin marketplace for Amazon Bedrock (#34931)

## Why

Amazon Bedrock configurations can operate without Codex auth, so auth mode alone
cannot determine which curated plugin marketplace to expose.

## What changed

- Pass the resolved model provider into plugin configuration.
- Select `openai-api-curated` when the resolved provider is `amazon-bedrock`,
  while retaining API-key auth as a selection signal.
- Cover provider overrides and app-server plugin listing without an `auth.json`
  file.

GitOrigin-RevId: 972a22e19c41490d8b19d989da052302dc30e8f2
This commit is contained in:
felixxia-oai authored and copyberry committed 2026-07-23 11:32:47 +00:00
1 parent e497325a6a
commit 48ebbf5334
5 files changed
+121 -4

No files matched your search

@@ -108,6 +108,7 @@ fn plugins_config_input_with_requirements(
) -> PluginsConfigInput {
PluginsConfigInput::new(
config_layer_stack_with_requirements(codex_home, user_config, requirements),
String::new(),
/*plugins_enabled*/ true,
/*remote_plugin_enabled*/ false,
String::new(),
@@ -2625,6 +2626,7 @@ async fn plugin_cache_ignores_unrelated_session_overrides() {
let config = |session_config| {
PluginsConfigInput::new(
stack(session_config),
String::new(),
/*plugins_enabled*/ true,
/*remote_plugin_enabled*/ false,
"https://chatgpt.com".to_string(),
@@ -4410,6 +4412,52 @@ plugins = true
);
}
#[tokio::test]
async fn list_marketplaces_uses_resolved_provider_instead_of_configured_default() {
for (configured_provider, resolved_provider, expected_marketplace) in [
(
"openai",
AMAZON_BEDROCK_PROVIDER_ID,
OPENAI_API_CURATED_MARKETPLACE_NAME,
),
(
AMAZON_BEDROCK_PROVIDER_ID,
"openai",
OPENAI_CURATED_MARKETPLACE_NAME,
),
] {
let tmp = tempfile::tempdir().unwrap();
let curated_root = curated_plugins_repo_path(tmp.path());
write_file(
&tmp.path().join(CONFIG_TOML_FILE),
&format!(
r#"model_provider = "{configured_provider}"
[features]
plugins = true
"#
),
);
write_openai_curated_marketplace(&curated_root, &["chatgpt-plugin"]);
write_openai_api_curated_marketplace(&curated_root, &["api-plugin"]);
let mut config = load_config(tmp.path(), tmp.path()).await;
config.model_provider_id = resolved_provider.to_string();
let marketplaces = PluginsManager::new(tmp.path().to_path_buf())
.list_marketplaces_for_config(&config, &[], /*include_openai_curated*/ true)
.unwrap()
.marketplaces;
assert!(
marketplaces
.iter()
.any(|marketplace| marketplace.name == expected_marketplace),
"expected `{expected_marketplace}` for resolved provider `{resolved_provider}`"
);
}
}
#[tokio::test]
async fn list_marketplaces_skips_missing_api_curated_manifest() {
let tmp = tempfile::tempdir().unwrap();