Skip to content

Commit 98b9792

Browse files
authored
build(deps): Preserve serde_json object order (#202)
1 parent f25d2b4 commit 98b9792

6 files changed

Lines changed: 92 additions & 91 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tokio-util = { version = "0.7", features = ["compat"] }
4343

4444
# Serialization
4545
serde = { version = "1.0", features = ["derive", "rc"] }
46-
serde_json = { version = "1", features = ["raw_value"] }
46+
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
4747
schemars = { version = "1.0", features = ["derive"] }
4848

4949
# UUID generation

src/agent-client-protocol-conductor/tests/trace_client_mcp_server.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -316,17 +316,17 @@ async fn test_trace_client_mcp_server() -> Result<(), agent_client_protocol::Err
316316
method: "_proxy/initialize",
317317
session: None,
318318
params: Object {
319+
"protocolVersion": Number(1),
319320
"clientCapabilities": Object {
320-
"auth": Object {
321-
"terminal": Bool(false),
322-
},
323321
"fs": Object {
324322
"readTextFile": Bool(false),
325323
"writeTextFile": Bool(false),
326324
},
327325
"terminal": Bool(false),
326+
"auth": Object {
327+
"terminal": Bool(false),
328+
},
328329
},
329-
"protocolVersion": Number(1),
330330
},
331331
},
332332
),
@@ -338,23 +338,23 @@ async fn test_trace_client_mcp_server() -> Result<(), agent_client_protocol::Err
338338
id: String("id:0"),
339339
is_error: false,
340340
payload: Object {
341+
"protocolVersion": Number(1),
341342
"agentCapabilities": Object {
342-
"auth": Object {},
343343
"loadSession": Bool(false),
344-
"mcpCapabilities": Object {
345-
"acp": Bool(true),
346-
"http": Bool(false),
347-
"sse": Bool(false),
348-
},
349344
"promptCapabilities": Object {
345+
"image": Bool(false),
350346
"audio": Bool(false),
351347
"embeddedContext": Bool(false),
352-
"image": Bool(false),
348+
},
349+
"mcpCapabilities": Object {
350+
"http": Bool(false),
351+
"sse": Bool(false),
352+
"acp": Bool(true),
353353
},
354354
"sessionCapabilities": Object {},
355+
"auth": Object {},
355356
},
356357
"authMethods": Array [],
357-
"protocolVersion": Number(1),
358358
},
359359
},
360360
),
@@ -371,10 +371,10 @@ async fn test_trace_client_mcp_server() -> Result<(), agent_client_protocol::Err
371371
"cwd": String("."),
372372
"mcpServers": Array [
373373
Object {
374-
"headers": Array [],
375-
"name": String("echo-server"),
376374
"type": String("http"),
375+
"name": String("echo-server"),
377376
"url": String("acp:url:0"),
377+
"headers": Array [],
378378
},
379379
],
380380
},
@@ -402,13 +402,13 @@ async fn test_trace_client_mcp_server() -> Result<(), agent_client_protocol::Err
402402
method: "session/prompt",
403403
session: None,
404404
params: Object {
405+
"sessionId": String("session:0"),
405406
"prompt": Array [
406407
Object {
407-
"text": String("{\"command\":\"call_tool\",\"server\":\"echo-server\",\"tool\":\"echo\",\"params\":{\"message\":\"Hello from client test!\"}}"),
408408
"type": String("text"),
409+
"text": String("{\"command\":\"call_tool\",\"server\":\"echo-server\",\"tool\":\"echo\",\"params\":{\"message\":\"Hello from client test!\"}}"),
409410
},
410411
],
411-
"sessionId": String("session:0"),
412412
},
413413
},
414414
),
@@ -423,11 +423,11 @@ async fn test_trace_client_mcp_server() -> Result<(), agent_client_protocol::Err
423423
params: Object {
424424
"sessionId": String("session:0"),
425425
"update": Object {
426+
"sessionUpdate": String("agent_message_chunk"),
426427
"content": Object {
427-
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"call_number\\\":1,\\\"echoed\\\":\\\"Client echoes: Hello from client test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"call_number\": Number(1), \"echoed\": String(\"Client echoes: Hello from client test!\")}), is_error: Some(false), meta: None }"),
428428
"type": String("text"),
429+
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"echoed\\\":\\\"Client echoes: Hello from client test!\\\",\\\"call_number\\\":1}\", meta: None }), annotations: None }], structured_content: Some(Object {\"echoed\": String(\"Client echoes: Hello from client test!\"), \"call_number\": Number(1)}), is_error: Some(false), meta: None }"),
429430
},
430-
"sessionUpdate": String("agent_message_chunk"),
431431
},
432432
},
433433
},

