conversation-session-goal-interruptions.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-goal-interruptions",
  4. "spec": "./test/e2e/conversation-session/goals/conversation-session-goal-interruptions.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-goal-interruptions-title-sidecar",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "运行时证据显示标题旁路缺少响应;在本例显式登记固定标题,避免依赖 legacy 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-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream 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-goal-verifier-stop-continuation",
  31. "description": "H09: goal continuation returns the target answer before entering verifier.",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "稳定让 /goal 进入 verifier 窗口,避免真实模型输出不满足 verifier 前置。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": [
  43. "E2E_GOAL_VERIFIER_STOP",
  44. "Continue working toward the active session goal"
  45. ],
  46. "bodyExcludes": [
  47. "Generate a concise title",
  48. "CRITICAL: Respond with TEXT ONLY",
  49. "Verify whether the active session goal"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "text": {
  55. "id": "upstream-e2e-goal-verifier-stop-continuation",
  56. "inputTokens": 160,
  57. "outputTokens": 12,
  58. "text": "upstream-e2e-ok"
  59. }
  60. }
  61. },
  62. {
  63. "id": "upstream-goal-verifier-stop-delayed",
  64. "description": "H09: delayed verifier request to allow user stop.",
  65. "metadata": {
  66. "kind": "goal-verifier",
  67. "timingPolicy": "controlled-stream",
  68. "source": "synthetic",
  69. "syntheticReason": "verifier 响应保持未完成,直到应用真实 Stop 取消;不依赖固定延时维持观察窗口。"
  70. },
  71. "maxMatches": 1,
  72. "match": {
  73. "method": "POST",
  74. "pathIncludes": "/messages",
  75. "bodyIncludes": ["E2E_GOAL_VERIFIER_STOP", "Verify whether the active session goal"],
  76. "bodyExcludes": [
  77. "E2E_GOAL_VERIFIER_STOP_NEXT",
  78. "Generate a concise title",
  79. "CRITICAL: Respond with TEXT ONLY"
  80. ]
  81. },
  82. "response": {
  83. "statusCode": 200,
  84. "headers": {
  85. "content-type": "application/json; charset=utf-8"
  86. },
  87. "chunks": [
  88. {
  89. "text": "{",
  90. "delayMs": 0
  91. },
  92. {
  93. "text": "\"id\":\"upstream-e2e-goal-verifier-stop-delayed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"Delayed verifier should be stopped by the test.\\\",\\\"nextAction\\\":\\\"\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":220,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}",
  94. "delayMs": 0
  95. }
  96. ],
  97. "releaseAfterChunks": 1
  98. }
  99. },
  100. {
  101. "id": "upstream-goal-verifier-stop-next",
  102. "description": "H09: normal prompt after stopping verifier completes.",
  103. "metadata": {
  104. "kind": "main",
  105. "timingPolicy": "fast-text",
  106. "source": "synthetic",
  107. "syntheticReason": "验证 stopped verifier 不阻塞下一条普通用户消息。"
  108. },
  109. "maxMatches": 1,
  110. "match": {
  111. "method": "POST",
  112. "pathIncludes": "/messages",
  113. "bodyIncludes": ["E2E_GOAL_VERIFIER_STOP_NEXT"],
  114. "bodyExcludes": [
  115. "Generate a concise title",
  116. "CRITICAL: Respond with TEXT ONLY",
  117. "Verify whether the active session goal"
  118. ],
  119. "lastUserMessageIncludes": ["E2E_GOAL_VERIFIER_STOP_NEXT"]
  120. },
  121. "response": {
  122. "statusCode": 200,
  123. "text": {
  124. "id": "upstream-e2e-goal-verifier-stop-next",
  125. "inputTokens": 180,
  126. "outputTokens": 12,
  127. "text": "upstream-e2e-ok"
  128. }
  129. }
  130. },
  131. {
  132. "id": "upstream-goal-verifier-stop-next-verifier-passed",
  133. "description": "H09: verifier after the next prompt passes so the test can settle idle.",
  134. "metadata": {
  135. "kind": "goal-verifier",
  136. "timingPolicy": "fast-json",
  137. "source": "synthetic",
  138. "syntheticReason": "普通下一轮完成后 active goal 可能再次 verifier;提供通过响应让 case 自然收口。"
  139. },
  140. "maxMatches": 1,
  141. "match": {
  142. "method": "POST",
  143. "pathIncludes": "/messages",
  144. "bodyIncludes": [
  145. "E2E_GOAL_VERIFIER_STOP",
  146. "E2E_GOAL_VERIFIER_STOP_NEXT",
  147. "Verify whether the active session goal"
  148. ],
  149. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  150. },
  151. "response": {
  152. "statusCode": 200,
  153. "headers": {
  154. "content-type": "application/json; charset=utf-8"
  155. },
  156. "body": "{\"id\":\"upstream-e2e-goal-verifier-stop-next-passed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"The user was able to send the next prompt after stopping verifier.\\\",\\\"nextAction\\\":\\\"\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":240,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  157. }
  158. },
  159. {
  160. "id": "upstream-goal-verifier-compact-continuation",
  161. "description": "H10: goal continuation returns the target answer before entering verifier.",
  162. "metadata": {
  163. "kind": "main",
  164. "timingPolicy": "fast-text",
  165. "source": "synthetic",
  166. "syntheticReason": "稳定让 compact 分支进入 verifier stop 窗口。"
  167. },
  168. "maxMatches": 1,
  169. "match": {
  170. "method": "POST",
  171. "pathIncludes": "/messages",
  172. "bodyIncludes": [
  173. "E2E_GOAL_VERIFIER_COMPACT",
  174. "Continue working toward the active session goal"
  175. ],
  176. "bodyExcludes": [
  177. "Generate a concise title",
  178. "CRITICAL: Respond with TEXT ONLY",
  179. "Verify whether the active session goal"
  180. ]
  181. },
  182. "response": {
  183. "statusCode": 200,
  184. "text": {
  185. "id": "upstream-e2e-goal-verifier-compact-continuation",
  186. "inputTokens": 160,
  187. "outputTokens": 12,
  188. "text": "upstream-e2e-ok"
  189. }
  190. }
  191. },
  192. {
  193. "id": "upstream-goal-verifier-compact-delayed",
  194. "description": "H10: delayed verifier request to allow user stop before compact.",
  195. "metadata": {
  196. "kind": "goal-verifier",
  197. "timingPolicy": "controlled-stream",
  198. "source": "synthetic",
  199. "syntheticReason": "verifier 响应保持未完成,直到应用真实 Stop 取消;不依赖固定延时维持观察窗口。"
  200. },
  201. "maxMatches": 1,
  202. "match": {
  203. "method": "POST",
  204. "pathIncludes": "/messages",
  205. "bodyIncludes": ["E2E_GOAL_VERIFIER_COMPACT", "Verify whether the active session goal"],
  206. "bodyExcludes": [
  207. "E2E_GOAL_VERIFIER_COMPACT_NEXT",
  208. "Generate a concise title",
  209. "CRITICAL: Respond with TEXT ONLY"
  210. ]
  211. },
  212. "response": {
  213. "statusCode": 200,
  214. "headers": {
  215. "content-type": "application/json; charset=utf-8"
  216. },
  217. "chunks": [
  218. {
  219. "text": "{",
  220. "delayMs": 0
  221. },
  222. {
  223. "text": "\"id\":\"upstream-e2e-goal-verifier-compact-delayed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"Delayed verifier should be stopped before compact.\\\",\\\"nextAction\\\":\\\"\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":220,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}",
  224. "delayMs": 0
  225. }
  226. ],
  227. "releaseAfterChunks": 1
  228. }
  229. },
  230. {
  231. "id": "upstream-goal-verifier-compact-summary",
  232. "description": "H10: manual compact after stopping verifier succeeds and preserves a summary marker.",
  233. "metadata": {
  234. "kind": "main",
  235. "timingPolicy": "controlled-stream",
  236. "source": "synthetic",
  237. "syntheticReason": "真实回放 compact 仅耗时 38ms,测试错过 started;保持摘要流打开,确认开始态后放行并验证同一 inputId 完成及摘要续发。"
  238. },
  239. "maxMatches": 1,
  240. "match": {
  241. "method": "POST",
  242. "pathIncludes": "/messages",
  243. "bodyIncludes": [
  244. "CRITICAL: Respond with TEXT ONLY",
  245. "E2E_GOAL_VERIFIER_COMPACT",
  246. "\"stream\":true"
  247. ]
  248. },
  249. "response": {
  250. "statusCode": 200,
  251. "headers": {
  252. "content-type": "text/event-stream; charset=utf-8",
  253. "cache-control": "no-cache"
  254. },
  255. "chunks": [
  256. {
  257. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-verifier-compact-summary\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"test-model\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":260,\"output_tokens\":0}}}\n\n",
  258. "delayMs": 0
  259. },
  260. {
  261. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  262. "delayMs": 0
  263. },
  264. {
  265. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"<analysis>Goal verifier was stopped, then the conversation was compacted.</analysis>\\n\\n<summary>E2E_GOAL_VERIFIER_COMPACT_SUMMARY_MARKER: compact preserved the stopped verifier setup and active goal context.</summary>\"}}\n\n",
  266. "delayMs": 0
  267. },
  268. {
  269. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  270. "delayMs": 0
  271. },
  272. {
  273. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"output_tokens\":64}}\n\n",
  274. "delayMs": 0
  275. },
  276. {
  277. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  278. "delayMs": 0
  279. }
  280. ],
  281. "releaseAfterChunks": 3
  282. }
  283. },
  284. {
  285. "id": "upstream-goal-verifier-compact-next",
  286. "description": "H10: normal prompt after compact completes.",
  287. "metadata": {
  288. "kind": "main",
  289. "timingPolicy": "fast-text",
  290. "source": "synthetic",
  291. "syntheticReason": "验证 stopped verifier compact 后普通用户消息能基于 compact 后摘要继续。"
  292. },
  293. "maxMatches": 1,
  294. "match": {
  295. "method": "POST",
  296. "pathIncludes": "/messages",
  297. "bodyIncludes": [
  298. "E2E_GOAL_VERIFIER_COMPACT_NEXT",
  299. "E2E_GOAL_VERIFIER_COMPACT_SUMMARY_MARKER"
  300. ],
  301. "bodyExcludes": [
  302. "Generate a concise title",
  303. "CRITICAL: Respond with TEXT ONLY",
  304. "Verify whether the active session goal"
  305. ],
  306. "lastUserMessageIncludes": ["E2E_GOAL_VERIFIER_COMPACT_NEXT"]
  307. },
  308. "response": {
  309. "statusCode": 200,
  310. "text": {
  311. "id": "upstream-e2e-goal-verifier-compact-next",
  312. "inputTokens": 180,
  313. "outputTokens": 12,
  314. "text": "upstream-e2e-ok"
  315. }
  316. }
  317. },
  318. {
  319. "id": "upstream-goal-verifier-compact-next-verifier-passed",
  320. "description": "H10: verifier after compact next prompt passes so the test can settle idle.",
  321. "metadata": {
  322. "kind": "goal-verifier",
  323. "timingPolicy": "fast-json",
  324. "source": "synthetic",
  325. "syntheticReason": "compact 后下一轮完成后 active goal 可能再次 verifier;提供通过响应让 case 自然收口。"
  326. },
  327. "maxMatches": 1,
  328. "match": {
  329. "method": "POST",
  330. "pathIncludes": "/messages",
  331. "bodyIncludes": [
  332. "E2E_GOAL_VERIFIER_COMPACT",
  333. "E2E_GOAL_VERIFIER_COMPACT_NEXT",
  334. "Verify whether the active session goal"
  335. ],
  336. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  337. },
  338. "response": {
  339. "statusCode": 200,
  340. "headers": {
  341. "content-type": "application/json; charset=utf-8"
  342. },
  343. "body": "{\"id\":\"upstream-e2e-goal-verifier-compact-next-passed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"The user compacted and then continued after stopping verifier.\\\",\\\"nextAction\\\":\\\"\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":240,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  344. }
  345. }
  346. ]
  347. }