conversation-session-runtime-restart.json 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-runtime-restart",
  4. "spec": "./test/e2e/conversation-session/runtime/conversation-session-runtime-restart.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "browser-ambient-next",
  8. "metadata": {
  9. "kind": "main",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "验证未释放的 Agent 页面在下一轮真实 provider 请求中有 ambient 页数和 URL,不依赖模型判断。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyExcludes": ["Generate a concise title"],
  18. "lastUserMessageIncludes": ["E2E_BROWSER_AMBIENT_NEXT:"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "browser-ambient-next",
  24. "text": "E2E_BROWSER_AMBIENT_NEXT_DONE"
  25. }
  26. }
  27. },
  28. {
  29. "id": "browser-restart-after-ack",
  30. "metadata": {
  31. "kind": "main",
  32. "source": "synthetic",
  33. "timingPolicy": "fast-text",
  34. "syntheticReason": "真实 BrowserControl 与 Electron 网页跨桌面/手机重启保留,固定模型输出验证同页续用。"
  35. },
  36. "maxMatches": 1,
  37. "match": {
  38. "method": "POST",
  39. "pathIncludes": "/messages",
  40. "bodyExcludes": ["Generate a concise title"],
  41. "lastUserMessageIncludes": ["E2E_BROWSER_RESTART_AFTER_OK"]
  42. },
  43. "response": {
  44. "statusCode": 200,
  45. "text": "E2E_BROWSER_RESTART_AFTER_DONE"
  46. }
  47. },
  48. {
  49. "id": "browser-restart-after-tool",
  50. "metadata": {
  51. "kind": "main",
  52. "source": "synthetic",
  53. "timingPolicy": "fast-tool-use",
  54. "syntheticReason": "真实 BrowserControl 与 Electron 网页跨桌面/手机重启保留,固定模型输出验证同页续用。"
  55. },
  56. "maxMatches": 1,
  57. "match": {
  58. "method": "POST",
  59. "pathIncludes": "/messages",
  60. "bodyExcludes": ["Generate a concise title"],
  61. "lastUserMessageIncludes": ["E2E_BROWSER_RESTART_AFTER:"]
  62. },
  63. "response": {
  64. "statusCode": 200,
  65. "toolUse": {
  66. "id": "toolu_after_browser_restart",
  67. "name": "mcp__node_repl__js",
  68. "input": {
  69. "title": "验证任务重启后的浏览器控制",
  70. "code": "const pluginRoot = process.env.ZCODE_PLUGIN_ROOT;\nif (!pluginRoot) throw new Error('Browser plugin root unavailable');\nconst { join } = await import('node:path');\nconst { pathToFileURL } = await import('node:url');\nconst { setupBrowserRuntime } = await import(pathToFileURL(join(pluginRoot, 'scripts', 'browser-client.mjs')).href);\nawait setupBrowserRuntime({ globals: globalThis });\nconst browser = await agent.browsers.get('iab');\nconst tabs = await browser.tabs.list();\nconst existing = tabs.find((tab) => tab.url === '{{browserFixtureUrl}}');\nconst userTab = existing ? undefined : (await browser.user.openTabs()).find((tab) => tab.url === '{{browserFixtureUrl}}');\nconst tab = existing ? await browser.tabs.get(existing.id) : userTab ? await browser.user.claimTab(userTab) : await browser.tabs.new();\nif (!existing && !userTab) await tab.goto('{{browserFixtureUrl}}');\nawait tab.playwright.getByLabel('State').fill('after');\n({ marker: 'E2E_BROWSER_RESTART_AFTER_OK', tabId: tab.id });"
  71. }
  72. }
  73. }
  74. },
  75. {
  76. "id": "browser-restart-mobile-ack",
  77. "metadata": {
  78. "kind": "main",
  79. "source": "synthetic",
  80. "timingPolicy": "fast-text",
  81. "syntheticReason": "真实 BrowserControl 与 Electron 网页跨桌面/手机重启保留,固定模型输出验证同页续用。"
  82. },
  83. "maxMatches": 1,
  84. "match": {
  85. "method": "POST",
  86. "pathIncludes": "/messages",
  87. "bodyExcludes": ["Generate a concise title"],
  88. "lastUserMessageIncludes": ["E2E_BROWSER_RESTART_MOBILE_OK"]
  89. },
  90. "response": {
  91. "statusCode": 200,
  92. "text": "E2E_BROWSER_RESTART_MOBILE_DONE"
  93. }
  94. },
  95. {
  96. "id": "browser-restart-mobile-tool",
  97. "metadata": {
  98. "kind": "main",
  99. "source": "synthetic",
  100. "timingPolicy": "fast-tool-use",
  101. "syntheticReason": "真实 BrowserControl 与 Electron 网页跨桌面/手机重启保留,固定模型输出验证同页续用。"
  102. },
  103. "maxMatches": 1,
  104. "match": {
  105. "method": "POST",
  106. "pathIncludes": "/messages",
  107. "bodyExcludes": ["Generate a concise title"],
  108. "lastUserMessageIncludes": ["E2E_BROWSER_RESTART_MOBILE:"]
  109. },
  110. "response": {
  111. "statusCode": 200,
  112. "toolUse": {
  113. "id": "toolu_mobile_browser_restart",
  114. "name": "mcp__node_repl__js",
  115. "input": {
  116. "title": "验证任务重启后的浏览器控制",
  117. "code": "const pluginRoot = process.env.ZCODE_PLUGIN_ROOT;\nif (!pluginRoot) throw new Error('Browser plugin root unavailable');\nconst { join } = await import('node:path');\nconst { pathToFileURL } = await import('node:url');\nconst { setupBrowserRuntime } = await import(pathToFileURL(join(pluginRoot, 'scripts', 'browser-client.mjs')).href);\nawait setupBrowserRuntime({ globals: globalThis });\nconst browser = await agent.browsers.get('iab');\nconst tabs = await browser.tabs.list();\nconst existing = tabs.find((tab) => tab.url === '{{browserFixtureUrl}}');\nconst userTab = existing ? undefined : (await browser.user.openTabs()).find((tab) => tab.url === '{{browserFixtureUrl}}');\nconst tab = existing ? await browser.tabs.get(existing.id) : userTab ? await browser.user.claimTab(userTab) : await browser.tabs.new();\nif (!existing && !userTab) await tab.goto('{{browserFixtureUrl}}');\nawait tab.playwright.getByLabel('State').fill('mobile');\n({ marker: 'E2E_BROWSER_RESTART_MOBILE_OK', tabId: tab.id });"
  118. }
  119. }
  120. }
  121. },
  122. {
  123. "id": "browser-restart-desktop-ack",
  124. "metadata": {
  125. "kind": "main",
  126. "source": "synthetic",
  127. "timingPolicy": "fast-text",
  128. "syntheticReason": "真实 BrowserControl 与 Electron 网页跨桌面/手机重启保留,固定模型输出验证同页续用。"
  129. },
  130. "maxMatches": 1,
  131. "match": {
  132. "method": "POST",
  133. "pathIncludes": "/messages",
  134. "bodyExcludes": ["Generate a concise title"],
  135. "lastUserMessageIncludes": ["E2E_BROWSER_RESTART_DESKTOP_OK"]
  136. },
  137. "response": {
  138. "statusCode": 200,
  139. "text": "E2E_BROWSER_RESTART_DESKTOP_DONE"
  140. }
  141. },
  142. {
  143. "id": "browser-restart-desktop-tool",
  144. "metadata": {
  145. "kind": "main",
  146. "source": "synthetic",
  147. "timingPolicy": "fast-tool-use",
  148. "syntheticReason": "真实 BrowserControl 与 Electron 网页跨桌面/手机重启保留,固定模型输出验证同页续用。"
  149. },
  150. "maxMatches": 1,
  151. "match": {
  152. "method": "POST",
  153. "pathIncludes": "/messages",
  154. "bodyExcludes": ["Generate a concise title"],
  155. "lastUserMessageIncludes": ["E2E_BROWSER_RESTART_DESKTOP:"]
  156. },
  157. "response": {
  158. "statusCode": 200,
  159. "toolUse": {
  160. "id": "toolu_desktop_browser_restart",
  161. "name": "mcp__node_repl__js",
  162. "input": {
  163. "title": "验证任务重启后的浏览器控制",
  164. "code": "const pluginRoot = process.env.ZCODE_PLUGIN_ROOT;\nif (!pluginRoot) throw new Error('Browser plugin root unavailable');\nconst { join } = await import('node:path');\nconst { pathToFileURL } = await import('node:url');\nconst { setupBrowserRuntime } = await import(pathToFileURL(join(pluginRoot, 'scripts', 'browser-client.mjs')).href);\nawait setupBrowserRuntime({ globals: globalThis });\nconst browser = await agent.browsers.get('iab');\nconst tabs = await browser.tabs.list();\nconst existing = tabs.find((tab) => tab.url === '{{browserFixtureUrl}}');\nconst userTab = existing ? undefined : (await browser.user.openTabs()).find((tab) => tab.url === '{{browserFixtureUrl}}');\nconst tab = existing ? await browser.tabs.get(existing.id) : userTab ? await browser.user.claimTab(userTab) : await browser.tabs.new();\nif (!existing && !userTab) await tab.goto('{{browserFixtureUrl}}');\nawait tab.playwright.getByLabel('State').fill('desktop');\n({ marker: 'E2E_BROWSER_RESTART_DESKTOP_OK', tabId: tab.id });"
  165. }
  166. }
  167. }
  168. },
  169. {
  170. "id": "conversation-session-stop-empty-title-sidecar",
  171. "description": "标题旁路取消窗口。",
  172. "metadata": {
  173. "kind": "common",
  174. "source": "synthetic",
  175. "timingPolicy": "controlled-stream",
  176. "syntheticReason": "延迟标题旁路响应,按实际 pending 请求确认重启发生在标题生成期间,验证关闭会取消旁路而非等待自然完成。"
  177. },
  178. "match": {
  179. "method": "POST",
  180. "pathIncludes": "/messages",
  181. "bodyIncludes": ["Generate a concise title"]
  182. },
  183. "response": {
  184. "statusCode": 200,
  185. "statusMessage": "OK",
  186. "headers": {
  187. "content-type": "application/json; charset=utf-8"
  188. },
  189. "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\"}}",
  190. "delayMs": 45000
  191. }
  192. },
  193. {
  194. "id": "owned-restart-desktop-launch",
  195. "metadata": {
  196. "kind": "main",
  197. "source": "synthetic",
  198. "timingPolicy": "fast-tool-use",
  199. "syntheticReason": "通过真实后台 Agent 和受控流验证父 session 重启会关闭所属工作。"
  200. },
  201. "maxMatches": 1,
  202. "match": {
  203. "method": "POST",
  204. "pathIncludes": "/messages",
  205. "lastUserMessageIncludes": ["E2E_OWNED_RESTART_DESKTOP:"],
  206. "bodyExcludes": ["Generate a concise title"]
  207. },
  208. "response": {
  209. "statusCode": 200,
  210. "toolUse": {
  211. "id": "toolu_owned_desktop",
  212. "name": "Agent",
  213. "input": {
  214. "description": "Owned restart DESKTOP",
  215. "prompt": "E2E_OWNED_RESTART_DESKTOP_CHILD: keep streaming until cancelled.",
  216. "subagent_type": "general-purpose",
  217. "run_in_background": true
  218. }
  219. }
  220. }
  221. },
  222. {
  223. "id": "owned-restart-desktop-ack",
  224. "metadata": {
  225. "kind": "main",
  226. "source": "synthetic",
  227. "timingPolicy": "fast-text",
  228. "syntheticReason": "通过真实后台 Agent 和受控流验证父 session 重启会关闭所属工作。"
  229. },
  230. "match": {
  231. "method": "POST",
  232. "pathIncludes": "/messages",
  233. "bodyIncludes": ["E2E_OWNED_RESTART_DESKTOP", "Async agent launched successfully"],
  234. "bodyExcludes": ["Generate a concise title"],
  235. "lastUserMessageExcludes": ["<task-notification>", "_NEXT"],
  236. "lastUserMessageIncludes": ["Async agent launched successfully"]
  237. },
  238. "response": {
  239. "statusCode": 200,
  240. "text": {
  241. "id": "owned-ack-desktop",
  242. "text": "background agent launched"
  243. }
  244. },
  245. "maxMatches": 1
  246. },
  247. {
  248. "id": "owned-restart-desktop-child",
  249. "description": "通过受控慢流验证运行中重启与排队输入结算。",
  250. "metadata": {
  251. "kind": "subagent",
  252. "source": "synthetic",
  253. "timingPolicy": "controlled-stream",
  254. "syntheticReason": "子代理保持真实在飞请求,父 turn 已结束时由用户重启取消。"
  255. },
  256. "maxMatches": 1,
  257. "match": {
  258. "method": "POST",
  259. "pathIncludes": "/messages",
  260. "lastUserMessageIncludes": ["E2E_OWNED_RESTART_DESKTOP_CHILD:"],
  261. "bodyExcludes": ["Generate a concise title"]
  262. },
  263. "response": {
  264. "statusCode": 200,
  265. "statusMessage": "OK",
  266. "headers": {
  267. "cache-control": "no-cache",
  268. "content-type": "text/event-stream; charset=utf-8"
  269. },
  270. "events": [
  271. {
  272. "sequence": 0,
  273. "offsetMs": 0,
  274. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-stop-empty-running-slow-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"
  275. },
  276. {
  277. "sequence": 1,
  278. "offsetMs": 250,
  279. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  280. },
  281. {
  282. "sequence": 2,
  283. "offsetMs": 700,
  284. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  285. },
  286. {
  287. "sequence": 3,
  288. "offsetMs": 60000,
  289. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  290. },
  291. {
  292. "sequence": 4,
  293. "offsetMs": 60100,
  294. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  295. },
  296. {
  297. "sequence": 5,
  298. "offsetMs": 60200,
  299. "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"
  300. },
  301. {
  302. "sequence": 6,
  303. "offsetMs": 60300,
  304. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  305. }
  306. ]
  307. }
  308. },
  309. {
  310. "id": "owned-restart-mobile-launch",
  311. "metadata": {
  312. "kind": "main",
  313. "source": "synthetic",
  314. "timingPolicy": "fast-tool-use",
  315. "syntheticReason": "通过真实后台 Agent 和受控流验证父 session 重启会关闭所属工作。"
  316. },
  317. "maxMatches": 1,
  318. "match": {
  319. "method": "POST",
  320. "pathIncludes": "/messages",
  321. "lastUserMessageIncludes": ["E2E_OWNED_RESTART_MOBILE:"],
  322. "bodyExcludes": ["Generate a concise title"]
  323. },
  324. "response": {
  325. "statusCode": 200,
  326. "toolUse": {
  327. "id": "toolu_owned_mobile",
  328. "name": "Agent",
  329. "input": {
  330. "description": "Owned restart MOBILE",
  331. "prompt": "E2E_OWNED_RESTART_MOBILE_CHILD: keep streaming until cancelled.",
  332. "subagent_type": "general-purpose",
  333. "run_in_background": true
  334. }
  335. }
  336. }
  337. },
  338. {
  339. "id": "owned-restart-mobile-ack",
  340. "metadata": {
  341. "kind": "main",
  342. "source": "synthetic",
  343. "timingPolicy": "fast-text",
  344. "syntheticReason": "通过真实后台 Agent 和受控流验证父 session 重启会关闭所属工作。"
  345. },
  346. "match": {
  347. "method": "POST",
  348. "pathIncludes": "/messages",
  349. "bodyIncludes": ["E2E_OWNED_RESTART_MOBILE", "Async agent launched successfully"],
  350. "bodyExcludes": ["Generate a concise title"],
  351. "lastUserMessageExcludes": ["<task-notification>", "_NEXT"],
  352. "lastUserMessageIncludes": ["Async agent launched successfully"]
  353. },
  354. "response": {
  355. "statusCode": 200,
  356. "text": {
  357. "id": "owned-ack-mobile",
  358. "text": "background agent launched"
  359. }
  360. },
  361. "maxMatches": 1
  362. },
  363. {
  364. "id": "owned-restart-mobile-child",
  365. "description": "通过受控慢流验证运行中重启与排队输入结算。",
  366. "metadata": {
  367. "kind": "subagent",
  368. "source": "synthetic",
  369. "timingPolicy": "controlled-stream",
  370. "syntheticReason": "子代理保持真实在飞请求,父 turn 已结束时由用户重启取消。"
  371. },
  372. "maxMatches": 1,
  373. "match": {
  374. "method": "POST",
  375. "pathIncludes": "/messages",
  376. "lastUserMessageIncludes": ["E2E_OWNED_RESTART_MOBILE_CHILD:"],
  377. "bodyExcludes": ["Generate a concise title"]
  378. },
  379. "response": {
  380. "statusCode": 200,
  381. "statusMessage": "OK",
  382. "headers": {
  383. "cache-control": "no-cache",
  384. "content-type": "text/event-stream; charset=utf-8"
  385. },
  386. "events": [
  387. {
  388. "sequence": 0,
  389. "offsetMs": 0,
  390. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-stop-empty-running-slow-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"
  391. },
  392. {
  393. "sequence": 1,
  394. "offsetMs": 250,
  395. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  396. },
  397. {
  398. "sequence": 2,
  399. "offsetMs": 700,
  400. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  401. },
  402. {
  403. "sequence": 3,
  404. "offsetMs": 60000,
  405. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  406. },
  407. {
  408. "sequence": 4,
  409. "offsetMs": 60100,
  410. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  411. },
  412. {
  413. "sequence": 5,
  414. "offsetMs": 60200,
  415. "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"
  416. },
  417. {
  418. "sequence": 6,
  419. "offsetMs": 60300,
  420. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  421. }
  422. ]
  423. }
  424. },
  425. {
  426. "id": "session-runtime-restart-next",
  427. "description": "中断后的最后 user message 可合并上轮未完成正文,按续发标记匹配。",
  428. "metadata": {
  429. "kind": "main",
  430. "timingPolicy": "fast-text",
  431. "source": "synthetic",
  432. "syntheticReason": "只验证运行实例重建与历史恢复,固定文本排除模型变化。"
  433. },
  434. "match": {
  435. "method": "POST",
  436. "pathIncludes": "/messages",
  437. "bodyIncludes": ["E2E_SESSION_RESTART_"],
  438. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  439. "lastUserMessageIncludes": ["E2E_SESSION_RESTART_", "_NEXT"]
  440. },
  441. "response": {
  442. "statusCode": 200,
  443. "text": {
  444. "id": "upstream-e2e-stop-empty-next",
  445. "inputTokens": 128,
  446. "outputTokens": 12,
  447. "text": "upstream-e2e-ok"
  448. }
  449. }
  450. },
  451. {
  452. "id": "session-runtime-restart-running",
  453. "description": "通过受控慢流验证运行中重启与排队输入结算。",
  454. "metadata": {
  455. "kind": "main",
  456. "timingPolicy": "controlled-stream",
  457. "source": "synthetic",
  458. "syntheticReason": "重启必须发生在生成窗口内,固定流避免模型速度改变状态前置。"
  459. },
  460. "maxMatches": 1,
  461. "match": {
  462. "method": "POST",
  463. "pathIncludes": "/messages",
  464. "bodyIncludes": ["E2E_SESSION_RESTART_RUNNING"],
  465. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  466. "lastUserMessageIncludes": ["E2E_SESSION_RESTART_RUNNING"]
  467. },
  468. "response": {
  469. "statusCode": 200,
  470. "statusMessage": "OK",
  471. "headers": {
  472. "cache-control": "no-cache",
  473. "content-type": "text/event-stream; charset=utf-8"
  474. },
  475. "events": [
  476. {
  477. "sequence": 0,
  478. "offsetMs": 0,
  479. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-stop-empty-running-slow-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"
  480. },
  481. {
  482. "sequence": 1,
  483. "offsetMs": 250,
  484. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  485. },
  486. {
  487. "sequence": 2,
  488. "offsetMs": 700,
  489. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  490. },
  491. {
  492. "sequence": 3,
  493. "offsetMs": 60000,
  494. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  495. },
  496. {
  497. "sequence": 4,
  498. "offsetMs": 60100,
  499. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  500. },
  501. {
  502. "sequence": 5,
  503. "offsetMs": 60200,
  504. "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"
  505. },
  506. {
  507. "sequence": 6,
  508. "offsetMs": 60300,
  509. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  510. }
  511. ]
  512. }
  513. },
  514. {
  515. "id": "session-runtime-restart-text",
  516. "description": "单任务重启前后用固定回复验证消息传输,不评价模型。",
  517. "metadata": {
  518. "kind": "main",
  519. "timingPolicy": "fast-text",
  520. "source": "synthetic",
  521. "syntheticReason": "只验证运行实例重建与历史恢复,固定文本排除模型变化。"
  522. },
  523. "match": {
  524. "method": "POST",
  525. "pathIncludes": "/messages",
  526. "bodyIncludes": ["E2E_SESSION_RESTART_"],
  527. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  528. "lastUserMessageIncludes": ["E2E_SESSION_RESTART_"],
  529. "lastUserMessageExcludes": ["E2E_SESSION_RESTART_RUNNING"]
  530. },
  531. "response": {
  532. "statusCode": 200,
  533. "text": {
  534. "id": "upstream-e2e-stop-empty-next",
  535. "inputTokens": 128,
  536. "outputTokens": 12,
  537. "text": "upstream-e2e-ok"
  538. }
  539. }
  540. }
  541. ]
  542. }