conversation-session-running-guide-steer.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-running-guide-steer",
  4. "spec": "./test/e2e/conversation-session/conversation-session-running-guide-steer.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-running-guide-timeline-restored",
  8. "description": "P06 cold restore and model capability switch preserve guide history.",
  9. "metadata": {
  10. "kind": "main",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "真实 Electron/CLI 冷恢复后切换 endpoint 能力,检查原始 guide 重新投影且无重复包装。"
  14. },
  15. "maxMatches": 2,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "lastUserMessageIncludes": [
  20. "E2E_GUIDE_TIMELINE_RESTORED"
  21. ],
  22. "bodyExcludes": [
  23. "Generate a concise title",
  24. "CRITICAL: Respond with TEXT ONLY"
  25. ]
  26. },
  27. "response": {
  28. "statusCode": 200,
  29. "text": {
  30. "text": "guide-timeline-restored-ok"
  31. }
  32. }
  33. },
  34. {
  35. "id": "upstream-running-guide-timeline-title",
  36. "description": "P06 title request returns immediately without competing with the three main timeline requests.",
  37. "metadata": {
  38. "kind": "common",
  39. "timingPolicy": "fast-text",
  40. "source": "synthetic",
  41. "syntheticReason": "标题不属于 P06 steer 时序,只需稳定返回,避免后台重试给 provider 记录和运行日志引入噪声。"
  42. },
  43. "maxMatches": 2,
  44. "match": {
  45. "method": "POST",
  46. "pathIncludes": "/messages",
  47. "bodyIncludes": [
  48. "Generate a concise title",
  49. "E2E_GUIDE_TIMELINE_BASE"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "statusMessage": "OK",
  55. "headers": {
  56. "content-type": "application/json; charset=utf-8"
  57. },
  58. "body": "{\"id\":\"upstream-e2e-running-guide-timeline-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Guide Timeline E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
  59. }
  60. },
  61. {
  62. "id": "upstream-running-guide-timeline-initial-read",
  63. "description": "P06/GTB-01: delay the initial Read tool_use so guide-1 is admitted before the tool result batch.",
  64. "metadata": {
  65. "kind": "main",
  66. "timingPolicy": "controlled-stream",
  67. "source": "synthetic",
  68. "syntheticReason": "guide-1 必须稳定进入首轮 active request,并等待 Read tool result batch 完整提交后 drain。"
  69. },
  70. "maxMatches": 2,
  71. "match": {
  72. "method": "POST",
  73. "pathIncludes": "/messages",
  74. "bodyIncludes": [
  75. "E2E_GUIDE_TIMELINE_BASE"
  76. ],
  77. "bodyExcludes": [
  78. "E2E_GUIDE_TIMELINE_GUIDE_ONE",
  79. "Generate a concise title",
  80. "CRITICAL: Respond with TEXT ONLY",
  81. "Verify whether the active session goal"
  82. ],
  83. "lastUserMessageIncludes": [
  84. "E2E_GUIDE_TIMELINE_BASE"
  85. ]
  86. },
  87. "response": {
  88. "statusCode": 200,
  89. "delayMs": 5000,
  90. "toolUse": {
  91. "id": "toolu_e2e_running_guide_timeline_read",
  92. "messageId": "msg_e2e_running_guide_timeline_read",
  93. "name": "Read",
  94. "input": {
  95. "file_path": "{{e2eRuntimeRoot}}/shared/readonly-tool.txt"
  96. }
  97. }
  98. }
  99. },
  100. {
  101. "id": "upstream-running-guide-timeline-middle-text",
  102. "description": "P06/GTB-01: after Read result + guide-1, delay a text-only assistant so guide-2 can be admitted.",
  103. "metadata": {
  104. "kind": "main",
  105. "timingPolicy": "controlled-stream",
  106. "source": "synthetic",
  107. "syntheticReason": "guide-2 需要稳定进入 guide-1 后的 text-only active request,并等待 assistant 正常收口后 drain。 验证来源提示及非用户授权边界。"
  108. },
  109. "maxMatches": 2,
  110. "match": {
  111. "method": "POST",
  112. "pathIncludes": "/messages",
  113. "bodyIncludes": [
  114. "E2E_GUIDE_TIMELINE_BASE",
  115. "E2E_GUIDE_TIMELINE_GUIDE_ONE",
  116. "E2E_READONLY_TOOL_FILE_CONTENT",
  117. "The user sent a new message while you were working:",
  118. "This is how ZCode surfaces messages the user sends mid-turn"
  119. ],
  120. "bodyExcludes": [
  121. "E2E_GUIDE_TIMELINE_GUIDE_TWO",
  122. "Generate a concise title",
  123. "CRITICAL: Respond with TEXT ONLY",
  124. "Verify whether the active session goal"
  125. ],
  126. "lastUserMessageIncludes": [
  127. "E2E_READONLY_TOOL_FILE_CONTENT"
  128. ]
  129. },
  130. "response": {
  131. "statusCode": 200,
  132. "delayMs": 5000,
  133. "text": {
  134. "id": "upstream-e2e-running-guide-timeline-middle",
  135. "inputTokens": 180,
  136. "outputTokens": 16,
  137. "text": "E2E_GUIDE_TIMELINE_MIDDLE_ASSISTANT"
  138. }
  139. }
  140. },
  141. {
  142. "id": "upstream-running-guide-timeline-final-text",
  143. "description": "P06/GTB-04: text-only completion drains guide-2 and the same product turn returns its final assistant.",
  144. "metadata": {
  145. "kind": "main",
  146. "timingPolicy": "fast-text",
  147. "source": "synthetic",
  148. "syntheticReason": "固定最终正文 marker,用于直接断言两条 guide、三个工作段与最终 assistant 的 live DOM 全序。 验证来源提示及非用户授权边界。"
  149. },
  150. "maxMatches": 2,
  151. "match": {
  152. "method": "POST",
  153. "pathIncludes": "/messages",
  154. "bodyIncludes": [
  155. "E2E_GUIDE_TIMELINE_GUIDE_TWO",
  156. "E2E_GUIDE_TIMELINE_MIDDLE_ASSISTANT",
  157. "This is how ZCode surfaces messages the user sends mid-turn"
  158. ],
  159. "bodyExcludes": [
  160. "Generate a concise title",
  161. "CRITICAL: Respond with TEXT ONLY",
  162. "Verify whether the active session goal"
  163. ],
  164. "lastUserMessageIncludes": [
  165. "E2E_GUIDE_TIMELINE_GUIDE_TWO"
  166. ]
  167. },
  168. "response": {
  169. "statusCode": 200,
  170. "text": {
  171. "id": "upstream-e2e-running-guide-timeline-final",
  172. "inputTokens": 200,
  173. "outputTokens": 16,
  174. "text": "guide-timeline-final-assistant-ok"
  175. }
  176. }
  177. },
  178. {
  179. "id": "upstream-running-guide-steer-base-slow-stream",
  180. "description": "M06: guide 模式普通 running steer 的基础慢流。",
  181. "metadata": {
  182. "kind": "main",
  183. "timingPolicy": "controlled-stream",
  184. "source": "synthetic",
  185. "syntheticReason": "guide steer 需要稳定 running 窗口;真实 provider 可能过快完成。"
  186. },
  187. "maxMatches": 1,
  188. "match": {
  189. "method": "POST",
  190. "pathIncludes": "/messages",
  191. "bodyIncludes": [
  192. "E2E_SLOW_STREAM",
  193. "E2E_RUNNING_GUIDE_STEER_BASE"
  194. ],
  195. "bodyExcludes": [
  196. "Generate a concise title",
  197. "CRITICAL: Respond with TEXT ONLY",
  198. "Verify whether the active session goal"
  199. ],
  200. "lastUserMessageIncludes": [
  201. "E2E_RUNNING_GUIDE_STEER_BASE"
  202. ]
  203. },
  204. "response": {
  205. "statusCode": 200,
  206. "statusMessage": "OK",
  207. "headers": {
  208. "cache-control": "no-cache",
  209. "content-type": "text/event-stream; charset=utf-8"
  210. },
  211. "events": [
  212. {
  213. "sequence": 0,
  214. "offsetMs": 0,
  215. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-running-guide-steer-base\",\"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"
  216. },
  217. {
  218. "sequence": 1,
  219. "offsetMs": 250,
  220. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  221. },
  222. {
  223. "sequence": 2,
  224. "offsetMs": 700,
  225. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  226. },
  227. {
  228. "sequence": 3,
  229. "offsetMs": 5000,
  230. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  231. },
  232. {
  233. "sequence": 4,
  234. "offsetMs": 5100,
  235. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  236. },
  237. {
  238. "sequence": 5,
  239. "offsetMs": 5200,
  240. "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"
  241. },
  242. {
  243. "sequence": 6,
  244. "offsetMs": 5300,
  245. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  246. }
  247. ]
  248. }
  249. },
  250. {
  251. "id": "upstream-running-guide-goal-seed-active",
  252. "description": "M06d: 在 active goal guide case 前建立稳定 session。",
  253. "metadata": {
  254. "kind": "main",
  255. "timingPolicy": "fast-text",
  256. "source": "synthetic",
  257. "syntheticReason": "goal guide case 只验证已建立 session 上的目标链路,避免 draft prewarm admission 混入状态窗口。"
  258. },
  259. "maxMatches": 1,
  260. "match": {
  261. "method": "POST",
  262. "pathIncludes": "/messages",
  263. "bodyIncludes": [
  264. "E2E_RUNNING_GUIDE_GOAL_SEED_ACTIVE"
  265. ],
  266. "bodyExcludes": [
  267. "Generate a concise title",
  268. "CRITICAL: Respond with TEXT ONLY"
  269. ],
  270. "lastUserMessageIncludes": [
  271. "E2E_RUNNING_GUIDE_GOAL_SEED_ACTIVE"
  272. ]
  273. },
  274. "response": {
  275. "statusCode": 200,
  276. "text": {
  277. "id": "upstream-e2e-running-guide-goal-seed-active",
  278. "inputTokens": 80,
  279. "outputTokens": 8,
  280. "text": "running-guide-goal-seed-ok"
  281. }
  282. }
  283. },
  284. {
  285. "id": "upstream-running-guide-goal-seed-verify",
  286. "description": "H11: 在 goal verifier guide case 前建立稳定 session。",
  287. "metadata": {
  288. "kind": "main",
  289. "timingPolicy": "fast-text",
  290. "source": "synthetic",
  291. "syntheticReason": "goal verifier guide case 只验证已建立 session 上的目标链路,避免 draft prewarm admission 混入状态窗口。"
  292. },
  293. "maxMatches": 1,
  294. "match": {
  295. "method": "POST",
  296. "pathIncludes": "/messages",
  297. "bodyIncludes": [
  298. "E2E_RUNNING_GUIDE_GOAL_SEED_VERIFY"
  299. ],
  300. "bodyExcludes": [
  301. "Generate a concise title",
  302. "CRITICAL: Respond with TEXT ONLY"
  303. ],
  304. "lastUserMessageIncludes": [
  305. "E2E_RUNNING_GUIDE_GOAL_SEED_VERIFY"
  306. ]
  307. },
  308. "response": {
  309. "statusCode": 200,
  310. "text": {
  311. "id": "upstream-e2e-running-guide-goal-seed-verify",
  312. "inputTokens": 80,
  313. "outputTokens": 8,
  314. "text": "running-guide-goal-seed-ok"
  315. }
  316. }
  317. },
  318. {
  319. "id": "upstream-running-guide-goal-active-continuation-slow",
  320. "description": "M06d: guide 模式 active goal running 的 continuation 慢流。",
  321. "metadata": {
  322. "kind": "main",
  323. "timingPolicy": "controlled-stream",
  324. "source": "synthetic",
  325. "syntheticReason": "active goal guide steer 需要稳定 active target running 窗口。"
  326. },
  327. "maxMatches": 1,
  328. "match": {
  329. "method": "POST",
  330. "pathIncludes": "/messages",
  331. "bodyIncludes": [
  332. "E2E_RUNNING_GUIDE_GOAL_ACTIVE",
  333. "Continue working toward the active session goal"
  334. ],
  335. "bodyExcludes": [
  336. "Generate a concise title",
  337. "CRITICAL: Respond with TEXT ONLY",
  338. "Verify whether the active session goal"
  339. ]
  340. },
  341. "response": {
  342. "statusCode": 200,
  343. "delayMs": 5000,
  344. "text": {
  345. "id": "upstream-e2e-running-guide-goal-active",
  346. "inputTokens": 140,
  347. "outputTokens": 12,
  348. "text": "upstream-e2e-ok"
  349. }
  350. }
  351. },
  352. {
  353. "id": "upstream-running-guide-goal-verify-continuation",
  354. "description": "H11: goal verifier queue case 前的 goal continuation。",
  355. "metadata": {
  356. "kind": "main",
  357. "timingPolicy": "fast-text",
  358. "source": "synthetic",
  359. "syntheticReason": "稳定让 guide 文本在 goal verifier running 窗口进入 future queue。"
  360. },
  361. "maxMatches": 1,
  362. "match": {
  363. "method": "POST",
  364. "pathIncludes": "/messages",
  365. "bodyIncludes": [
  366. "E2E_RUNNING_GUIDE_GOAL_VERIFY",
  367. "Continue working toward the active session goal"
  368. ],
  369. "bodyExcludes": [
  370. "Generate a concise title",
  371. "CRITICAL: Respond with TEXT ONLY",
  372. "Verify whether the active session goal"
  373. ]
  374. },
  375. "response": {
  376. "statusCode": 200,
  377. "text": {
  378. "id": "upstream-e2e-running-guide-goal-verify-continuation",
  379. "inputTokens": 140,
  380. "outputTokens": 12,
  381. "text": "upstream-e2e-ok"
  382. }
  383. }
  384. },
  385. {
  386. "id": "upstream-running-guide-goal-verify-delayed",
  387. "description": "H11: delayed goal verifier lets the user queue guide text.",
  388. "metadata": {
  389. "kind": "goal-verifier",
  390. "timingPolicy": "controlled-stream",
  391. "source": "synthetic",
  392. "syntheticReason": "goal verifier queue 需要稳定 verifier running 窗口;真实 verifier 可能过快完成。"
  393. },
  394. "maxMatches": 1,
  395. "match": {
  396. "method": "POST",
  397. "pathIncludes": "/messages",
  398. "bodyIncludes": [
  399. "E2E_RUNNING_GUIDE_GOAL_VERIFY",
  400. "Verify whether the active session goal"
  401. ],
  402. "bodyExcludes": [
  403. "Generate a concise title",
  404. "CRITICAL: Respond with TEXT ONLY"
  405. ]
  406. },
  407. "response": {
  408. "statusCode": 200,
  409. "delayMs": 60000,
  410. "headers": {
  411. "content-type": "application/json; charset=utf-8"
  412. },
  413. "body": "{\"id\":\"upstream-e2e-running-guide-goal-verify-delayed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"Delayed verifier should be stopped by cleanup.\\\",\\\"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\"}}"
  414. }
  415. },
  416. {
  417. "id": "upstream-running-guide-steer-followup-drain",
  418. "description": "M06: 基础 provider batch 完成后,guide follow-up 进入同一 active turn 的下一次请求。",
  419. "metadata": {
  420. "kind": "main",
  421. "timingPolicy": "controlled-stream",
  422. "source": "synthetic",
  423. "syntheticReason": "稳定观察 guide 从 steer queue drain 为真实 user row,并保留后续 running 窗口。"
  424. },
  425. "maxMatches": 1,
  426. "match": {
  427. "method": "POST",
  428. "pathIncludes": "/messages",
  429. "bodyIncludes": [
  430. "E2E_RUNNING_GUIDE_STEER_BASE",
  431. "E2E_RUNNING_GUIDE_STEER_FOLLOWUP"
  432. ],
  433. "bodyExcludes": [
  434. "Generate a concise title",
  435. "CRITICAL: Respond with TEXT ONLY"
  436. ],
  437. "lastUserMessageIncludes": [
  438. "E2E_RUNNING_GUIDE_STEER_FOLLOWUP"
  439. ]
  440. },
  441. "response": {
  442. "statusCode": 200,
  443. "delayMs": 60000,
  444. "text": {
  445. "id": "upstream-e2e-running-guide-steer-followup-drain",
  446. "inputTokens": 150,
  447. "outputTokens": 12,
  448. "text": "upstream-e2e-ok"
  449. }
  450. }
  451. },
  452. {
  453. "id": "upstream-running-guide-goal-steer-drain",
  454. "description": "M06d: active goal continuation batch 完成后,guide steer 在目标链路内继续运行。",
  455. "metadata": {
  456. "kind": "main",
  457. "timingPolicy": "controlled-stream",
  458. "source": "synthetic",
  459. "syntheticReason": "稳定观察 active goal guide drain 为真实 user row,同时保持 active target 与 running 链路。"
  460. },
  461. "maxMatches": 1,
  462. "match": {
  463. "method": "POST",
  464. "pathIncludes": "/messages",
  465. "bodyIncludes": [
  466. "E2E_RUNNING_GUIDE_GOAL_ACTIVE",
  467. "E2E_RUNNING_GUIDE_GOAL_STEER"
  468. ],
  469. "bodyExcludes": [
  470. "Generate a concise title",
  471. "CRITICAL: Respond with TEXT ONLY",
  472. "Verify whether the active session goal"
  473. ],
  474. "lastUserMessageIncludes": [
  475. "E2E_RUNNING_GUIDE_GOAL_STEER"
  476. ]
  477. },
  478. "response": {
  479. "statusCode": 200,
  480. "delayMs": 60000,
  481. "text": {
  482. "id": "upstream-e2e-running-guide-goal-steer-drain",
  483. "inputTokens": 160,
  484. "outputTokens": 12,
  485. "text": "upstream-e2e-ok"
  486. }
  487. }
  488. },
  489. {
  490. "id": "upstream-running-guide-goal-verify-queue-no-standalone-request",
  491. "description": "H11: guide verifier queued text should not create a standalone normal provider request in this observed window.",
  492. "metadata": {
  493. "kind": "main",
  494. "timingPolicy": "fast-text",
  495. "source": "synthetic",
  496. "syntheticReason": "goal verifier 不是普通 active turn;guide 文本应作为 future queue 保留,不应走 immediate provider request。"
  497. },
  498. "maxMatches": 0,
  499. "match": {
  500. "method": "POST",
  501. "pathIncludes": "/messages",
  502. "bodyIncludes": [
  503. "E2E_RUNNING_GUIDE_GOAL_VERIFY_QUEUE"
  504. ],
  505. "bodyExcludes": [
  506. "Generate a concise title",
  507. "CRITICAL: Respond with TEXT ONLY"
  508. ]
  509. },
  510. "response": {
  511. "statusCode": 200,
  512. "text": {
  513. "id": "upstream-e2e-running-guide-goal-verify-queue-should-not-send",
  514. "text": "upstream-e2e-ok"
  515. }
  516. }
  517. }
  518. ]
  519. }