conversation-session-background-bash-output.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-background-bash-output",
  4. "spec": "./test/e2e/conversation-session/background/conversation-session-background-bash-output.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "bgv-title",
  8. "metadata": {
  9. "kind": "common",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyIncludes": ["Generate a concise title", "E2E_BGV_"]
  18. },
  19. "response": {
  20. "statusCode": 200,
  21. "statusMessage": "OK",
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"bgv-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Background output\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":32,\"output_tokens\":8}}"
  26. }
  27. },
  28. {
  29. "id": "EXPLICIT-call",
  30. "metadata": {
  31. "kind": "main",
  32. "source": "synthetic",
  33. "timingPolicy": "fast-text",
  34. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  35. },
  36. "maxMatches": 1,
  37. "match": {
  38. "method": "POST",
  39. "pathIncludes": "/messages",
  40. "lastUserMessageIncludes": ["E2E_BGV_EXPLICIT"],
  41. "bodyExcludes": [
  42. "Generate a concise title",
  43. "CRITICAL: Respond with TEXT ONLY",
  44. "toolu_bgv_EXPLICIT"
  45. ]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "toolUses": [
  50. {
  51. "id": "toolu_bgv_EXPLICIT",
  52. "name": "Bash",
  53. "input": {
  54. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" EXPLICIT",
  55. "description": "EXPLICIT background output",
  56. "timeout": 120000,
  57. "run_in_background": true
  58. }
  59. }
  60. ]
  61. }
  62. },
  63. {
  64. "id": "EXPLICIT-done",
  65. "metadata": {
  66. "kind": "main",
  67. "source": "synthetic",
  68. "timingPolicy": "fast-text",
  69. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  70. },
  71. "match": {
  72. "method": "POST",
  73. "pathIncludes": "/messages",
  74. "bodyIncludes": ["toolu_bgv_EXPLICIT", "E2E_BGV_EXPLICIT"],
  75. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  76. },
  77. "response": {
  78. "statusCode": 200,
  79. "text": {
  80. "id": "EXPLICIT-done",
  81. "text": "E2E_BGV_EXPLICIT_DONE",
  82. "inputTokens": 96,
  83. "outputTokens": 16
  84. }
  85. }
  86. },
  87. {
  88. "id": "AUTO-call",
  89. "metadata": {
  90. "kind": "main",
  91. "source": "synthetic",
  92. "timingPolicy": "fast-text",
  93. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  94. },
  95. "maxMatches": 1,
  96. "match": {
  97. "method": "POST",
  98. "pathIncludes": "/messages",
  99. "lastUserMessageIncludes": ["E2E_BGV_AUTO"],
  100. "bodyExcludes": [
  101. "Generate a concise title",
  102. "CRITICAL: Respond with TEXT ONLY",
  103. "toolu_bgv_AUTO"
  104. ]
  105. },
  106. "response": {
  107. "statusCode": 200,
  108. "toolUses": [
  109. {
  110. "id": "toolu_bgv_AUTO",
  111. "name": "Bash",
  112. "input": {
  113. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" AUTO",
  114. "description": "AUTO background output",
  115. "timeout": 1
  116. }
  117. }
  118. ]
  119. }
  120. },
  121. {
  122. "id": "AUTO-done",
  123. "metadata": {
  124. "kind": "main",
  125. "source": "synthetic",
  126. "timingPolicy": "fast-text",
  127. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  128. },
  129. "match": {
  130. "method": "POST",
  131. "pathIncludes": "/messages",
  132. "bodyIncludes": ["toolu_bgv_AUTO", "E2E_BGV_AUTO"],
  133. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  134. },
  135. "response": {
  136. "statusCode": 200,
  137. "text": {
  138. "id": "AUTO-done",
  139. "text": "E2E_BGV_AUTO_DONE",
  140. "inputTokens": 96,
  141. "outputTokens": 16
  142. }
  143. }
  144. },
  145. {
  146. "id": "PAUSE-call",
  147. "metadata": {
  148. "kind": "main",
  149. "source": "synthetic",
  150. "timingPolicy": "fast-text",
  151. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  152. },
  153. "maxMatches": 1,
  154. "match": {
  155. "method": "POST",
  156. "pathIncludes": "/messages",
  157. "lastUserMessageIncludes": ["E2E_BGV_PAUSE"],
  158. "bodyExcludes": [
  159. "Generate a concise title",
  160. "CRITICAL: Respond with TEXT ONLY",
  161. "toolu_bgv_PAUSE"
  162. ]
  163. },
  164. "response": {
  165. "statusCode": 200,
  166. "toolUses": [
  167. {
  168. "id": "toolu_bgv_PAUSE",
  169. "name": "Bash",
  170. "input": {
  171. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" PAUSE",
  172. "description": "PAUSE background output",
  173. "timeout": 120000,
  174. "run_in_background": true
  175. }
  176. }
  177. ]
  178. }
  179. },
  180. {
  181. "id": "PAUSE-done",
  182. "metadata": {
  183. "kind": "main",
  184. "source": "synthetic",
  185. "timingPolicy": "fast-text",
  186. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  187. },
  188. "match": {
  189. "method": "POST",
  190. "pathIncludes": "/messages",
  191. "bodyIncludes": ["toolu_bgv_PAUSE", "E2E_BGV_PAUSE"],
  192. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  193. },
  194. "response": {
  195. "statusCode": 200,
  196. "text": {
  197. "id": "PAUSE-done",
  198. "text": "E2E_BGV_PAUSE_DONE",
  199. "inputTokens": 96,
  200. "outputTokens": 16
  201. }
  202. }
  203. },
  204. {
  205. "id": "SCOPE_A-call",
  206. "metadata": {
  207. "kind": "main",
  208. "source": "synthetic",
  209. "timingPolicy": "fast-text",
  210. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  211. },
  212. "maxMatches": 1,
  213. "match": {
  214. "method": "POST",
  215. "pathIncludes": "/messages",
  216. "lastUserMessageIncludes": ["E2E_BGV_SCOPE_A"],
  217. "bodyExcludes": [
  218. "Generate a concise title",
  219. "CRITICAL: Respond with TEXT ONLY",
  220. "toolu_bgv_SCOPE_A"
  221. ]
  222. },
  223. "response": {
  224. "statusCode": 200,
  225. "toolUses": [
  226. {
  227. "id": "toolu_bgv_SCOPE_A",
  228. "name": "Bash",
  229. "input": {
  230. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" SCOPE_A",
  231. "description": "SCOPE_A background output",
  232. "timeout": 120000,
  233. "run_in_background": true
  234. }
  235. }
  236. ]
  237. }
  238. },
  239. {
  240. "id": "SCOPE_A-done",
  241. "metadata": {
  242. "kind": "main",
  243. "source": "synthetic",
  244. "timingPolicy": "fast-text",
  245. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  246. },
  247. "match": {
  248. "method": "POST",
  249. "pathIncludes": "/messages",
  250. "bodyIncludes": ["toolu_bgv_SCOPE_A", "E2E_BGV_SCOPE_A"],
  251. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  252. },
  253. "response": {
  254. "statusCode": 200,
  255. "text": {
  256. "id": "SCOPE_A-done",
  257. "text": "E2E_BGV_SCOPE_A_DONE",
  258. "inputTokens": 96,
  259. "outputTokens": 16
  260. }
  261. }
  262. },
  263. {
  264. "id": "SCOPE_B-call",
  265. "metadata": {
  266. "kind": "main",
  267. "source": "synthetic",
  268. "timingPolicy": "fast-text",
  269. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  270. },
  271. "maxMatches": 1,
  272. "match": {
  273. "method": "POST",
  274. "pathIncludes": "/messages",
  275. "lastUserMessageIncludes": ["E2E_BGV_SCOPE_B"],
  276. "bodyExcludes": [
  277. "Generate a concise title",
  278. "CRITICAL: Respond with TEXT ONLY",
  279. "toolu_bgv_SCOPE_B"
  280. ]
  281. },
  282. "response": {
  283. "statusCode": 200,
  284. "toolUses": [
  285. {
  286. "id": "toolu_bgv_SCOPE_B",
  287. "name": "Bash",
  288. "input": {
  289. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" SCOPE_B",
  290. "description": "SCOPE_B background output",
  291. "timeout": 120000,
  292. "run_in_background": true
  293. }
  294. }
  295. ]
  296. }
  297. },
  298. {
  299. "id": "SCOPE_B-done",
  300. "metadata": {
  301. "kind": "main",
  302. "source": "synthetic",
  303. "timingPolicy": "fast-text",
  304. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  305. },
  306. "match": {
  307. "method": "POST",
  308. "pathIncludes": "/messages",
  309. "bodyIncludes": ["toolu_bgv_SCOPE_B", "E2E_BGV_SCOPE_B"],
  310. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  311. },
  312. "response": {
  313. "statusCode": 200,
  314. "text": {
  315. "id": "SCOPE_B-done",
  316. "text": "E2E_BGV_SCOPE_B_DONE",
  317. "inputTokens": 96,
  318. "outputTokens": 16
  319. }
  320. }
  321. },
  322. {
  323. "id": "ERROR-call",
  324. "metadata": {
  325. "kind": "main",
  326. "source": "synthetic",
  327. "timingPolicy": "fast-text",
  328. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  329. },
  330. "maxMatches": 1,
  331. "match": {
  332. "method": "POST",
  333. "pathIncludes": "/messages",
  334. "lastUserMessageIncludes": ["E2E_BGV_ERROR"],
  335. "bodyExcludes": [
  336. "Generate a concise title",
  337. "CRITICAL: Respond with TEXT ONLY",
  338. "toolu_bgv_ERROR"
  339. ]
  340. },
  341. "response": {
  342. "statusCode": 200,
  343. "toolUses": [
  344. {
  345. "id": "toolu_bgv_ERROR",
  346. "name": "Bash",
  347. "input": {
  348. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" ERROR",
  349. "description": "ERROR background output",
  350. "timeout": 120000,
  351. "run_in_background": true
  352. }
  353. }
  354. ]
  355. }
  356. },
  357. {
  358. "id": "ERROR-done",
  359. "metadata": {
  360. "kind": "main",
  361. "source": "synthetic",
  362. "timingPolicy": "fast-text",
  363. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  364. },
  365. "match": {
  366. "method": "POST",
  367. "pathIncludes": "/messages",
  368. "bodyIncludes": ["toolu_bgv_ERROR", "E2E_BGV_ERROR"],
  369. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  370. },
  371. "response": {
  372. "statusCode": 200,
  373. "text": {
  374. "id": "ERROR-done",
  375. "text": "E2E_BGV_ERROR_DONE",
  376. "inputTokens": 96,
  377. "outputTokens": 16
  378. }
  379. }
  380. },
  381. {
  382. "id": "STOP-call",
  383. "metadata": {
  384. "kind": "main",
  385. "source": "synthetic",
  386. "timingPolicy": "fast-text",
  387. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  388. },
  389. "maxMatches": 1,
  390. "match": {
  391. "method": "POST",
  392. "pathIncludes": "/messages",
  393. "lastUserMessageIncludes": ["E2E_BGV_STOP"],
  394. "bodyExcludes": [
  395. "Generate a concise title",
  396. "CRITICAL: Respond with TEXT ONLY",
  397. "toolu_bgv_STOP"
  398. ]
  399. },
  400. "response": {
  401. "statusCode": 200,
  402. "toolUses": [
  403. {
  404. "id": "toolu_bgv_STOP",
  405. "name": "Bash",
  406. "input": {
  407. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" STOP",
  408. "description": "STOP background output",
  409. "timeout": 120000,
  410. "run_in_background": true
  411. }
  412. }
  413. ]
  414. }
  415. },
  416. {
  417. "id": "STOP-done",
  418. "metadata": {
  419. "kind": "main",
  420. "source": "synthetic",
  421. "timingPolicy": "fast-text",
  422. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  423. },
  424. "match": {
  425. "method": "POST",
  426. "pathIncludes": "/messages",
  427. "bodyIncludes": ["toolu_bgv_STOP", "E2E_BGV_STOP"],
  428. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  429. },
  430. "response": {
  431. "statusCode": 200,
  432. "text": {
  433. "id": "STOP-done",
  434. "text": "E2E_BGV_STOP_DONE",
  435. "inputTokens": 96,
  436. "outputTokens": 16
  437. }
  438. }
  439. },
  440. {
  441. "id": "PARENT-call",
  442. "metadata": {
  443. "kind": "main",
  444. "source": "synthetic",
  445. "timingPolicy": "fast-text",
  446. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  447. },
  448. "maxMatches": 1,
  449. "match": {
  450. "method": "POST",
  451. "pathIncludes": "/messages",
  452. "lastUserMessageIncludes": ["E2E_BGV_PARENT:"],
  453. "bodyExcludes": [
  454. "Generate a concise title",
  455. "CRITICAL: Respond with TEXT ONLY",
  456. "toolu_bgv_parent"
  457. ]
  458. },
  459. "response": {
  460. "statusCode": 200,
  461. "toolUses": [
  462. {
  463. "id": "toolu_bgv_parent",
  464. "name": "Agent",
  465. "input": {
  466. "description": "background child output",
  467. "prompt": "E2E_BGV_CHILD_WORK: Start the exact background Bash writer fixture and return.",
  468. "subagent_type": "general-purpose",
  469. "run_in_background": true
  470. }
  471. }
  472. ]
  473. }
  474. },
  475. {
  476. "id": "PARENT-done",
  477. "metadata": {
  478. "kind": "main",
  479. "source": "synthetic",
  480. "timingPolicy": "fast-text",
  481. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  482. },
  483. "match": {
  484. "method": "POST",
  485. "pathIncludes": "/messages",
  486. "bodyIncludes": ["E2E_BGV_PARENT:", "toolu_bgv_parent"],
  487. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  488. },
  489. "response": {
  490. "statusCode": 200,
  491. "text": {
  492. "id": "parent-done",
  493. "text": "E2E_BGV_PARENT_DONE"
  494. }
  495. }
  496. },
  497. {
  498. "id": "CHILD-call",
  499. "metadata": {
  500. "kind": "subagent",
  501. "source": "synthetic",
  502. "timingPolicy": "fast-text",
  503. "syntheticReason": "固定 Bash tool call 和主轮收尾,实际进程及 canonical 文件由 barrier 控制;UI 查询不调用模型。"
  504. },
  505. "maxMatches": 1,
  506. "match": {
  507. "method": "POST",
  508. "pathIncludes": "/messages",
  509. "lastUserMessageIncludes": ["E2E_BGV_CHILD_WORK:"],
  510. "bodyExcludes": [
  511. "Generate a concise title",
  512. "CRITICAL: Respond with TEXT ONLY",
  513. "toolu_bgv_CHILD",
  514. "toolu_bgv_parent"
  515. ]
  516. },
  517. "response": {
  518. "statusCode": 200,
  519. "toolUses": [
  520. {
  521. "id": "toolu_bgv_CHILD",
  522. "name": "Bash",
  523. "input": {
  524. "command": "node \".zcode-e2e/background-bash-output/中文 空格/writer.cjs\" CHILD",
  525. "description": "child background output",
  526. "timeout": 120000,
  527. "run_in_background": true
  528. }
  529. }
  530. ]
  531. }
  532. },
  533. {
  534. "id": "CHILD-done",
  535. "metadata": {
  536. "kind": "subagent",
  537. "source": "synthetic",
  538. "timingPolicy": "delayed-text",
  539. "syntheticReason": "child Bash 在真实后台运行时保持 child 模型请求在途,以验证现有子会话条目及 Stop。"
  540. },
  541. "match": {
  542. "method": "POST",
  543. "pathIncludes": "/messages",
  544. "bodyIncludes": ["E2E_BGV_CHILD_WORK:", "toolu_bgv_CHILD"],
  545. "bodyExcludes": [
  546. "Generate a concise title",
  547. "CRITICAL: Respond with TEXT ONLY",
  548. "toolu_bgv_parent"
  549. ]
  550. },
  551. "response": {
  552. "statusCode": 200,
  553. "text": {
  554. "id": "child-done",
  555. "text": "CHILD_READY"
  556. },
  557. "delayMs": 60000
  558. }
  559. }
  560. ]
  561. }