Skip to content
Draft
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
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repository = "https://github.com/contextforge-org/contextforge-data-plane"
# Keep dependencies here only when at least two workspace members inherit them.
contextforge-data-plane-cpex = { path = "./crates/contextforge-data-plane-cpex" }
contextforge-data-plane-apis = { path = "./crates/contextforge-data-plane-apis"}
rmcp = { version = "3.2.0", default-features = false, features = [
rmcp = { version = "3.3.0", default-features = false, features = [
"server",
"client",
"transport-streamable-http-server",
Expand Down
45 changes: 45 additions & 0 deletions crates/contextforge-data-plane-lib/tests/gateway/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,51 @@ async fn post_hook_deny_drops_progress_notifications_without_failing_call() {
}

#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
#[ignore = "2026-07-28 protocol transition"]
async fn downstream_cancellation_is_relayed_to_backend() {
let gateway = start_gateway(TEST_USER_ID, true, Arc::new(CpexRuntimeRegistry::default())).await;
let service = gateway.connect(TEST_USER_ID).await;

let request = CallToolRequestParams::new("wait_for_cancellation");
let handle = service
.send_cancellable_request(
ClientRequest::CallToolRequest(Request::new(request)),
PeerRequestOptions::no_options(),
)
.await
.expect("wait_for_cancellation request is sent");
wait_for_event_count(&gateway.backend_state.calls, 1).await;

handle.cancel(Some("client gave up".to_owned())).await.expect("cancellation is sent");
wait_for_event_count(&gateway.backend_state.cancellations, 1).await;
}

#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn modern_downstream_cancellation_is_relayed_to_backend() {
let gateway = start_gateway(TEST_USER_ID, true, Arc::new(CpexRuntimeRegistry::default())).await;
let service = crate::harness::connect_modern_client(
gateway.gateway_url(),
crate::harness::create_client(TEST_USER_ID),
crate::harness::modern_client_info(),
)
.await;

let request = CallToolRequestParams::new("wait_for_cancellation");
let handle = service
.send_cancellable_request(
ClientRequest::CallToolRequest(Request::new(request)),
PeerRequestOptions::no_options(),
)
.await
.expect("wait_for_cancellation request is sent");
wait_for_event_count(&gateway.backend_state.calls, 1).await;

handle.cancel(Some("client gave up".to_owned())).await.expect("cancellation is sent");
wait_for_event_count(&gateway.backend_state.cancellations, 1).await;
}

#[tokio::test(flavor = "multi_thread", worker_threads = 1)]

async fn post_hook_can_return_raw_cmf_result_content() {
let plugin = Arc::new(TestPlugin::new("post", vec![cmf_hook_names::TOOL_POST_INVOKE]).with_raw_post_rewrite());
let runtime = runtime_with_post(plugin).await;
Expand Down