use std::time::Duration; use anyhow::Result; use app_test_support::TestAppServer; use codex_app_server_protocol::JSONRPCError; use codex_app_server_protocol::PluginSearchParams; use codex_app_server_protocol::RequestId; use pretty_assertions::assert_eq; use tempfile::TempDir; use tokio::time::timeout; const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10); #[tokio::test] async fn plugin_search_returns_not_implemented() -> Result<()> { let codex_home = TempDir::new()?; let mut mcp = TestAppServer::builder() .with_codex_home(codex_home.path()) .without_auto_env() .build_initialized_with_timeout(DEFAULT_TIMEOUT) .await?; let request_id = mcp .send_plugin_search_request(PluginSearchParams { search_term: "linear".to_string(), scope: None, cwds: None, cursor: None, limit: None, }) .await?; let error: JSONRPCError = timeout( DEFAULT_TIMEOUT, mcp.read_stream_until_error_message(RequestId::Integer(request_id)), ) .await??; assert_eq!(error.error.code, -32601); assert_eq!(error.error.message, "plugin/search is not implemented"); Ok(()) }