//! AT-3.4-05: the client-visible smoke of both supported revisions. //! //! A representative client of each revision performs the whole flow a real MCP client performs — //! discovery, then a `tools/call` that asks for progress and reads the request's own stream to the //! terminal response — against the real endpoint. The harness of the suite lives in `super`. use super::*; #[tokio::test] async fn at_3_4_05_representative_client_smoke_of_both_revisions() { let fixture = fixture("lifecycle-client-smoke", HOLD_MS, 5_000).await; // Legacy client: initialize → tools/list → tools/call with progress. let session = initialize_session(&fixture.client, &fixture.mcp_url, &fixture.api_key).await; let tools = post_jsonrpc( &fixture.client, &fixture.mcp_url, &fixture.api_key, Some(&session), json!({ "jsonrpc": "2.0", "id": 700, "method": "tools/list", "params": {} }), ) .await; assert_eq!(tools["result"]["tools"][0]["name"], json!(TOOL)); let legacy_call = fixture .call_stream( Revision::Legacy, 701, fixture.call_params(Some(json!("tok-smoke-legacy")), Revision::Legacy), Some(&session), "req-smoke-legacy", ) .await; legacy_call.assert_stream(); assert_eq!( legacy_call.terminal()["result"]["structuredContent"], json!({ "id": "lead_123" }) ); // Modern client: `tools/list` and `tools/call` of the stateless revision, progress on the stream. let modern_list = post_jsonrpc_with_headers( &fixture.client, &fixture.mcp_url, &fixture.api_key, &[ ("MCP-Protocol-Version", MODERN), ("Mcp-Method", "tools/list"), ], json!({ "jsonrpc": "2.0", "id": 710, "method": "tools/list", "params": { "_meta": { META_PROTOCOL_VERSION: MODERN, META_CLIENT_CAPABILITIES: {}, META_CLIENT_INFO: { "name": "crank-3.4-smoke", "version": "0.1.0" }, }} }), ) .await; let modern_list = modern_list.json::().await.unwrap(); assert_eq!(modern_list["result"]["tools"][0]["name"], json!(TOOL)); let modern_call = fixture .call_stream( Revision::Modern, 711, fixture.call_params(Some(json!("tok-smoke-modern")), Revision::Modern), None, "req-smoke-modern", ) .await; modern_call.assert_stream(); assert!(!modern_call.progress_frames().is_empty()); assert_eq!( modern_call.terminal()["result"]["structuredContent"], json!({ "id": "lead_123" }) ); }