conversation-session-config-and-multisession.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-config-and-multisession",
  4. "spec": "./test/e2e/conversation-session/runtime/conversation-session-config-and-multisession.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "title-e2e_multi_session_",
  8. "description": "Upstream e2e title generation 的固定辅助响应,避免标题生成请求误命中业务 case fixture。",
  9. "match": {
  10. "method": "POST",
  11. "pathIncludes": "/messages",
  12. "bodyIncludes": ["Generate a concise title", "E2E_MULTI_SESSION_"]
  13. },
  14. "response": {
  15. "statusCode": 200,
  16. "statusMessage": "OK",
  17. "headers": {
  18. "content-type": "application/json; charset=utf-8"
  19. },
  20. "body": "{\"id\":\"upstream-e2e-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream E2E Fixture\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  21. },
  22. "metadata": {
  23. "kind": "common",
  24. "source": "synthetic",
  25. "timingPolicy": "fast-text",
  26. "syntheticReason": "固定上游回复和流式时序以复现用例动作窗口;真实 Agent、工具执行、队列与 UI 不被替换。"
  27. }
  28. },
  29. {
  30. "id": "slow-e2e_multi_session_",
  31. "description": "会话区 queue/stop case 使用的慢速流式响应,给运行中操作留下稳定窗口。",
  32. "match": {
  33. "method": "POST",
  34. "pathIncludes": "/messages",
  35. "lastUserMessageIncludes": ["E2E_SLOW_STREAM", "E2E_MULTI_SESSION_"],
  36. "bodyIncludes": ["E2E_SLOW_STREAM"],
  37. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  38. },
  39. "response": {
  40. "statusCode": 200,
  41. "statusMessage": "OK",
  42. "headers": {
  43. "cache-control": "no-cache",
  44. "content-type": "text/event-stream; charset=utf-8"
  45. },
  46. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-slow-stream\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"up\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"stream\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  47. "events": [
  48. {
  49. "sequence": 0,
  50. "offsetMs": 0,
  51. "byteLength": 347,
  52. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-slow-stream\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  53. },
  54. {
  55. "sequence": 1,
  56. "offsetMs": 250,
  57. "byteLength": 117,
  58. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  59. },
  60. {
  61. "sequence": 2,
  62. "offsetMs": 8000,
  63. "byteLength": 117,
  64. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"up\"}}\n\n"
  65. },
  66. {
  67. "sequence": 3,
  68. "offsetMs": 16000,
  69. "byteLength": 121,
  70. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"stream\"}}\n\n"
  71. },
  72. {
  73. "sequence": 4,
  74. "offsetMs": 24000,
  75. "byteLength": 122,
  76. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  77. },
  78. {
  79. "sequence": 5,
  80. "offsetMs": 90000,
  81. "byteLength": 73,
  82. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  83. },
  84. {
  85. "sequence": 6,
  86. "offsetMs": 90100,
  87. "byteLength": 183,
  88. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  89. },
  90. {
  91. "sequence": 7,
  92. "offsetMs": 90200,
  93. "byteLength": 51,
  94. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  95. }
  96. ]
  97. },
  98. "metadata": {
  99. "kind": "main",
  100. "source": "synthetic",
  101. "timingPolicy": "controlled-stream",
  102. "syntheticReason": "固定上游回复和流式时序以复现用例动作窗口;真实 Agent、工具执行、队列与 UI 不被替换。"
  103. }
  104. }
  105. ]
  106. }