File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
pkgs/dart_mcp_server/test/tools Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -260,33 +260,27 @@ void main() {
260260 ]);
261261 });
262262
263- test ('ignores unknown message types' , () async {
263+ test ('forwards all messages, even those with unknown types' , () async {
264264 final dtdClient = testHarness.fakeEditorExtension.dtd;
265265 final response = await dtdClient.call (
266266 McpServiceConstants .serviceName,
267267 McpServiceConstants .samplingRequest,
268268 params: {
269269 'messages' : [
270- {
271- 'role' : 'user' ,
272- 'content' : {'type' : 'unknown' , 'data' : 'Hi there!' },
273- },
274270 {
275271 'role' : 'user' ,
276272 'content' : {
277- 'type' : 'image' ,
278- 'data' : 'fake-data' ,
279- 'mimeType' : 'image/png' ,
273+ // Not of type text, image, audio, or resource.
274+ 'type' : 'unknown' ,
275+ 'text' : 'Hi there!' ,
276+ 'data' : 'Hi there!' ,
280277 },
281278 },
282279 ],
283280 'maxTokens' : 512 ,
284281 },
285282 );
286- expect (extractResponse (response), [
287- 'TOKENS: 512' ,
288- '[user] image/png' ,
289- ]);
283+ expect (extractResponse (response), ['TOKENS: 512' , 'UNKNOWN' ]);
290284 });
291285
292286 test ('throws for invalid requests' , () async {
You can’t perform that action at this time.
0 commit comments