conversation-session-side-slash-arguments.json 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-side-slash-arguments",
  4. "spec": "./test/e2e/conversation-session/branching/conversation-session-side-slash-arguments.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "side-slash-arguments-title",
  8. "description": "所有 slash argument child 的标题 sidecar 固定返回,避免标题请求抢占主消息 fixture。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是 slash argument 语义;按统一 E2E marker 返回固定标题,隔离 replay 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_SLASH_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"side-slash-arguments-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Slash arguments E2E\\\"}\"}],\"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\"}}"
  26. }
  27. },
  28. {
  29. "id": "side-slash-arguments-parent-running",
  30. "description": "父任务 running 窗口:首 delta 很快到达,完流延迟到 60 秒,允许在父 turn 期间提交 /btw 参数。",
  31. "metadata": {
  32. "kind": "main",
  33. "timingPolicy": "controlled-stream",
  34. "source": "synthetic",
  35. "syntheticReason": "running 组合需要稳定的父 active turn;真实 provider 完流时间不可控。"
  36. },
  37. "maxMatches": 1,
  38. "match": {
  39. "method": "POST",
  40. "pathIncludes": "/messages",
  41. "lastUserMessageIncludes": ["E2E_SLASH_PARENT_RUNNING"],
  42. "bodyIncludes": ["E2E_SLASH_PARENT_RUNNING"],
  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. "events": [
  53. {
  54. "sequence": 0,
  55. "offsetMs": 0,
  56. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"side-slash-arguments-parent-running\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":96,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  57. },
  58. {
  59. "sequence": 1,
  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. "sequence": 2,
  65. "offsetMs": 700,
  66. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_SLASH_PARENT_RUNNING_STREAMING\"}}\n\n"
  67. },
  68. {
  69. "sequence": 3,
  70. "offsetMs": 60000,
  71. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" done\"}}\n\n"
  72. },
  73. {
  74. "sequence": 4,
  75. "offsetMs": 60100,
  76. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  77. },
  78. {
  79. "sequence": 5,
  80. "offsetMs": 60200,
  81. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":96,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  82. },
  83. {
  84. "sequence": 6,
  85. "offsetMs": 60300,
  86. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  87. }
  88. ]
  89. }
  90. },
  91. {
  92. "id": "side-slash-arguments-parent-seed",
  93. "description": "父会话首发 seed 的固定快速文本响应。",
  94. "metadata": {
  95. "kind": "main",
  96. "timingPolicy": "fast-text",
  97. "source": "synthetic",
  98. "syntheticReason": "父会话只需稳定建立 session,不依赖真实 provider 生成。"
  99. },
  100. "match": {
  101. "method": "POST",
  102. "pathIncludes": "/messages",
  103. "lastUserMessageIncludes": ["E2E_SLASH_PARENT_SEED"],
  104. "bodyIncludes": ["E2E_SLASH_PARENT_SEED"],
  105. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  106. },
  107. "response": {
  108. "statusCode": 200,
  109. "text": {
  110. "id": "side-slash-arguments-parent-seed",
  111. "inputTokens": 128,
  112. "outputTokens": 12,
  113. "text": "upstream-e2e-ok"
  114. }
  115. }
  116. },
  117. {
  118. "id": "side-slash-arguments-side-idle",
  119. "description": "idle /side firstInput 的固定快速文本响应。",
  120. "metadata": {
  121. "kind": "main",
  122. "timingPolicy": "fast-text",
  123. "source": "synthetic",
  124. "syntheticReason": "idle alias 断言只需稳定的 child 文本响应。"
  125. },
  126. "match": {
  127. "method": "POST",
  128. "pathIncludes": "/messages",
  129. "lastUserMessageIncludes": ["E2E_SLASH_SIDE_IDLE"],
  130. "bodyIncludes": ["E2E_SLASH_SIDE_IDLE"],
  131. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  132. },
  133. "response": {
  134. "statusCode": 200,
  135. "text": {
  136. "id": "side-slash-arguments-side-idle",
  137. "inputTokens": 128,
  138. "outputTokens": 12,
  139. "text": "upstream-e2e-ok"
  140. }
  141. }
  142. },
  143. {
  144. "id": "side-slash-arguments-btw-multiline",
  145. "description": "带外层空白和内部换行的 /btw firstInput 固定响应。",
  146. "metadata": {
  147. "kind": "main",
  148. "timingPolicy": "fast-text",
  149. "source": "synthetic",
  150. "syntheticReason": "验证 parser trim 边界与多行参数保留。"
  151. },
  152. "match": {
  153. "method": "POST",
  154. "pathIncludes": "/messages",
  155. "lastUserMessageIncludes": ["E2E_SLASH_BTW_MULTILINE"],
  156. "bodyIncludes": ["E2E_SLASH_BTW_MULTILINE"],
  157. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  158. },
  159. "response": {
  160. "statusCode": 200,
  161. "text": {
  162. "id": "side-slash-arguments-btw-multiline",
  163. "inputTokens": 128,
  164. "outputTokens": 12,
  165. "text": "upstream-e2e-ok"
  166. }
  167. }
  168. },
  169. {
  170. "id": "side-slash-arguments-second-side",
  171. "description": "连续提交组合中的 /side child 响应。",
  172. "metadata": {
  173. "kind": "main",
  174. "timingPolicy": "fast-text",
  175. "source": "synthetic",
  176. "syntheticReason": "连续 child 创建只需稳定响应,验证不复用 child。"
  177. },
  178. "match": {
  179. "method": "POST",
  180. "pathIncludes": "/messages",
  181. "lastUserMessageIncludes": ["E2E_SLASH_SECOND_SIDE"],
  182. "bodyIncludes": ["E2E_SLASH_SECOND_SIDE"],
  183. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  184. },
  185. "response": {
  186. "statusCode": 200,
  187. "text": {
  188. "id": "side-slash-arguments-second-side",
  189. "inputTokens": 128,
  190. "outputTokens": 12,
  191. "text": "upstream-e2e-ok"
  192. }
  193. }
  194. },
  195. {
  196. "id": "side-slash-arguments-second-btw",
  197. "description": "连续提交组合中的 /btw child 响应。",
  198. "metadata": {
  199. "kind": "main",
  200. "timingPolicy": "fast-text",
  201. "source": "synthetic",
  202. "syntheticReason": "连续 child 创建只需稳定响应,验证不复用 child。"
  203. },
  204. "match": {
  205. "method": "POST",
  206. "pathIncludes": "/messages",
  207. "lastUserMessageIncludes": ["E2E_SLASH_SECOND_BTW"],
  208. "bodyIncludes": ["E2E_SLASH_SECOND_BTW"],
  209. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  210. },
  211. "response": {
  212. "statusCode": 200,
  213. "text": {
  214. "id": "side-slash-arguments-second-btw",
  215. "inputTokens": 128,
  216. "outputTokens": 12,
  217. "text": "upstream-e2e-ok"
  218. }
  219. }
  220. },
  221. {
  222. "id": "side-slash-arguments-running-child",
  223. "description": "父任务 running 时 /btw child 的固定快速响应。",
  224. "metadata": {
  225. "kind": "main",
  226. "timingPolicy": "fast-text",
  227. "source": "synthetic",
  228. "syntheticReason": "child startNow 断言需要在父 controlled stream 期间快速完成。"
  229. },
  230. "match": {
  231. "method": "POST",
  232. "pathIncludes": "/messages",
  233. "lastUserMessageIncludes": ["E2E_SLASH_RUNNING_CHILD"],
  234. "bodyIncludes": ["E2E_SLASH_RUNNING_CHILD"],
  235. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  236. },
  237. "response": {
  238. "statusCode": 200,
  239. "text": {
  240. "id": "side-slash-arguments-running-child",
  241. "inputTokens": 128,
  242. "outputTokens": 12,
  243. "text": "upstream-e2e-ok"
  244. }
  245. }
  246. }
  247. ]
  248. }