From d695046ffaf8e6dccf5f814ec1f0a0ba18b92a8c Mon Sep 17 00:00:00 2001 From: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Date: Wed, 13 May 2026 09:22:58 -0400 Subject: [PATCH] fix: enable task support on counter long_task example (#838) * fix: enable task support on counter long_task example * ci: include example targets when testing example crates --- .github/workflows/ci.yml | 2 +- examples/servers/src/common/counter.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25c1c31..5824bd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,7 +259,7 @@ jobs: if [ -f "$dir/Cargo.toml" ]; then if [[ "$dir" != *"wasi"* ]]; then echo "Testing $dir" - cargo test --manifest-path "$dir/Cargo.toml" --all-features + cargo test --manifest-path "$dir/Cargo.toml" --all-features --all-targets fi fi done diff --git a/examples/servers/src/common/counter.rs b/examples/servers/src/common/counter.rs index 91b4a7b..ccd17bc 100644 --- a/examples/servers/src/common/counter.rs +++ b/examples/servers/src/common/counter.rs @@ -103,7 +103,10 @@ impl Counter { )])) } - #[tool(description = "Long running task example")] + #[tool( + description = "Long running task example", + execution(task_support = "optional") + )] async fn long_task(&self) -> Result { tokio::time::sleep(std::time::Duration::from_secs(10)).await; Ok(CallToolResult::success(vec![Content::text( @@ -360,7 +363,7 @@ mod tests { "source".into(), serde_json::Value::String("integration-test".into()), ); - let params = CallToolRequestParams::new("long_task").with_task(Some(task_meta)); + let params = CallToolRequestParams::new("long_task").with_task(task_meta); let response = client_service .send_request(ClientRequest::CallToolRequest(Request::new(params.clone()))) .await?;