src/agent-client-protocol-conductor/tests/trace_mcp_tool_call.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,17 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
308308
method: "_proxy/initialize",
309309
session: None,
310310
params: Object {
311+
"protocolVersion": Number(1),
311312
"clientCapabilities": Object {
312-
"auth": Object {
313-
"terminal": Bool(false),
314-
},
315313
"fs": Object {
316314
"readTextFile": Bool(false),
317315
"writeTextFile": Bool(false),
318316
},
319317
"terminal": Bool(false),
318+
"auth": Object {
319+
"terminal": Bool(false),
320+
},
320321
},
321-
"protocolVersion": Number(1),
322322
},
323323
},
324324
),
@@ -332,17 +332,17 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
332332
method: "_proxy/initialize",
333333
session: None,
334334
params: Object {
335+
"protocolVersion": Number(1),
335336
"clientCapabilities": Object {
336-
"auth": Object {
337-
"terminal": Bool(false),
338-
},
339337
"fs": Object {
340338
"readTextFile": Bool(false),
341339
"writeTextFile": Bool(false),
342340
},
343341
"terminal": Bool(false),
342+
"auth": Object {
343+
"terminal": Bool(false),
344+
},
344345
},
345-
"protocolVersion": Number(1),
346346
},
347347
},
348348
),
@@ -354,23 +354,23 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
354354
id: String("id:1"),
355355
is_error: false,
356356
payload: Object {
357+
"protocolVersion": Number(1),
357358
"agentCapabilities": Object {
358-
"auth": Object {},
359359
"loadSession": Bool(false),
360-
"mcpCapabilities": Object {
361-
"acp": Bool(true),
362-
"http": Bool(false),
363-
"sse": Bool(false),
364-
},
365360
"promptCapabilities": Object {
361+
"image": Bool(false),
366362
"audio": Bool(false),
367363
"embeddedContext": Bool(false),
368-
"image": Bool(false),
364+
},
365+
"mcpCapabilities": Object {
366+
"http": Bool(false),
367+
"sse": Bool(false),
368+
"acp": Bool(true),
369369
},
370370
"sessionCapabilities": Object {},
371+
"auth": Object {},
371372
},
372373
"authMethods": Array [],
373-
"protocolVersion": Number(1),
374374
},
375375
},
376376
),
@@ -382,23 +382,23 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
382382
id: String("id:0"),
383383
is_error: false,
384384
payload: Object {
385+
"protocolVersion": Number(1),
385386
"agentCapabilities": Object {
386-
"auth": Object {},
387387
"loadSession": Bool(false),
388-
"mcpCapabilities": Object {
389-
"acp": Bool(true),
390-
"http": Bool(false),
391-
"sse": Bool(false),
392-
},
393388
"promptCapabilities": Object {
389+
"image": Bool(false),
394390
"audio": Bool(false),
395391
"embeddedContext": Bool(false),
396-
"image": Bool(false),
392+
},
393+
"mcpCapabilities": Object {
394+
"http": Bool(false),
395+
"sse": Bool(false),
396+
"acp": Bool(true),
397397
},
398398
"sessionCapabilities": Object {},
399+
"auth": Object {},
399400
},
400401
"authMethods": Array [],
401-
"protocolVersion": Number(1),
402402
},
403403
},
404404
),
@@ -430,10 +430,10 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
430430
"cwd": String("/"),
431431
"mcpServers": Array [
432432
Object {
433-
"headers": Array [],
434-
"name": String("test"),
435433
"type": String("http"),
434+
"name": String("test"),
436435
"url": String("acp:url:0"),
436+
"headers": Array [],
437437
},
438438
],
439439
},
@@ -499,13 +499,13 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
499499
method: "session/prompt",
500500
session: None,
501501
params: Object {
502+
"sessionId": String("session:0"),
502503
"prompt": Array [
503504
Object {
504-
"text": String("{\"command\":\"call_tool\",\"server\":\"test\",\"tool\":\"echo\",\"params\":{\"message\":\"Hello from trace test!\"}}"),
505505
"type": String("text"),
506+
"text": String("{\"command\":\"call_tool\",\"server\":\"test\",\"tool\":\"echo\",\"params\":{\"message\":\"Hello from trace test!\"}}"),
506507
},
507508
],
508-
"sessionId": String("session:0"),
509509
},
510510
},
511511
),
@@ -519,13 +519,13 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
519519
method: "session/prompt",
520520
session: None,
521521
params: Object {
522+
"sessionId": String("session:0"),
522523
"prompt": Array [
523524
Object {
524-
"text": String("{\"command\":\"call_tool\",\"server\":\"test\",\"tool\":\"echo\",\"params\":{\"message\":\"Hello from trace test!\"}}"),
525525
"type": String("text"),
526+
"text": String("{\"command\":\"call_tool\",\"server\":\"test\",\"tool\":\"echo\",\"params\":{\"message\":\"Hello from trace test!\"}}"),
526527
},
527528
],
528-
"sessionId": String("session:0"),
529529
},
530530
},
531531
),
@@ -539,12 +539,12 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
539539
method: "initialize",
540540
session: None,
541541
params: Object {
542+
"protocolVersion": String("2025-11-25"),
542543
"capabilities": Object {},
543544
"clientInfo": Object {
544545
"name": String("rmcp"),
545546
"version": String("1.7.0"),
546547
},
547-
"protocolVersion": String("2025-11-25"),
548548
},
549549
},
550550
),
@@ -556,15 +556,15 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
556556
id: String("id:7"),
557557
is_error: false,
558558
payload: Object {
559+
"protocolVersion": String("2025-11-25"),
559560
"capabilities": Object {
560561
"tools": Object {},
561562
},
562-
"instructions": String("A simple test MCP server with an echo tool"),
563-
"protocolVersion": String("2025-11-25"),
564563
"serverInfo": Object {
565564
"name": String("rmcp"),
566565
"version": String("1.7.0"),
567566
},
567+
"instructions": String("A simple test MCP server with an echo tool"),
568568
},
569569
},
570570
),
@@ -592,10 +592,10 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
592592
"_meta": Object {
593593
"progressToken": Number(0),
594594
},
595+
"name": String("echo"),
595596
"arguments": Object {
596597
"message": String("Hello from trace test!"),
597598
},
598-
"name": String("echo"),
599599
},
600600
},
601601
),
@@ -609,14 +609,14 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
609609
payload: Object {
610610
"content": Array [
611611
Object {
612-
"text": String("{\"result\":\"Echo: Hello from trace test!\"}"),
613612
"type": String("text"),
613+
"text": String("{\"result\":\"Echo: Hello from trace test!\"}"),
614614
},
615615
],
616-
"isError": Bool(false),
617616
"structuredContent": Object {
618617
"result": String("Echo: Hello from trace test!"),
619618
},
619+
"isError": Bool(false),
620620
},
621621
},
622622
),
@@ -631,11 +631,11 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
631631
params: Object {
632632
"sessionId": String("session:0"),
633633
"update": Object {
634+
"sessionUpdate": String("agent_message_chunk"),
634635
"content": Object {
635-
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
636636
"type": String("text"),
637+
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
637638
},
638-
"sessionUpdate": String("agent_message_chunk"),
639639
},
640640
},
641641
},
@@ -663,11 +663,11 @@ async fn test_trace_mcp_tool_call() -> Result<(), agent_client_protocol::Error>
663663
params: Object {
664664
"sessionId": String("session:0"),
665665
"update": Object {
666+
"sessionUpdate": String("agent_message_chunk"),
666667
"content": Object {
667-
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
668668
"type": String("text"),
669+
"text": String("OK: CallToolResult { content: [Annotated { raw: Text(RawTextContent { text: \"{\\\"result\\\":\\\"Echo: Hello from trace test!\\\"}\", meta: None }), annotations: None }], structured_content: Some(Object {\"result\": String(\"Echo: Hello from trace test!\")}), is_error: Some(false), meta: None }"),
669670
},
670-
"sessionUpdate": String("agent_message_chunk"),
671671
},
672672
},
673673
},

0 commit comments

Comments
 (0)