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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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. ],
  86. "bodyExcludes": [
  87. "Generate a concise title",
  88. "CRITICAL: Respond with TEXT ONLY",
  89. "The user sent a new message while you were working:"
  90. ],
  91. "lastUserMessageIncludes": [
  92. "E2E_RUNNING_SEND_NOW_HEAD"
  93. ],
  94. "lastUserMessageExcludes": [
  95. "E2E_RUNNING_SEND_NOW_HEAD_BASE"
  96. ]
  97. },
  98. "response": {
  99. "statusCode": 200,
  100. "delayMs": 60000,
  101. "text": {
  102. "id": "upstream-e2e-running-send-now-head-selected",
  103. "inputTokens": 140,
  104. "outputTokens": 12,
  105. "text": "upstream-e2e-ok"
  106. }
  107. }
  108. },
  109. {
  110. "id": "upstream-running-send-now-promote-base",
  111. "description": "M07b 非队首提升的基础 running 窗口。",
  112. "metadata": {
  113. "kind": "main",
  114. "timingPolicy": "controlled-stream",
  115. "source": "synthetic",
  116. "syntheticReason": "稳定保留两条 typed queue,避免首轮提前完成并自动 drain。"
  117. },
  118. "maxMatches": 1,
  119. "match": {
  120. "method": "POST",
  121. "pathIncludes": "/messages",
  122. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_RUNNING_SEND_NOW_PROMOTE_BASE"],
  123. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  124. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_PROMOTE_BASE"]
  125. },
  126. "response": {
  127. "statusCode": 200,
  128. "delayMs": 60000,
  129. "text": {
  130. "id": "upstream-e2e-running-send-now-promote-base",
  131. "inputTokens": 120,
  132. "outputTokens": 12,
  133. "text": "upstream-e2e-ok"
  134. }
  135. }
  136. },
  137. {
  138. "id": "upstream-running-send-now-promote-first-not-selected",
  139. "description": "M07b 未点队首项不得产生 provider 请求。",
  140. "metadata": {
  141. "kind": "main",
  142. "timingPolicy": "fast-text",
  143. "source": "synthetic",
  144. "syntheticReason": "maxMatches=0 把未点项保持在 queue 的负向合同纳入 replay ledger。"
  145. },
  146. "maxMatches": 0,
  147. "match": {
  148. "method": "POST",
  149. "pathIncludes": "/messages",
  150. "bodyIncludes": ["E2E_RUNNING_SEND_NOW_PROMOTE_FIRST"],
  151. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  152. },
  153. "response": {
  154. "statusCode": 200,
  155. "text": {
  156. "id": "upstream-e2e-running-send-now-promote-first-should-not-send",
  157. "inputTokens": 120,
  158. "outputTokens": 12,
  159. "text": "upstream-e2e-ok"
  160. }
  161. }
  162. },
  163. {
  164. "id": "upstream-running-send-now-promote-second-selected",
  165. "description": "M07b 被点非队首项提升后的慢响应。",
  166. "metadata": {
  167. "kind": "main",
  168. "timingPolicy": "controlled-stream",
  169. "source": "synthetic",
  170. "syntheticReason": "稳定验证被点项成为 active,未点项仍保留。"
  171. },
  172. "maxMatches": 1,
  173. "match": {
  174. "method": "POST",
  175. "pathIncludes": "/messages",
  176. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_RUNNING_SEND_NOW_PROMOTE_SECOND"],
  177. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  178. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_PROMOTE_SECOND"]
  179. },
  180. "response": {
  181. "statusCode": 200,
  182. "delayMs": 60000,
  183. "text": {
  184. "id": "upstream-e2e-running-send-now-promote-second-selected",
  185. "inputTokens": 140,
  186. "outputTokens": 12,
  187. "text": "upstream-e2e-ok"
  188. }
  189. }
  190. },
  191. {
  192. "id": "upstream-running-send-now-goal-base",
  193. "description": "M07c queued goal send-now 的基础 running 窗口。",
  194. "metadata": {
  195. "kind": "main",
  196. "timingPolicy": "controlled-stream",
  197. "source": "synthetic",
  198. "syntheticReason": "确保 /goal 先形成 typed queue,再由用户显式提升。"
  199. },
  200. "maxMatches": 1,
  201. "match": {
  202. "method": "POST",
  203. "pathIncludes": "/messages",
  204. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_RUNNING_SEND_NOW_GOAL_BASE"],
  205. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  206. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_GOAL_BASE"]
  207. },
  208. "response": {
  209. "statusCode": 200,
  210. "delayMs": 60000,
  211. "text": {
  212. "id": "upstream-e2e-running-send-now-goal-base",
  213. "inputTokens": 120,
  214. "outputTokens": 12,
  215. "text": "upstream-e2e-ok"
  216. }
  217. }
  218. },
  219. {
  220. "id": "upstream-running-send-now-goal-continuation",
  221. "description": "M07c goal item 提升后启动的目标 continuation。",
  222. "metadata": {
  223. "kind": "main",
  224. "timingPolicy": "controlled-stream",
  225. "source": "synthetic",
  226. "syntheticReason": "保持 active target + streaming 窗口,直接验证 intent 未退化成普通 text。"
  227. },
  228. "maxMatches": 1,
  229. "match": {
  230. "method": "POST",
  231. "pathIncludes": "/messages",
  232. "bodyIncludes": ["Continue working toward the active session goal"],
  233. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "Verify whether the active session goal"]
  234. },
  235. "response": {
  236. "statusCode": 200,
  237. "delayMs": 60000,
  238. "text": {
  239. "id": "upstream-e2e-running-send-now-goal-continuation",
  240. "inputTokens": 160,
  241. "outputTokens": 12,
  242. "text": "upstream-e2e-ok"
  243. }
  244. }
  245. },
  246. {
  247. "id": "upstream-running-send-now-double-base",
  248. "description": "M07g 双击幂等的基础 running 窗口。",
  249. "metadata": {
  250. "kind": "main",
  251. "timingPolicy": "controlled-stream",
  252. "source": "synthetic",
  253. "syntheticReason": "让两个 click 在同一 active turn 和同一 React 刷新边界内发生。"
  254. },
  255. "maxMatches": 1,
  256. "match": {
  257. "method": "POST",
  258. "pathIncludes": "/messages",
  259. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_RUNNING_SEND_NOW_DOUBLE_BASE"],
  260. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  261. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_DOUBLE_BASE"]
  262. },
  263. "response": {
  264. "statusCode": 200,
  265. "delayMs": 60000,
  266. "text": {
  267. "id": "upstream-e2e-running-send-now-double-base",
  268. "inputTokens": 120,
  269. "outputTokens": 12,
  270. "text": "upstream-e2e-ok"
  271. }
  272. }
  273. },
  274. {
  275. "id": "upstream-running-send-now-double-first-not-selected",
  276. "description": "M07g 双击期间未点队首项不得被误消费。",
  277. "metadata": {
  278. "kind": "main",
  279. "timingPolicy": "fast-text",
  280. "source": "synthetic",
  281. "syntheticReason": "maxMatches=0 证明第二条 command 不会触发普通 drain 消费 sibling queue item。"
  282. },
  283. "maxMatches": 0,
  284. "match": {
  285. "method": "POST",
  286. "pathIncludes": "/messages",
  287. "bodyIncludes": ["E2E_RUNNING_SEND_NOW_DOUBLE_FIRST"],
  288. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  289. },
  290. "response": {
  291. "statusCode": 200,
  292. "text": {
  293. "id": "upstream-e2e-running-send-now-double-first-should-not-send",
  294. "inputTokens": 120,
  295. "outputTokens": 12,
  296. "text": "upstream-e2e-ok"
  297. }
  298. }
  299. },
  300. {
  301. "id": "upstream-running-send-now-double-second-selected-once",
  302. "description": "M07g 被点项只能提升并发送一次。",
  303. "metadata": {
  304. "kind": "main",
  305. "timingPolicy": "controlled-stream",
  306. "source": "synthetic",
  307. "syntheticReason": "maxMatches=1 将重复 provider 请求直接视为 replay 失败,并保留 streaming 断言窗口。"
  308. },
  309. "maxMatches": 1,
  310. "match": {
  311. "method": "POST",
  312. "pathIncludes": "/messages",
  313. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_RUNNING_SEND_NOW_DOUBLE_SECOND"],
  314. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  315. "lastUserMessageIncludes": ["E2E_RUNNING_SEND_NOW_DOUBLE_SECOND"]
  316. },
  317. "response": {
  318. "statusCode": 200,
  319. "delayMs": 60000,
  320. "text": {
  321. "id": "upstream-e2e-running-send-now-double-second-selected-once",
  322. "inputTokens": 140,
  323. "outputTokens": 12,
  324. "text": "upstream-e2e-ok"
  325. }
  326. }
  327. },
  328. {
  329. "id": "upstream-running-send-now-segment-read",
  330. "description": "M07m 当前轮先完成一次 Read,形成工作段。",
  331. "metadata": {
  332. "kind": "main",
  333. "timingPolicy": "fast-text",
  334. "source": "synthetic",
  335. "syntheticReason": "当前轮必须先有工具工作,才能观察立即发送后工作段归属哪一轮。"
  336. },
  337. "maxMatches": 1,
  338. "match": {
  339. "method": "POST",
  340. "pathIncludes": "/messages",
  341. "bodyIncludes": ["E2E_RUNNING_SEND_NOW_SEGMENT_BASE_"],
  342. "bodyExcludes": [
  343. "Generate a concise title",
  344. "CRITICAL: Respond with TEXT ONLY",
  345. "E2E_READONLY_TOOL_FILE_CONTENT",
  346. "E2E_RUNNING_SEND_NOW_SEGMENT_ITEM_"
  347. ]
  348. },
  349. "response": {
  350. "statusCode": 200,
  351. "toolUse": {
  352. "id": "toolu_running_send_now_segment_read",
  353. "messageId": "msg_running_send_now_segment_read",
  354. "name": "Read",
  355. "input": {
  356. "file_path": "{{e2eRuntimeRoot}}/shared/readonly-tool.txt"
  357. }
  358. }
  359. }
  360. },
  361. {
  362. "id": "upstream-running-send-now-segment-hold",
  363. "description": "M07m Read 结果后的下一次请求保持运行,等待用户点立即。",
  364. "metadata": {
  365. "kind": "main",
  366. "timingPolicy": "controlled-stream",
  367. "source": "synthetic",
  368. "syntheticReason": "固定 Read 结果后的 running 窗口,让普通 queue 项在同一轮内入队并被立即发送抢占。"
  369. },
  370. "maxMatches": 1,
  371. "match": {
  372. "method": "POST",
  373. "pathIncludes": "/messages",
  374. "bodyIncludes": ["E2E_RUNNING_SEND_NOW_SEGMENT_BASE_", "E2E_READONLY_TOOL_FILE_CONTENT"],
  375. "bodyExcludes": [
  376. "Generate a concise title",
  377. "CRITICAL: Respond with TEXT ONLY",
  378. "E2E_RUNNING_SEND_NOW_SEGMENT_ITEM_"
  379. ]
  380. },
  381. "response": {
  382. "statusCode": 200,
  383. "delayMs": 60000,
  384. "text": {
  385. "id": "upstream-e2e-running-send-now-segment-hold",
  386. "inputTokens": 120,
  387. "outputTokens": 8,
  388. "text": "send-now-segment-should-be-interrupted"
  389. }
  390. }
  391. },
  392. {
  393. "id": "upstream-running-send-now-segment-selected",
  394. "description": "M07m 被点的 queue 项带着原轮 Read 结果开始下一轮。",
  395. "metadata": {
  396. "kind": "main",
  397. "timingPolicy": "fast-text",
  398. "source": "synthetic",
  399. "syntheticReason": "只在请求同时带原轮 Read 结果和被点项时返回回复,证明抢占后才消费被点项。"
  400. },
  401. "maxMatches": 1,
  402. "match": {
  403. "method": "POST",
  404. "pathIncludes": "/messages",
  405. "bodyIncludes": [
  406. "E2E_RUNNING_SEND_NOW_SEGMENT_BASE_",
  407. "E2E_READONLY_TOOL_FILE_CONTENT",
  408. "E2E_RUNNING_SEND_NOW_SEGMENT_ITEM_"
  409. ],
  410. "bodyExcludes": [
  411. "Generate a concise title",
  412. "CRITICAL: Respond with TEXT ONLY",
  413. "send-now-segment-should-be-interrupted",
  414. "The user sent a new message while you were working:"
  415. ]
  416. },
  417. "response": {
  418. "statusCode": 200,
  419. "text": {
  420. "id": "upstream-e2e-running-send-now-segment-selected",
  421. "inputTokens": 160,
  422. "outputTokens": 8,
  423. "text": "send-now-segment-reply-ok"
  424. }
  425. }
  426. }
  427. ]
  428. }