conversation-session-edit.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-edit",
  4. "spec": "./test/e2e/conversation-session/editing/conversation-session-edit.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-conversation-edit-title-generic",
  8. "description": "Edit case 内的标题生成固定响应,避免严格 case-local replay 继续依赖 legacy provider-basic。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于 edit 产品语义,只需要稳定返回,防止标题请求误命中业务 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-edit-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Edit 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\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-conversation-edit-original-final",
  31. "description": "Edit case 首轮普通 user query 的固定最终回复。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "首轮只用于构造可编辑 completed 历史,真实 provider 回复内容不影响 edit 产品语义。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_EDIT_ORIGINAL"],
  43. "bodyIncludes": ["E2E_EDIT_ORIGINAL", "upstream-e2e-ok"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "statusMessage": "OK",
  49. "text": {
  50. "id": "upstream-e2e-edit-original-final",
  51. "inputTokens": 120,
  52. "outputTokens": 12,
  53. "text": "upstream-e2e-ok"
  54. }
  55. }
  56. },
  57. {
  58. "id": "upstream-conversation-readonly-edit-final",
  59. "description": "Edit rerun case 的 Read tool_result 后最终回复。",
  60. "metadata": {
  61. "kind": "main",
  62. "timingPolicy": "fast-text",
  63. "source": "synthetic",
  64. "syntheticReason": "该响应稳定完成 edit 后的只读工具历史,用于断言旧 user query 被替换。"
  65. },
  66. "maxMatches": 1,
  67. "match": {
  68. "method": "POST",
  69. "pathIncludes": "/messages",
  70. "bodyIncludes": ["E2E_EDIT_RERUN", "E2E_READONLY_TOOL_FILE_CONTENT"],
  71. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "statusMessage": "OK",
  76. "text": {
  77. "id": "upstream-e2e-conversation-readonly-edit-final",
  78. "inputTokens": 190,
  79. "outputTokens": 12,
  80. "text": "upstream-e2e-ok"
  81. }
  82. }
  83. },
  84. {
  85. "id": "upstream-conversation-edit-held-running-controlled-stream",
  86. "description": "Held queue 场景中被 stop 的原 active turn,使用 case-local 可控慢流制造 running 窗口。",
  87. "metadata": {
  88. "kind": "main",
  89. "timingPolicy": "controlled-stream",
  90. "source": "synthetic",
  91. "syntheticReason": "真实 provider 可能过快完成;旧 legacy slow stream 90.2s 贴近测试 90s 等待边界,会把时序抖动误报成产品 bug。"
  92. },
  93. "maxMatches": 1,
  94. "match": {
  95. "method": "POST",
  96. "pathIncludes": "/messages",
  97. "lastUserMessageIncludes": ["E2E_EDIT_HELD_RUNNING"],
  98. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_EDIT_HELD_RUNNING"],
  99. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  100. },
  101. "response": {
  102. "statusCode": 200,
  103. "statusMessage": "OK",
  104. "text": {
  105. "id": "upstream-e2e-edit-held-running-controlled-stream",
  106. "inputTokens": 120,
  107. "outputTokens": 12,
  108. "text": "upstream-e2e-ok"
  109. },
  110. "chunks": [
  111. {
  112. "offsetMs": 0,
  113. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-edit-held-running-controlled-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"
  114. },
  115. {
  116. "offsetMs": 250,
  117. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  118. },
  119. {
  120. "offsetMs": 3000,
  121. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  122. },
  123. {
  124. "offsetMs": 6000,
  125. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  126. },
  127. {
  128. "offsetMs": 9000,
  129. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  130. },
  131. {
  132. "offsetMs": 30000,
  133. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  134. },
  135. {
  136. "offsetMs": 30100,
  137. "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"
  138. },
  139. {
  140. "offsetMs": 30200,
  141. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  142. }
  143. ]
  144. }
  145. },
  146. {
  147. "id": "upstream-conversation-edit-held-rerun-controlled-stream",
  148. "description": "Held queue 存在时 edit 重跑的可控慢流,稳定覆盖 running 中继续入队和 compact guard。",
  149. "metadata": {
  150. "kind": "main",
  151. "timingPolicy": "controlled-stream",
  152. "source": "synthetic",
  153. "syntheticReason": "该 case 需要 edit 重跑保持 streaming 以验证 held queue、普通 queue、goal queue 和重复 compact guard;使用 30s case-local 流避免 legacy 90.2s 边界超时。"
  154. },
  155. "maxMatches": 1,
  156. "match": {
  157. "method": "POST",
  158. "pathIncludes": "/messages",
  159. "lastUserMessageIncludes": ["E2E_EDIT_HELD_RERUN"],
  160. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_EDIT_HELD_RERUN"],
  161. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  162. },
  163. "response": {
  164. "statusCode": 200,
  165. "statusMessage": "OK",
  166. "text": {
  167. "id": "upstream-e2e-edit-held-rerun-controlled-stream",
  168. "inputTokens": 120,
  169. "outputTokens": 12,
  170. "text": "upstream-e2e-ok"
  171. },
  172. "chunks": [
  173. {
  174. "offsetMs": 0,
  175. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-edit-held-rerun-controlled-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"
  176. },
  177. {
  178. "offsetMs": 250,
  179. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  180. },
  181. {
  182. "offsetMs": 3000,
  183. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  184. },
  185. {
  186. "offsetMs": 6000,
  187. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  188. },
  189. {
  190. "offsetMs": 9000,
  191. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  192. },
  193. {
  194. "offsetMs": 30000,
  195. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  196. },
  197. {
  198. "offsetMs": 30100,
  199. "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"
  200. },
  201. {
  202. "offsetMs": 30200,
  203. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  204. }
  205. ]
  206. }
  207. },
  208. {
  209. "id": "upstream-conversation-edit-manual-compact-success",
  210. "description": "Held queue 下手动 /compact 成功的 case-local 响应。",
  211. "metadata": {
  212. "kind": "main",
  213. "timingPolicy": "fast-text",
  214. "source": "synthetic",
  215. "syntheticReason": "该响应只用于证明 compact marker 完成且 queue 保留,不依赖真实 summary 内容。"
  216. },
  217. "maxMatches": 1,
  218. "match": {
  219. "method": "POST",
  220. "pathIncludes": "/messages",
  221. "bodyIncludes": [
  222. "CRITICAL: Respond with TEXT ONLY",
  223. "Do NOT call any tools",
  224. "E2E_EDIT_HELD_RERUN",
  225. "\"stream\":true"
  226. ],
  227. "bodyExcludes": ["E2E_AUTO_COMPACT", "E2E_AUTO_ACTIONS"]
  228. },
  229. "response": {
  230. "statusCode": 200,
  231. "statusMessage": "OK",
  232. "delayMs": 650,
  233. "text": {
  234. "id": "upstream-e2e-edit-manual-compact-success",
  235. "inputTokens": 256,
  236. "outputTokens": 64,
  237. "text": "<analysis>Edit held queue replay summarized the rerun turn without tools.</analysis>\n\n<summary>Conversation so far includes E2E_EDIT_HELD_RERUN and queued follow-up inputs; compact should complete while preserving held queue items.</summary>"
  238. }
  239. }
  240. },
  241. {
  242. "id": "upstream-conversation-edit-interrupted-source-controlled-stream",
  243. "description": "Interrupted edit resubmit 的源回答慢流,首个 delta 后由测试 stop。",
  244. "metadata": {
  245. "kind": "main",
  246. "timingPolicy": "controlled-stream",
  247. "source": "synthetic",
  248. "syntheticReason": "D10 需要稳定制造已出现首个 assistant delta 但仍可 stop 的窗口;短 source 只保留 interrupted 语义,避免回放尾部拖慢该 case。"
  249. },
  250. "maxMatches": 1,
  251. "match": {
  252. "method": "POST",
  253. "pathIncludes": "/messages",
  254. "lastUserMessageIncludes": ["E2E_EDIT_INTERRUPTED_RESUBMIT_SOURCE"],
  255. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_EDIT_INTERRUPTED_RESUBMIT_SOURCE"],
  256. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  257. },
  258. "response": {
  259. "statusCode": 200,
  260. "statusMessage": "OK",
  261. "text": {
  262. "id": "upstream-e2e-edit-interrupted-source-controlled-stream",
  263. "inputTokens": 120,
  264. "outputTokens": 12,
  265. "text": "upstream-e2e-ok"
  266. },
  267. "chunks": [
  268. {
  269. "offsetMs": 0,
  270. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-edit-interrupted-source-controlled-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"
  271. },
  272. {
  273. "offsetMs": 250,
  274. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  275. },
  276. {
  277. "offsetMs": 3000,
  278. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  279. },
  280. {
  281. "offsetMs": 5000,
  282. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  283. },
  284. {
  285. "offsetMs": 6000,
  286. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  287. },
  288. {
  289. "offsetMs": 7000,
  290. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  291. },
  292. {
  293. "offsetMs": 7100,
  294. "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"
  295. },
  296. {
  297. "offsetMs": 7200,
  298. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  299. }
  300. ]
  301. }
  302. },
  303. {
  304. "id": "upstream-conversation-edit-interrupted-rerun-final",
  305. "description": "中断首轮回答后 edit user query 的默认回放,返回区别于原始回答的固定 token。",
  306. "metadata": {
  307. "kind": "main",
  308. "timingPolicy": "fast-text",
  309. "source": "synthetic",
  310. "syntheticReason": "该响应只用于区分 edit 后 rerun 是否真的执行;source interrupted 窗口仍由 legacy slow-stream fixture 构造。"
  311. },
  312. "maxMatches": 1,
  313. "match": {
  314. "method": "POST",
  315. "pathIncludes": "/messages",
  316. "bodyIncludes": ["E2E_EDIT_INTERRUPTED_RESUBMIT_RERUN_", "upstream-e2e-edit-rerun-ok"],
  317. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  318. },
  319. "response": {
  320. "statusCode": 200,
  321. "statusMessage": "OK",
  322. "text": {
  323. "id": "upstream-e2e-edit-interrupted-rerun-final",
  324. "inputTokens": 160,
  325. "outputTokens": 16,
  326. "text": "upstream-e2e-edit-rerun-ok"
  327. }
  328. }
  329. }
  330. ]
  331. }