conversation-session-edit.json 15 KB

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