mirror of
https://github.com/openai/codex.git
synced 2026-11-19 23:05:23 +00:00
1 parent
7e7b35b4d2
commit
81d9cde9cb
1 file changed
+48
-2
+48
-2
@@ -6351,7 +6351,7 @@ async fn fetch_plugins_list(
|
|||||||
) -> Result<PluginListResponse> {
|
) -> Result<PluginListResponse> {
|
||||||
let cwd = AbsolutePathBuf::try_from(cwd).wrap_err("plugin list cwd must be absolute")?;
|
let cwd = AbsolutePathBuf::try_from(cwd).wrap_err("plugin list cwd must be absolute")?;
|
||||||
let request_id = RequestId::String(format!("plugin-list-{}", Uuid::new_v4()));
|
let request_id = RequestId::String(format!("plugin-list-{}", Uuid::new_v4()));
|
||||||
request_handle
|
let mut response = request_handle
|
||||||
.request_typed(ClientRequest::PluginList {
|
.request_typed(ClientRequest::PluginList {
|
||||||
request_id,
|
request_id,
|
||||||
params: PluginListParams {
|
params: PluginListParams {
|
||||||
@@ -6360,7 +6360,17 @@ async fn fetch_plugins_list(
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.wrap_err("plugin/list failed in TUI")
|
.wrap_err("plugin/list failed in TUI")?;
|
||||||
|
hide_cli_only_plugin_marketplaces(&mut response);
|
||||||
|
Ok(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
const CLI_HIDDEN_PLUGIN_MARKETPLACES: &[&str] = &["openai-bundled"];
|
||||||
|
|
||||||
|
fn hide_cli_only_plugin_marketplaces(response: &mut PluginListResponse) {
|
||||||
|
response
|
||||||
|
.marketplaces
|
||||||
|
.retain(|marketplace| !CLI_HIDDEN_PLUGIN_MARKETPLACES.contains(&marketplace.name.as_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn fetch_plugin_detail(
|
async fn fetch_plugin_detail(
|
||||||
@@ -6538,6 +6548,7 @@ mod tests {
|
|||||||
use codex_app_server_protocol::NetworkPolicyRuleAction as AppServerNetworkPolicyRuleAction;
|
use codex_app_server_protocol::NetworkPolicyRuleAction as AppServerNetworkPolicyRuleAction;
|
||||||
use codex_app_server_protocol::NonSteerableTurnKind as AppServerNonSteerableTurnKind;
|
use codex_app_server_protocol::NonSteerableTurnKind as AppServerNonSteerableTurnKind;
|
||||||
use codex_app_server_protocol::PermissionsRequestApprovalParams;
|
use codex_app_server_protocol::PermissionsRequestApprovalParams;
|
||||||
|
use codex_app_server_protocol::PluginMarketplaceEntry;
|
||||||
use codex_app_server_protocol::RequestId as AppServerRequestId;
|
use codex_app_server_protocol::RequestId as AppServerRequestId;
|
||||||
use codex_app_server_protocol::ServerNotification;
|
use codex_app_server_protocol::ServerNotification;
|
||||||
use codex_app_server_protocol::ServerRequest;
|
use codex_app_server_protocol::ServerRequest;
|
||||||
@@ -6596,6 +6607,41 @@ mod tests {
|
|||||||
AbsolutePathBuf::try_from(PathBuf::from(path)).expect("absolute test path")
|
AbsolutePathBuf::try_from(PathBuf::from(path)).expect("absolute test path")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn hide_cli_only_plugin_marketplaces_removes_openai_bundled() {
|
||||||
|
let mut response = PluginListResponse {
|
||||||
|
marketplaces: vec![
|
||||||
|
PluginMarketplaceEntry {
|
||||||
|
name: "openai-bundled".to_string(),
|
||||||
|
path: test_absolute_path("/marketplaces/openai-bundled"),
|
||||||
|
interface: None,
|
||||||
|
plugins: Vec::new(),
|
||||||
|
},
|
||||||
|
PluginMarketplaceEntry {
|
||||||
|
name: "openai-curated".to_string(),
|
||||||
|
path: test_absolute_path("/marketplaces/openai-curated"),
|
||||||
|
interface: None,
|
||||||
|
plugins: Vec::new(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
marketplace_load_errors: Vec::new(),
|
||||||
|
remote_sync_error: None,
|
||||||
|
featured_plugin_ids: Vec::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
hide_cli_only_plugin_marketplaces(&mut response);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
response.marketplaces,
|
||||||
|
vec![PluginMarketplaceEntry {
|
||||||
|
name: "openai-curated".to_string(),
|
||||||
|
path: test_absolute_path("/marketplaces/openai-curated"),
|
||||||
|
interface: None,
|
||||||
|
plugins: Vec::new(),
|
||||||
|
}]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn normalize_harness_overrides_resolves_relative_add_dirs() -> Result<()> {
|
fn normalize_harness_overrides_resolves_relative_add_dirs() -> Result<()> {
|
||||||
let temp_dir = tempdir()?;
|
let temp_dir = tempdir()?;
|
||||||
|
|||||||
Reference in new issue
Block a user