conversation-session-running-send-now.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-running-send-now",
  4. "spec": "./test/e2e/conversation-session/conversation-session-running-send-now.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-running-send-now-head-base",
  8. "description": "M07a 队首 send-now 的基础 running 窗口。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "固定当前轮的 text-only assistant 输出并保持运行,验证抢占后 human reminder 的 MCS 位置降级。"
  14. },
  15. "maxMatches": 2,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": [
  20. "E2E_HOLD_STREAM",
  21. "E2E_RUNNING_SEND_NOW_HEAD_BASE"
  22. ],
  23. "bodyExcludes": [
  24. "Generate a concise title",
  25. "CRITICAL: Respond with TEXT ONLY"
  26. ],
  27. "lastUserMessageIncludes": [
  28. "E2E_RUNNING_SEND_NOW_HEAD_BASE"
  29. ]
  30. },
  31. "response": {
  32. "statusCode": 200,
  33. "headers": {
  34. "content-type": "text/event-stream; charset=utf-8"
  35. },
  36. "events": [
  37. {
  38. "sequence": 0,
  39. "offsetMs": 0,
  40. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"send-now-head-partial\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"output_tokens\":0}}}\n\n"
  41. },
  42. {
  43. "sequence": 1,
  44. "offsetMs": 0,
  45. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  46. },
  47. {
  48. "sequence": 2,
  49. "offsetMs": 0,
  50. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"send-now-head-partial\"}}\n\n"
  51. },
  52. {
  53. "sequence": 3,
  54. "offsetMs": 60000,
  55. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  56. },
  57. {
  58. "sequence": 4,
  59. "offsetMs": 60000,
  60. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"output_tokens\":8}}\n\n"
  61. },
  62. {
  63. "sequence": 5,
  64. "offsetMs": 60000,
  65. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  66. }
  67. ]
  68. }
  69. },
  70. {
  71. "id": "upstream-running-send-now-head-selected",
  72. "description": "M07a 被点队首项提升后的慢响应。",
  73. "metadata": {
  74. "kind": "main",
  75. "timingPolicy": "controlled-stream",
  76. "source": "synthetic",
  77. "syntheticReason": "保持下一轮 streaming,便于同时断言 user 投影、queue 清空与请求次数。"
  78. },
  79. "maxMatches": 2,
  80. "match": {
  81. "method": "POST",
  82. "pathIncludes": "/messages",
  83. "bodyIncludes": [
  84. "E2E_RUNNING_SEND_NOW_HEAD",
  85. "The user sent a new message while you were working:",
  86. "<system-reminder>",
  87. "Address the message above as you continue this turn."
  88. ],
  89. "bodyExcludes": [
  90. "Generate a concise title",
  91. "CRITICAL: Respond with TEXT ONLY"
  92. ],
  93. "lastUserMessageIncludes": [
  94. "E2E_RUNNING_SEND_NOW_HEAD"
  95. ],
  96. "lastUserMessageExcludes": [
  97. "E2E_RUNNING_SEND_NOW_HEAD_BASE"
  98. ]
  99. },
  100. "response": {
  101. "statusCode": 200,
  102. "delayMs": 60000,
  103. "text": {
  104. "id": "upstream-e2e-running-send-now-head-selected",
  105. "inputTokens": 140,
  106. "outputTokens": 12,
  107. "text": "upstream-e2e-ok"
  108. }
  109. }
  110. },
  111. {
  112. "id": "upstream-running-send-now-promote-base",
  113. "description": "M07b 非队首提升的基础 running 窗口。",
  114. "metadata": {
  115. "kind": "main",
  116. "timingPolicy": "controlled-stream",
  117. "source": "synthetic",
  118. "syntheticReason": "稳定保留两条 typed queue,避免首轮提前完成并自动 drain。"
  119. },
  120. "maxMatches": 1,
  121. "match": {
  122. "method": "POST",
  123. "pathIncludes": "/messages",
  124. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_RUNNING_SEND_NOW_PROMOTE_BASE"],
  125. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  126. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_PROMOTE_BASE"]
  127. },
  128. "response": {
  129. "statusCode": 200,
  130. "delayMs": 60000,
  131. "text": {
  132. "id": "upstream-e2e-running-send-now-promote-base",
  133. "inputTokens": 120,
  134. "outputTokens": 12,
  135. "text": "upstream-e2e-ok"
  136. }
  137. }
  138. },
  139. {
  140. "id": "upstream-running-send-now-promote-first-not-selected",
  141. "description": "M07b 未点队首项不得产生 provider 请求。",
  142. "metadata": {
  143. "kind": "main",
  144. "timingPolicy": "fast-text",
  145. "source": "synthetic",
  146. "syntheticReason": "maxMatches=0 把未点项保持在 queue 的负向合同纳入 replay ledger。"
  147. },
  148. "maxMatches": 0,
  149. "match": {
  150. "method": "POST",
  151. "pathIncludes": "/messages",
  152. "bodyIncludes": ["E2E_RUNNING_SEND_NOW_PROMOTE_FIRST"],
  153. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  154. },
  155. "response": {
  156. "statusCode": 200,
  157. "text": {
  158. "id": "upstream-e2e-running-send-now-promote-first-should-not-send",
  159. "inputTokens": 120,
  160. "outputTokens": 12,
  161. "text": "upstream-e2e-ok"
  162. }
  163. }
  164. },
  165. {
  166. "id": "upstream-running-send-now-promote-second-selected",
  167. "description": "M07b 被点非队首项提升后的慢响应。",
  168. "metadata": {
  169. "kind": "main",
  170. "timingPolicy": "controlled-stream",
  171. "source": "synthetic",
  172. "syntheticReason": "稳定验证被点项成为 active,未点项仍保留。"
  173. },
  174. "maxMatches": 1,
  175. "match": {
  176. "method": "POST",
  177. "pathIncludes": "/messages",
  178. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_RUNNING_SEND_NOW_PROMOTE_SECOND"],
  179. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  180. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_PROMOTE_SECOND"]
  181. },
  182. "response": {
  183. "statusCode": 200,
  184. "delayMs": 60000,
  185. "text": {
  186. "id": "upstream-e2e-running-send-now-promote-second-selected",
  187. "inputTokens": 140,
  188. "outputTokens": 12,
  189. "text": "upstream-e2e-ok"
  190. }
  191. }
  192. },
  193. {
  194. "id": "upstream-running-send-now-goal-base",
  195. "description": "M07c queued goal send-now 的基础 running 窗口。",
  196. "metadata": {
  197. "kind": "main",
  198. "timingPolicy": "controlled-stream",
  199. "source": "synthetic",
  200. "syntheticReason": "确保 /goal 先形成 typed queue,再由用户显式提升。"
  201. },
  202. "maxMatches": 1,
  203. "match": {
  204. "method": "POST",
  205. "pathIncludes": "/messages",
  206. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_RUNNING_SEND_NOW_GOAL_BASE"],
  207. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  208. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_GOAL_BASE"]
  209. },
  210. "response": {
  211. "statusCode": 200,
  212. "delayMs": 60000,
  213. "text": {
  214. "id": "upstream-e2e-running-send-now-goal-base",
  215. "inputTokens": 120,
  216. "outputTokens": 12,
  217. "text": "upstream-e2e-ok"
  218. }
  219. }
  220. },
  221. {
  222. "id": "upstream-running-send-now-goal-continuation",
  223. "description": "M07c goal item 提升后启动的目标 continuation。",
  224. "metadata": {
  225. "kind": "main",
  226. "timingPolicy": "controlled-stream",
  227. "source": "synthetic",
  228. "syntheticReason": "保持 active target + streaming 窗口,直接验证 intent 未退化成普通 text。"
  229. },
  230. "maxMatches": 1,
  231. "match": {
  232. "method": "POST",
  233. "pathIncludes": "/messages",
  234. "bodyIncludes": ["Continue working toward the active session goal"],
  235. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal"]
  236. },
  237. "response": {
  238. "statusCode": 200,
  239. "delayMs": 60000,
  240. "text": {
  241. "id": "upstream-e2e-running-send-now-goal-continuation",
  242. "inputTokens": 160,
  243. "outputTokens": 12,
  244. "text": "upstream-e2e-ok"
  245. }
  246. }
  247. },
  248. {
  249. "id": "upstream-running-send-now-double-base",
  250. "description": "M07g 双击幂等的基础 running 窗口。",
  251. "metadata": {
  252. "kind": "main",
  253. "timingPolicy": "controlled-stream",
  254. "source": "synthetic",
  255. "syntheticReason": "让两个 click 在同一 active turn 和同一 React 刷新边界内发生。"
  256. },
  257. "maxMatches": 1,
  258. "match": {
  259. "method": "POST",
  260. "pathIncludes": "/messages",
  261. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_RUNNING_SEND_NOW_DOUBLE_BASE"],
  262. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  263. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_DOUBLE_BASE"]
  264. },
  265. "response": {
  266. "statusCode": 200,
  267. "delayMs": 60000,
  268. "text": {
  269. "id": "upstream-e2e-running-send-now-double-base",
  270. "inputTokens": 120,
  271. "outputTokens": 12,
  272. "text": "upstream-e2e-ok"
  273. }
  274. }
  275. },
  276. {
  277. "id": "upstream-running-send-now-double-first-not-selected",
  278. "description": "M07g 双击期间未点队首项不得被误消费。",
  279. "metadata": {
  280. "kind": "main",
  281. "timingPolicy": "fast-text",
  282. "source": "synthetic",
  283. "syntheticReason": "maxMatches=0 证明第二条 command 不会触发普通 drain 消费 sibling queue item。"
  284. },
  285. "maxMatches": 0,
  286. "match": {
  287. "method": "POST",
  288. "pathIncludes": "/messages",
  289. "bodyIncludes": ["E2E_RUNNING_SEND_NOW_DOUBLE_FIRST"],
  290. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  291. },
  292. "response": {
  293. "statusCode": 200,
  294. "text": {
  295. "id": "upstream-e2e-running-send-now-double-first-should-not-send",
  296. "inputTokens": 120,
  297. "outputTokens": 12,
  298. "text": "upstream-e2e-ok"
  299. }
  300. }
  301. },
  302. {
  303. "id": "upstream-running-send-now-double-second-selected-once",
  304. "description": "M07g 被点项只能提升并发送一次。",
  305. "metadata": {
  306. "kind": "main",
  307. "timingPolicy": "controlled-stream",
  308. "source": "synthetic",
  309. "syntheticReason": "maxMatches=1 将重复 provider 请求直接视为 replay 失败,并保留 streaming 断言窗口。"
  310. },
  311. "maxMatches": 1,
  312. "match": {
  313. "method": "POST",
  314. "pathIncludes": "/messages",
  315. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_RUNNING_SEND_NOW_DOUBLE_SECOND"],
  316. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  317. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_DOUBLE_SECOND"]
  318. },
  319. "response": {
  320. "statusCode": 200,
  321. "delayMs": 60000,
  322. "text": {
  323. "id": "upstream-e2e-running-send-now-double-second-selected-once",
  324. "inputTokens": 140,
  325. "outputTokens": 12,
  326. "text": "upstream-e2e-ok"
  327. }
  328. }
  329. }
  330. ]
  331. }