conversation-session-r3-server-update.json 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-server-update",
  4. "spec": "./test/e2e/conversation-session/remote/installation/conversation-session-r3-server-update.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-update-title",
  8. "description": "标题辅助响应",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于断言"
  14. },
  15. "maxMatches": 8,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": ["Generate a concise title", "E2E_R3_SERVER_UPDATE"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "text": {
  24. "id": "r3-update-title",
  25. "inputTokens": 64,
  26. "outputTokens": 8,
  27. "text": "{\"title\":\"R3 task control\"}"
  28. }
  29. }
  30. },
  31. {
  32. "id": "r3-update-slow-turn",
  33. "description": "保持远端任务运行直到更新守卫出现且用户取消;明确释放后才允许普通更新",
  34. "metadata": {
  35. "kind": "main",
  36. "timingPolicy": "controlled-stream",
  37. "source": "synthetic",
  38. "syntheticReason": "保持远端任务运行直到更新守卫出现且用户取消;明确释放后才允许普通更新"
  39. },
  40. "maxMatches": 4,
  41. "match": {
  42. "method": "POST",
  43. "pathIncludes": "/messages",
  44. "lastUserMessageIncludes": ["E2E_R3_SERVER_UPDATE_SLOW"],
  45. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "statusMessage": "OK",
  50. "headers": {
  51. "cache-control": "no-cache",
  52. "content-type": "text/event-stream; charset=utf-8"
  53. },
  54. "chunks": [
  55. {
  56. "offsetMs": 0,
  57. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-update-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  58. },
  59. {
  60. "offsetMs": 250,
  61. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  62. },
  63. {
  64. "offsetMs": 500,
  65. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_UPDATE_STREAMING \"}}\n\n"
  66. },
  67. {
  68. "offsetMs": 45000,
  69. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  70. },
  71. {
  72. "offsetMs": 45100,
  73. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  74. },
  75. {
  76. "offsetMs": 45200,
  77. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  78. }
  79. ],
  80. "text": {
  81. "id": "v4-queue-slow",
  82. "inputTokens": 80,
  83. "outputTokens": 4,
  84. "text": "V4_QUEUE_STREAMING"
  85. },
  86. "releaseAfterChunks": 3
  87. }
  88. },
  89. {
  90. "id": "r3-update-queued",
  91. "description": "排队项被消费后的普通回复",
  92. "metadata": {
  93. "kind": "main",
  94. "timingPolicy": "fast-text",
  95. "source": "synthetic",
  96. "syntheticReason": "队列消费按 FIFO"
  97. },
  98. "maxMatches": 8,
  99. "match": {
  100. "method": "POST",
  101. "pathIncludes": "/messages",
  102. "lastUserMessageIncludes": ["E2E_R3_SERVER_UPDATE_Q"],
  103. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  104. },
  105. "response": {
  106. "statusCode": 200,
  107. "text": {
  108. "id": "r3-update-queued",
  109. "inputTokens": 64,
  110. "outputTokens": 8,
  111. "text": "R3_UPDATE_Q_REPLY"
  112. }
  113. }
  114. },
  115. {
  116. "id": "r3-update-permission-write",
  117. "description": "Write 工具触发远端权限请求",
  118. "metadata": {
  119. "kind": "main",
  120. "timingPolicy": "fast-text",
  121. "source": "synthetic",
  122. "syntheticReason": "权限阻塞必须由真实 blocking request 承载"
  123. },
  124. "maxMatches": 4,
  125. "match": {
  126. "method": "POST",
  127. "pathIncludes": "/messages",
  128. "lastUserMessageIncludes": ["E2E_R3_SERVER_UPDATE_PERMISSION"],
  129. "bodyIncludes": ["E2E_R3_SERVER_UPDATE_PERMISSION"],
  130. "bodyExcludes": [
  131. "Generate a concise title",
  132. "CRITICAL: Respond with TEXT ONLY",
  133. "toolu_r3_task_permission"
  134. ]
  135. },
  136. "response": {
  137. "statusCode": 200,
  138. "toolUse": {
  139. "id": "toolu_r3_task_permission",
  140. "name": "Write",
  141. "input": {
  142. "file_path": "/home/dev/r3-workspace-a/.zcode-e2e/r3-server-update/permission-output.txt",
  143. "content": "R3_UPDATE_PERMISSION_RESULT\n"
  144. }
  145. }
  146. }
  147. },
  148. {
  149. "id": "r3-update-permission-final",
  150. "description": "工具结果后的终态文本",
  151. "metadata": {
  152. "kind": "main",
  153. "timingPolicy": "fast-text",
  154. "source": "synthetic",
  155. "syntheticReason": "终态"
  156. },
  157. "maxMatches": 4,
  158. "match": {
  159. "method": "POST",
  160. "pathIncludes": "/messages",
  161. "bodyIncludes": ["E2E_R3_SERVER_UPDATE_PERMISSION", "toolu_r3_task_permission"],
  162. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  163. },
  164. "response": {
  165. "statusCode": 200,
  166. "text": {
  167. "id": "r3-update-permission-final",
  168. "inputTokens": 64,
  169. "outputTokens": 8,
  170. "text": "R3_UPDATE_PERMISSION_DONE"
  171. }
  172. }
  173. },
  174. {
  175. "id": "r3-update-main-fallback",
  176. "description": "其它本 case 请求(续发历史可含 SLOW/Q/PERMISSION,只按最后一条用户消息排除)",
  177. "metadata": {
  178. "kind": "main",
  179. "timingPolicy": "fast-text",
  180. "source": "synthetic",
  181. "syntheticReason": "首发/续发普通回复"
  182. },
  183. "maxMatches": 10,
  184. "match": {
  185. "method": "POST",
  186. "pathIncludes": "/messages",
  187. "bodyIncludes": ["E2E_R3_SERVER_UPDATE_"],
  188. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  189. "lastUserMessageExcludes": [
  190. "E2E_R3_SERVER_UPDATE_SLOW",
  191. "E2E_R3_SERVER_UPDATE_Q",
  192. "E2E_R3_SERVER_UPDATE_PERMISSION"
  193. ]
  194. },
  195. "response": {
  196. "statusCode": 200,
  197. "text": {
  198. "id": "r3-update-main",
  199. "inputTokens": 64,
  200. "outputTokens": 8,
  201. "text": "R3_SERVER_UPDATE_REPLY"
  202. }
  203. }
  204. }
  205. ]
  206. }