conversation-session-r3-task-control.json 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-task-control",
  4. "spec": "./test/e2e/conversation-session/remote/execution/conversation-session-r3-task-control.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-task-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_TASK_CONTROL"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"r3-task-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"R3 task control\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "r3-task-slow-turn",
  31. "description": "保持真实运行窗口直到 Stop 中断,覆盖队列编辑、删除与恢复;不靠固定时长碰运气",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "controlled-stream",
  35. "source": "synthetic",
  36. "syntheticReason": "保持真实运行窗口直到 Stop 中断,覆盖队列编辑、删除与恢复;不靠固定时长碰运气"
  37. },
  38. "maxMatches": 4,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_R3_TASK_CONTROL_SLOW"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "statusMessage": "OK",
  48. "headers": {
  49. "cache-control": "no-cache",
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "chunks": [
  53. {
  54. "offsetMs": 0,
  55. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-task-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"
  56. },
  57. {
  58. "offsetMs": 250,
  59. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  60. },
  61. {
  62. "offsetMs": 500,
  63. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_TASK_STREAMING \"}}\n\n"
  64. },
  65. {
  66. "offsetMs": 45000,
  67. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  68. },
  69. {
  70. "offsetMs": 45100,
  71. "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"
  72. },
  73. {
  74. "offsetMs": 45200,
  75. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  76. }
  77. ],
  78. "text": {
  79. "id": "v4-queue-slow",
  80. "inputTokens": 80,
  81. "outputTokens": 4,
  82. "text": "V4_QUEUE_STREAMING"
  83. },
  84. "releaseAfterChunks": 3
  85. }
  86. },
  87. {
  88. "id": "r3-task-queued",
  89. "description": "排队项被消费后的普通回复",
  90. "metadata": {
  91. "kind": "main",
  92. "timingPolicy": "fast-text",
  93. "source": "synthetic",
  94. "syntheticReason": "队列消费按 FIFO"
  95. },
  96. "maxMatches": 8,
  97. "match": {
  98. "method": "POST",
  99. "pathIncludes": "/messages",
  100. "lastUserMessageIncludes": ["E2E_R3_TASK_CONTROL_Q"],
  101. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  102. },
  103. "response": {
  104. "statusCode": 200,
  105. "text": {
  106. "id": "r3-task-queued",
  107. "inputTokens": 64,
  108. "outputTokens": 8,
  109. "text": "R3_TASK_Q_REPLY"
  110. }
  111. }
  112. },
  113. {
  114. "id": "r3-task-permission-write",
  115. "description": "Write 工具触发远端权限请求",
  116. "metadata": {
  117. "kind": "main",
  118. "timingPolicy": "fast-text",
  119. "source": "synthetic",
  120. "syntheticReason": "权限阻塞必须由真实 blocking request 承载"
  121. },
  122. "maxMatches": 4,
  123. "match": {
  124. "method": "POST",
  125. "pathIncludes": "/messages",
  126. "lastUserMessageIncludes": ["E2E_R3_TASK_CONTROL_PERMISSION"],
  127. "bodyIncludes": ["E2E_R3_TASK_CONTROL_PERMISSION"],
  128. "bodyExcludes": [
  129. "Generate a concise title",
  130. "CRITICAL: Respond with TEXT ONLY",
  131. "toolu_r3_task_permission"
  132. ]
  133. },
  134. "response": {
  135. "statusCode": 200,
  136. "toolUse": {
  137. "id": "toolu_r3_task_permission",
  138. "name": "Write",
  139. "input": {
  140. "file_path": "/home/dev/r3-workspace-a/.zcode-e2e/r3-task-control/permission-output.txt",
  141. "content": "R3_TASK_PERMISSION_RESULT\n"
  142. }
  143. }
  144. }
  145. },
  146. {
  147. "id": "r3-task-permission-final",
  148. "description": "工具结果后的终态文本",
  149. "metadata": {
  150. "kind": "main",
  151. "timingPolicy": "fast-text",
  152. "source": "synthetic",
  153. "syntheticReason": "终态"
  154. },
  155. "maxMatches": 4,
  156. "match": {
  157. "method": "POST",
  158. "pathIncludes": "/messages",
  159. "bodyIncludes": ["E2E_R3_TASK_CONTROL_PERMISSION", "toolu_r3_task_permission"],
  160. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  161. },
  162. "response": {
  163. "statusCode": 200,
  164. "text": {
  165. "id": "r3-task-permission-final",
  166. "inputTokens": 64,
  167. "outputTokens": 8,
  168. "text": "R3_TASK_PERMISSION_DONE"
  169. }
  170. }
  171. },
  172. {
  173. "id": "r3-task-main-fallback",
  174. "description": "其它本 case 请求",
  175. "metadata": {
  176. "kind": "main",
  177. "timingPolicy": "fast-text",
  178. "source": "synthetic",
  179. "syntheticReason": "首发/续发普通回复"
  180. },
  181. "maxMatches": 10,
  182. "match": {
  183. "method": "POST",
  184. "pathIncludes": "/messages",
  185. "bodyIncludes": ["E2E_R3_TASK_CONTROL_"],
  186. "bodyExcludes": [
  187. "Generate a concise title",
  188. "CRITICAL: Respond with TEXT ONLY",
  189. "E2E_R3_TASK_CONTROL_SLOW",
  190. "E2E_R3_TASK_CONTROL_Q",
  191. "E2E_R3_TASK_CONTROL_PERMISSION"
  192. ]
  193. },
  194. "response": {
  195. "statusCode": 200,
  196. "text": {
  197. "id": "r3-task-main",
  198. "inputTokens": 64,
  199. "outputTokens": 8,
  200. "text": "R3_TASK_CONTROL_REPLY"
  201. }
  202. }
  203. }
  204. ]
  205. }