conversation-session-v4-rewind-queue-background.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-rewind-queue-background",
  4. "spec": "./test/e2e/conversation-session/conversation-session-v4-rewind-queue-background.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "pv4-20-title",
  8. "description": "PV4-20 held queue case-local 标题。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不参与 queue 守恒。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_PV4_20_ORIGINAL"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "pv4-20-title",
  24. "inputTokens": 48,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"PV4 20 Queue Rewind\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "pv4-20-original",
  32. "description": "PV4-20 compact 覆盖前 latest query 回复。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "编辑后应退出 active branch。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "lastUserMessageIncludes": ["E2E_PV4_20_ORIGINAL"],
  44. "bodyExcludes": [
  45. "Generate a concise title",
  46. "CRITICAL: Respond with TEXT ONLY"
  47. ]
  48. },
  49. "response": {
  50. "statusCode": 200,
  51. "text": {
  52. "id": "pv4-20-original",
  53. "inputTokens": 56,
  54. "outputTokens": 8,
  55. "text": "PV4_20_ORIGINAL_REPLY"
  56. }
  57. }
  58. },
  59. {
  60. "id": "pv4-20-compact-interrupted",
  61. "description": "PV4-20 首次 compact 保持 running,期间排入 future intents 与第二个 compact。",
  62. "metadata": {
  63. "kind": "main",
  64. "timingPolicy": "controlled-stream",
  65. "source": "synthetic",
  66. "syntheticReason": "固定运行窗口后 stop,建立当前产品可达的 held queue。"
  67. },
  68. "maxMatches": 1,
  69. "match": {
  70. "method": "POST",
  71. "pathIncludes": "/messages",
  72. "bodyIncludes": [
  73. "E2E_PV4_20_ORIGINAL",
  74. "PV4_20_ORIGINAL_REPLY",
  75. "CRITICAL: Respond with TEXT ONLY",
  76. "\"stream\":true"
  77. ],
  78. "bodyExcludes": ["Generate a concise title"]
  79. },
  80. "response": {
  81. "statusCode": 200,
  82. "delayMs": 30000,
  83. "text": {
  84. "id": "pv4-20-compact-interrupted",
  85. "inputTokens": 128,
  86. "outputTokens": 24,
  87. "text": "<summary>PV4_20_INTERRUPTED_COMPACT_SHOULD_NOT_APPLY</summary>"
  88. }
  89. }
  90. },
  91. {
  92. "id": "pv4-20-compact-stable",
  93. "description": "PV4-20 held queue 中 send-now 的第二个 compact 成功覆盖 latest query。",
  94. "metadata": {
  95. "kind": "main",
  96. "timingPolicy": "fast-text",
  97. "source": "synthetic",
  98. "syntheticReason": "验证 stable compact 后 edit 仍保留另外两个 held future intents。"
  99. },
  100. "maxMatches": 1,
  101. "match": {
  102. "method": "POST",
  103. "pathIncludes": "/messages",
  104. "bodyIncludes": [
  105. "E2E_PV4_20_ORIGINAL",
  106. "PV4_20_ORIGINAL_REPLY",
  107. "CRITICAL: Respond with TEXT ONLY",
  108. "\"stream\":true"
  109. ],
  110. "bodyExcludes": ["Generate a concise title"]
  111. },
  112. "response": {
  113. "statusCode": 200,
  114. "text": {
  115. "id": "pv4-20-compact-stable",
  116. "inputTokens": 128,
  117. "outputTokens": 24,
  118. "text": "<summary>PV4_20_COMPACT_SUMMARY</summary>"
  119. }
  120. }
  121. },
  122. {
  123. "id": "pv4-20-edited",
  124. "description": "PV4-20 queue 保持后 edited intent 回复。",
  125. "metadata": {
  126. "kind": "main",
  127. "timingPolicy": "fast-text",
  128. "source": "synthetic",
  129. "syntheticReason": "新请求只消费 edited intent,不 drain held queue。"
  130. },
  131. "maxMatches": 1,
  132. "match": {
  133. "method": "POST",
  134. "pathIncludes": "/messages",
  135. "lastUserMessageIncludes": ["E2E_PV4_20_EDITED"],
  136. "bodyExcludes": ["Generate a concise title"]
  137. },
  138. "response": {
  139. "statusCode": 200,
  140. "text": {
  141. "id": "pv4-20-edited",
  142. "inputTokens": 64,
  143. "outputTokens": 8,
  144. "text": "PV4_20_EDITED_REPLY"
  145. }
  146. }
  147. },
  148. {
  149. "id": "pv4-20-queue-one",
  150. "description": "PV4-20 rewind 后显式消费保留的第一条 queue item。",
  151. "metadata": {
  152. "kind": "main",
  153. "timingPolicy": "fast-text",
  154. "source": "synthetic",
  155. "syntheticReason": "验证 queue 身份和顺序保留后只消费一次。"
  156. },
  157. "maxMatches": 1,
  158. "match": {
  159. "method": "POST",
  160. "pathIncludes": "/messages",
  161. "lastUserMessageIncludes": ["E2E_PV4_20_QUEUE_ONE"],
  162. "bodyExcludes": ["Generate a concise title"]
  163. },
  164. "response": {
  165. "statusCode": 200,
  166. "text": {
  167. "id": "pv4-20-queue-one",
  168. "inputTokens": 72,
  169. "outputTokens": 8,
  170. "text": "PV4_20_QUEUE_ONE_REPLY"
  171. }
  172. }
  173. },
  174. {
  175. "id": "pv4-20-queue-two",
  176. "description": "PV4-20 rewind 后显式消费保留的第二条 queue item。",
  177. "metadata": {
  178. "kind": "main",
  179. "timingPolicy": "fast-text",
  180. "source": "synthetic",
  181. "syntheticReason": "验证 queue 身份和顺序保留后只消费一次。"
  182. },
  183. "maxMatches": 1,
  184. "match": {
  185. "method": "POST",
  186. "pathIncludes": "/messages",
  187. "lastUserMessageIncludes": ["E2E_PV4_20_QUEUE_TWO"],
  188. "bodyExcludes": ["Generate a concise title"]
  189. },
  190. "response": {
  191. "statusCode": 200,
  192. "text": {
  193. "id": "pv4-20-queue-two",
  194. "inputTokens": 80,
  195. "outputTokens": 8,
  196. "text": "PV4_20_QUEUE_TWO_REPLY"
  197. }
  198. }
  199. },
  200. {
  201. "id": "pv4-23-title",
  202. "description": "PV4-23 background generation case-local 标题。",
  203. "metadata": {
  204. "kind": "common",
  205. "timingPolicy": "fast-text",
  206. "source": "synthetic",
  207. "syntheticReason": "标题不参与后台 task generation。"
  208. },
  209. "match": {
  210. "method": "POST",
  211. "pathIncludes": "/messages",
  212. "bodyIncludes": [
  213. "Generate a concise title",
  214. "E2E_PV4_23_BACKGROUND_ORIGINAL"
  215. ]
  216. },
  217. "response": {
  218. "statusCode": 200,
  219. "text": {
  220. "id": "pv4-23-title",
  221. "inputTokens": 48,
  222. "outputTokens": 8,
  223. "text": "{\"title\":\"PV4 23 Background Rewind\"}"
  224. }
  225. }
  226. },
  227. {
  228. "id": "pv4-23-background-tool",
  229. "description": "PV4-23 原 turn 启动长时后台 Bash。",
  230. "metadata": {
  231. "kind": "main",
  232. "timingPolicy": "controlled-stream",
  233. "source": "synthetic",
  234. "syntheticReason": "保持 running 直到 edit 的 stop barrier 取消它。"
  235. },
  236. "maxMatches": 1,
  237. "match": {
  238. "method": "POST",
  239. "pathIncludes": "/messages",
  240. "lastUserMessageIncludes": ["E2E_PV4_23_BACKGROUND_ORIGINAL"],
  241. "bodyExcludes": [
  242. "Generate a concise title",
  243. "Command running in background"
  244. ]
  245. },
  246. "response": {
  247. "statusCode": 200,
  248. "toolUse": {
  249. "id": "toolu_pv4_23_background",
  250. "messageId": "msg_pv4_23_background",
  251. "name": "Bash",
  252. "input": {
  253. "command": "sleep 300",
  254. "run_in_background": true,
  255. "description": "PV4-23 rewind fence"
  256. }
  257. }
  258. }
  259. },
  260. {
  261. "id": "pv4-23-background-final",
  262. "description": "PV4-23 后台分离后原 turn 结束回复。",
  263. "metadata": {
  264. "kind": "main",
  265. "timingPolicy": "fast-text",
  266. "source": "synthetic",
  267. "syntheticReason": "主轮稳定后仍保留 running task,供 edit 取消。"
  268. },
  269. "maxMatches": 1,
  270. "match": {
  271. "method": "POST",
  272. "pathIncludes": "/messages",
  273. "bodyIncludes": [
  274. "E2E_PV4_23_BACKGROUND_ORIGINAL",
  275. "Command running in background"
  276. ],
  277. "bodyExcludes": ["Generate a concise title"]
  278. },
  279. "response": {
  280. "statusCode": 200,
  281. "text": {
  282. "id": "pv4-23-background-final",
  283. "inputTokens": 96,
  284. "outputTokens": 8,
  285. "text": "PV4_23_BACKGROUND_ORIGINAL_REPLY"
  286. }
  287. }
  288. },
  289. {
  290. "id": "pv4-23-background-edited",
  291. "description": "PV4-23 旧 Bash 取消后的 edited intent 回复。",
  292. "metadata": {
  293. "kind": "main",
  294. "timingPolicy": "fast-text",
  295. "source": "synthetic",
  296. "syntheticReason": "新 branch 只启动一次 provider request。"
  297. },
  298. "maxMatches": 1,
  299. "match": {
  300. "method": "POST",
  301. "pathIncludes": "/messages",
  302. "lastUserMessageIncludes": ["E2E_PV4_23_BACKGROUND_EDITED"],
  303. "bodyExcludes": ["Generate a concise title"]
  304. },
  305. "response": {
  306. "statusCode": 200,
  307. "text": {
  308. "id": "pv4-23-background-edited",
  309. "inputTokens": 64,
  310. "outputTokens": 8,
  311. "text": "PV4_23_BACKGROUND_EDITED_REPLY"
  312. }
  313. }
  314. }
  315. ]
  316. }