Files
codex/codex-rs/app-server/tests/suite/v2/plugin_search.rs
T
Greg Brisebois 64b2a3008e Declare the experimental plugin search API (#36402)
## What changed

- Add the experimental `plugin/search` request with search term, scope, working-directory, cursor, and limit parameters.
- Define paginated results that include each plugin's marketplace name and optional local marketplace path.
- Route the request through app server while returning method-not-found until the search implementation is available.

## Testing

- Add an app-server test that verifies `plugin/search` returns JSON-RPC error `-32601` with the expected not-implemented message.

GitOrigin-RevId: 755400468331f0887f7da7d933195c347aadf6d0
2026-07-31 23:08:55 +00:00

42 lines
1.2 KiB
Rust

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(())
}