conversation-session-background.json 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-background",
  4. "spec": "./test/e2e/conversation-session/background/conversation-session-background.test.ts",
  5. "providerFixtures": [
  6. "./test/e2e/fixtures/upstream/common.json",
  7. "./test/e2e/fixtures/upstream/conversation-session/conversation-session-background.json"
  8. ],
  9. "fileFixtures": [
  10. {
  11. "path": ".zcode-e2e/conversation-session-background/bg08-launcher.cjs",
  12. "source": "created-by-spec",
  13. "description": "BG08 由 spec 写入 launcher,真实启动跨 PGID worker 并留下 fresh PID marker。"
  14. }
  15. ],
  16. "requests": [
  17. {
  18. "id": "upstream-background-title",
  19. "kind": "common",
  20. "source": "synthetic",
  21. "timingPolicy": "fast-text",
  22. "syntheticReason": "标题不属于 background runtime task 语义;同一 spec 还包含 foreground 对照组,因此按通用 E2E marker 稳定返回,避免标题请求重试阻塞业务请求。"
  23. },
  24. {
  25. "id": "upstream-background-agent-tool-call",
  26. "kind": "main",
  27. "source": "synthetic",
  28. "timingPolicy": "fast-tool-use",
  29. "syntheticReason": "稳定触发 Agent(run_in_background=true),验证 background Agent notification wake。"
  30. },
  31. {
  32. "id": "upstream-background-agent-launch-ack",
  33. "kind": "main",
  34. "source": "synthetic",
  35. "timingPolicy": "fast-text",
  36. "syntheticReason": "父模型在 async launch tool result 后结束当前 turn。"
  37. },
  38. {
  39. "id": "upstream-background-agent-child-delayed-result",
  40. "kind": "subagent",
  41. "source": "synthetic",
  42. "timingPolicy": "delayed-text",
  43. "syntheticReason": "延迟子 agent 完成,稳定制造 parent idle wake。"
  44. },
  45. {
  46. "id": "upstream-background-agent-notification-consumed",
  47. "kind": "main",
  48. "source": "synthetic",
  49. "timingPolicy": "task-notification",
  50. "syntheticReason": "验证 provider-visible request 消费 <task-notification>。 验证来源提示及非用户授权边界。"
  51. },
  52. {
  53. "id": "upstream-background-agent-notification-consumed-after-history-tool",
  54. "kind": "main",
  55. "source": "synthetic",
  56. "timingPolicy": "task-notification",
  57. "syntheticReason": "验证 provider-visible request 消费 <task-notification>。 验证来源提示及非用户授权边界。"
  58. },
  59. {
  60. "id": "upstream-background-bash-tool-call",
  61. "kind": "main",
  62. "source": "synthetic",
  63. "timingPolicy": "fast-tool-use",
  64. "syntheticReason": "稳定触发 Bash(run_in_background=true)。"
  65. },
  66. {
  67. "id": "upstream-background-bash-launch-ack",
  68. "kind": "main",
  69. "source": "synthetic",
  70. "timingPolicy": "fast-text",
  71. "syntheticReason": "父模型在 backgrounded Bash tool result 后结束当前 turn。"
  72. },
  73. {
  74. "id": "upstream-background-bash-notification-consumed",
  75. "kind": "main",
  76. "source": "synthetic",
  77. "timingPolicy": "task-notification",
  78. "syntheticReason": "验证 Bash completion notification 进入父模型请求。 验证来源提示及非用户授权边界。"
  79. },
  80. {
  81. "id": "upstream-background-bash-notification-consumed-after-history-tool",
  82. "kind": "main",
  83. "source": "synthetic",
  84. "timingPolicy": "task-notification",
  85. "syntheticReason": "验证 Bash completion notification 进入父模型请求。 验证来源提示及非用户授权边界。"
  86. },
  87. {
  88. "id": "upstream-background-direct-user-prompt-bash-tool-call",
  89. "kind": "main",
  90. "source": "synthetic",
  91. "timingPolicy": "fast-tool-use",
  92. "syntheticReason": "稳定制造 main idle 但 background task 仍 running 的窗口,验证后续用户普通消息不会进入 queued prompt。"
  93. },
  94. {
  95. "id": "upstream-background-direct-user-prompt-launch-ack",
  96. "kind": "main",
  97. "source": "synthetic",
  98. "timingPolicy": "fast-text",
  99. "syntheticReason": "让 main 回到 idle,但统一 background control UI 仍有 running Bash task。"
  100. },
  101. {
  102. "id": "upstream-background-direct-user-prompt-received",
  103. "kind": "main",
  104. "source": "synthetic",
  105. "timingPolicy": "fast-text",
  106. "syntheticReason": "验证 background task running 不会把用户普通消息放入 queue,而是立即进入 provider request。"
  107. },
  108. {
  109. "id": "upstream-background-direct-user-prompt-stop-notification-consumed",
  110. "kind": "main",
  111. "source": "synthetic",
  112. "timingPolicy": "task-notification",
  113. "syntheticReason": "测试结束前收口长时间 background Bash,避免留下后台进程,同时验证 stop notification 仍走标准链路。 验证来源提示及非用户授权边界。"
  114. },
  115. {
  116. "id": "upstream-background-compact-after-idle-bash-tool-call",
  117. "kind": "main",
  118. "source": "synthetic",
  119. "timingPolicy": "fast-tool-use",
  120. "syntheticReason": "稳定制造 main idle 但 background task running 的窗口,验证此时允许 manual compact。"
  121. },
  122. {
  123. "id": "upstream-background-compact-after-idle-launch-ack",
  124. "kind": "main",
  125. "source": "synthetic",
  126. "timingPolicy": "fast-text",
  127. "syntheticReason": "让 main 回到 idle,后续手动 compact 不应被 background running 阻塞。"
  128. },
  129. {
  130. "id": "upstream-background-compact-after-idle-summary",
  131. "kind": "main",
  132. "source": "synthetic",
  133. "timingPolicy": "fast-json",
  134. "syntheticReason": "给 background completion notification 的后续请求留下可断言的 compact 后摘要 marker。"
  135. },
  136. {
  137. "id": "upstream-background-compact-after-idle-notification-consumed",
  138. "kind": "main",
  139. "source": "synthetic",
  140. "timingPolicy": "task-notification",
  141. "syntheticReason": "验证 compact 后 background completion notification 仍进入父模型请求,且请求上下文来自 compact 后摘要。 验证来源提示及非用户授权边界。"
  142. },
  143. {
  144. "id": "upstream-background-auto-timeout-bash-tool-call",
  145. "kind": "main",
  146. "source": "synthetic",
  147. "timingPolicy": "fast-tool-use",
  148. "syntheticReason": "稳定触发 foreground Bash timeout auto-background,验证没有显式 run_in_background 时也能进入 background task control UI。"
  149. },
  150. {
  151. "id": "upstream-background-auto-timeout-bash-launch-ack",
  152. "kind": "main",
  153. "source": "synthetic",
  154. "timingPolicy": "fast-text",
  155. "syntheticReason": "让 UI 在 Bash 自然完成前展示 auto-background 后的 running control row。"
  156. },
  157. {
  158. "id": "upstream-background-auto-timeout-bash-notification-consumed",
  159. "kind": "main",
  160. "source": "synthetic",
  161. "timingPolicy": "task-notification",
  162. "syntheticReason": "验证 auto-background Bash 自然完成后 provider-visible notification 和 UI control row cleanup。 验证来源提示及非用户授权边界。"
  163. },
  164. {
  165. "id": "upstream-bg37-explicit-timeout-tool-call",
  166. "kind": "main",
  167. "source": "synthetic",
  168. "timingPolicy": "fast-tool-use",
  169. "syntheticReason": "稳定验证 explicit background commit 后 input timeout 不再终止进程。"
  170. },
  171. {
  172. "id": "upstream-bg37-explicit-timeout-launch-ack",
  173. "kind": "main",
  174. "source": "synthetic",
  175. "timingPolicy": "fast-text",
  176. "syntheticReason": "保留 input timeout 后仍可见的 running control row 窗口。"
  177. },
  178. {
  179. "id": "upstream-bg37-explicit-timeout-auto-compact-summary",
  180. "kind": "main",
  181. "source": "synthetic",
  182. "timingPolicy": "fast-text",
  183. "syntheticReason": "Bash prompt 变长后该轮会先自动 compact;固定 summary 以继续验证 completion notification,而不是让 replay 缺 fixture。"
  184. },
  185. {
  186. "id": "upstream-bg37-explicit-timeout-notification-consumed",
  187. "kind": "main",
  188. "source": "synthetic",
  189. "timingPolicy": "task-notification",
  190. "syntheticReason": "验证 explicit Bash 越过 input timeout 后自然完成且只通知一次。 验证来源提示及非用户授权边界。"
  191. },
  192. {
  193. "id": "upstream-bg38-parent-abort-tool-call",
  194. "kind": "main",
  195. "source": "synthetic",
  196. "timingPolicy": "fast-tool-use",
  197. "syntheticReason": "后台命令先写 started marker,再由测试停止仍 active 的 parent turn。"
  198. },
  199. {
  200. "id": "upstream-bg38-parent-abort-launch-running",
  201. "kind": "main",
  202. "source": "synthetic",
  203. "timingPolicy": "controlled-stream",
  204. "syntheticReason": "延迟 launch response,稳定制造 task 已 commit 但 parent turn 仍 active 的 abort 窗口。"
  205. },
  206. {
  207. "id": "upstream-bg38-parent-abort-notification-consumed",
  208. "kind": "main",
  209. "source": "synthetic",
  210. "timingPolicy": "task-notification",
  211. "syntheticReason": "验证 parent abort 不会杀死已 commit Bash,且不会产生重复 notification。 验证来源提示及非用户授权边界。"
  212. },
  213. {
  214. "id": "upstream-bg39-sleep-hard-timeout-tool-call",
  215. "kind": "main",
  216. "source": "synthetic",
  217. "timingPolicy": "fast-tool-use",
  218. "syntheticReason": "稳定验证首 token sleep 沿用 foreground hard timeout,不进入 auto-background。"
  219. },
  220. {
  221. "id": "upstream-bg39-sleep-hard-timeout-completed",
  222. "kind": "main",
  223. "source": "synthetic",
  224. "timingPolicy": "fast-text",
  225. "syntheticReason": "验证 provider-visible result 为 foreground 硬超时(Exit code 143 与超时行),且没有 background notification。"
  226. },
  227. {
  228. "id": "upstream-background-cancel-bash-tool-call",
  229. "kind": "main",
  230. "source": "synthetic",
  231. "timingPolicy": "fast-tool-use",
  232. "syntheticReason": "稳定触发由 Bash job control 构造的跨 PGID launcher/worker 子树,用于验证统一 background control UI 的 stop 杀树路径。"
  233. },
  234. {
  235. "id": "upstream-background-cancel-bash-launch-ack",
  236. "kind": "main",
  237. "source": "synthetic",
  238. "timingPolicy": "fast-text",
  239. "syntheticReason": "让 UI 在 idle 状态展示 running background Bash control,随后由测试点击 stop。"
  240. },
  241. {
  242. "id": "upstream-background-cancel-bash-notification-consumed",
  243. "kind": "main",
  244. "source": "synthetic",
  245. "timingPolicy": "task-notification",
  246. "syntheticReason": "验证 UI stop Bash 仍走 background task notification,而不是只在 UI 本地消失。 验证来源提示及非用户授权边界。"
  247. },
  248. {
  249. "id": "upstream-background-cancel-agent-tool-call",
  250. "kind": "main",
  251. "source": "synthetic",
  252. "timingPolicy": "fast-tool-use",
  253. "syntheticReason": "稳定触发 running local_agent task,验证统一 background control UI 能停止 subagent。"
  254. },
  255. {
  256. "id": "upstream-background-cancel-agent-launch-ack",
  257. "kind": "main",
  258. "source": "synthetic",
  259. "timingPolicy": "fast-text",
  260. "syntheticReason": "让 UI 在 idle 状态展示 running background Agent control,随后由测试点击 stop。"
  261. },
  262. {
  263. "id": "upstream-background-cancel-agent-child-delayed-result",
  264. "kind": "subagent",
  265. "source": "synthetic",
  266. "timingPolicy": "delayed-text",
  267. "syntheticReason": "保持 child provider request 运行,验证 stop 会 abort running background Agent。"
  268. },
  269. {
  270. "id": "upstream-background-cancel-agent-notification-consumed",
  271. "kind": "main",
  272. "source": "synthetic",
  273. "timingPolicy": "task-notification",
  274. "syntheticReason": "验证 UI stop subagent 复用 local_agent task notification 链路。 验证来源提示及非用户授权边界。"
  275. },
  276. {
  277. "id": "upstream-background-taskstop-agent-tool-call",
  278. "kind": "main",
  279. "source": "synthetic",
  280. "timingPolicy": "fast-tool-use",
  281. "syntheticReason": "稳定触发 running local_agent task,后续 provider replay 用 TaskStop 停止它。"
  282. },
  283. {
  284. "id": "upstream-background-taskstop-agent-tool-stop",
  285. "kind": "main",
  286. "source": "synthetic",
  287. "timingPolicy": "fast-tool-use",
  288. "syntheticReason": "验证 provider-visible TaskStop tool 会复用 runtime background stop dispatcher。"
  289. },
  290. {
  291. "id": "upstream-background-taskstop-agent-child-delayed-result",
  292. "kind": "subagent",
  293. "source": "synthetic",
  294. "timingPolicy": "delayed-text",
  295. "syntheticReason": "保持 child provider request 运行,验证 TaskStop 会 abort running background Agent。"
  296. },
  297. {
  298. "id": "upstream-background-taskstop-agent-notification-consumed",
  299. "kind": "main",
  300. "source": "synthetic",
  301. "timingPolicy": "task-notification",
  302. "syntheticReason": "验证 TaskStop tool result 和 stopped notification 在同一 runtime queue/active-loop 链路中收口。 验证来源提示及非用户授权边界。"
  303. },
  304. {
  305. "id": "upstream-background-active-loop-bash-tool-calls",
  306. "kind": "main",
  307. "source": "synthetic",
  308. "timingPolicy": "fast-tool-use",
  309. "syntheticReason": "稳定触发 active-loop background notification intake:Bash 先因短 timeout 转后台,命令随即完成并在后续 provider request 前入队 notification。"
  310. },
  311. {
  312. "id": "upstream-background-active-loop-notification-consumed",
  313. "kind": "main",
  314. "source": "synthetic",
  315. "timingPolicy": "task-notification",
  316. "syntheticReason": "验证同一次 provider request 同时包含上一轮 Bash tool result 与 <task-notification>,而不是等 idle wake 单独开一轮。 验证来源提示及非用户授权边界。"
  317. },
  318. {
  319. "id": "upstream-background-goal-seed",
  320. "kind": "main",
  321. "source": "synthetic",
  322. "timingPolicy": "fast-text",
  323. "syntheticReason": "V4 /goal 需要已有 session;首轮仅建立 BG34 的稳定会话边界。"
  324. },
  325. {
  326. "id": "upstream-background-goal-agent-tool-call",
  327. "kind": "main",
  328. "source": "synthetic",
  329. "timingPolicy": "fast-tool-use",
  330. "syntheticReason": "goal continuation 中启动 background Agent。"
  331. },
  332. {
  333. "id": "upstream-background-goal-agent-launch-ack",
  334. "kind": "main",
  335. "source": "synthetic",
  336. "timingPolicy": "fast-text",
  337. "syntheticReason": "goal continuation 的当前 turn 在子任务完成前先结束。"
  338. },
  339. {
  340. "id": "upstream-background-goal-direct-prompt",
  341. "kind": "main",
  342. "source": "synthetic",
  343. "timingPolicy": "fast-text",
  344. "syntheticReason": "稳定证明 active goal 的 background-only 状态不等于 main busy,用户输入不经过 future queue。"
  345. },
  346. {
  347. "id": "upstream-background-goal-child-delayed-result",
  348. "kind": "subagent",
  349. "source": "synthetic",
  350. "timingPolicy": "delayed-text",
  351. "syntheticReason": "延迟子 agent 完成,证明 verifier 会等 notification。"
  352. },
  353. {
  354. "id": "upstream-background-goal-notification-consumed",
  355. "kind": "main",
  356. "source": "synthetic",
  357. "timingPolicy": "task-notification",
  358. "syntheticReason": "goal notification turn 消费子结果。 验证来源提示及非用户授权边界。"
  359. },
  360. {
  361. "id": "upstream-background-goal-verifier-passed",
  362. "kind": "goal-verifier",
  363. "source": "synthetic",
  364. "timingPolicy": "controlled-stream",
  365. "syntheticReason": "验证 verifier 只在 notification 后执行并通过,并稳定留出 future queue admission 窗口。"
  366. },
  367. {
  368. "id": "upstream-background-goal-verifier-queue-drained",
  369. "kind": "main",
  370. "source": "synthetic",
  371. "timingPolicy": "fast-text",
  372. "syntheticReason": "稳定验证 TargetChanged(complete) 本身会重新评估 CLI queue gate 并自动提升队首。"
  373. },
  374. {
  375. "id": "upstream-background-send-agent-tool-call",
  376. "kind": "main",
  377. "source": "synthetic",
  378. "timingPolicy": "fast-tool-use",
  379. "syntheticReason": "稳定触发 Agent(run_in_background=true),后续用 SendMessage 验证 running child steer。"
  380. },
  381. {
  382. "id": "upstream-background-send-message-tool-call",
  383. "kind": "main",
  384. "source": "synthetic",
  385. "timingPolicy": "fast-tool-use",
  386. "syntheticReason": "根据 Agent tool result 中的 agentId 调用 SendMessage,验证父 agent 能 steer running child。"
  387. },
  388. {
  389. "id": "upstream-background-send-message-ack",
  390. "kind": "main",
  391. "source": "synthetic",
  392. "timingPolicy": "fast-text",
  393. "syntheticReason": "父模型收到 SendMessage tool result 后结束当前 turn,等待 background notification。"
  394. },
  395. {
  396. "id": "upstream-background-send-child-bash-tool-call",
  397. "kind": "subagent",
  398. "source": "synthetic",
  399. "timingPolicy": "fast-tool-use",
  400. "syntheticReason": "子 agent 首轮立即释放 provider 连接,但通过 build mode 可直接允许且不会自动后台化的 sleep foreground Bash 保持 active turn,稳定覆盖 running child steer。"
  401. },
  402. {
  403. "id": "upstream-background-send-child-steered-result",
  404. "kind": "subagent",
  405. "source": "synthetic",
  406. "timingPolicy": "fast-text",
  407. "syntheticReason": "验证子 agent 的 provider-visible request 收到完整 coordinator 中途提示。 验证来源提示及非用户授权边界。"
  408. },
  409. {
  410. "id": "upstream-background-send-notification-consumed",
  411. "kind": "main",
  412. "source": "synthetic",
  413. "timingPolicy": "task-notification",
  414. "syntheticReason": "验证 SendMessage steer 后的子 agent completion 仍走 background notification。 验证来源提示及非用户授权边界。"
  415. },
  416. {
  417. "id": "upstream-foreground-long-bash-loading-tool-call",
  418. "kind": "main",
  419. "source": "synthetic",
  420. "timingPolicy": "fast-tool-use",
  421. "syntheticReason": "稳定制造普通 foreground Bash running 窗口,验证 background event 豁免没有误伤前台 loading。"
  422. },
  423. {
  424. "id": "upstream-foreground-long-bash-loading-completed",
  425. "kind": "main",
  426. "source": "synthetic",
  427. "timingPolicy": "fast-text",
  428. "syntheticReason": "验证 foreground Bash 完成后仍正常进入 provider continuation 并回到 idle。"
  429. },
  430. {
  431. "id": "upstream-foreground-child-tool-streaming-agent-tool-call",
  432. "kind": "main",
  433. "source": "synthetic",
  434. "timingPolicy": "fast-tool-use",
  435. "syntheticReason": "稳定触发 foreground Agent,让 child Bash 运行期间验证 parent loading 仍按原语义显示。"
  436. },
  437. {
  438. "id": "upstream-foreground-child-tool-streaming-child-bash-tool-call",
  439. "kind": "subagent",
  440. "source": "synthetic",
  441. "timingPolicy": "fast-tool-use",
  442. "syntheticReason": "用真实 child Bash tool update 覆盖 foreground mirrored subagent event 的 streaming 保留分支。"
  443. },
  444. {
  445. "id": "upstream-foreground-child-tool-streaming-child-done",
  446. "kind": "subagent",
  447. "source": "synthetic",
  448. "timingPolicy": "fast-text",
  449. "syntheticReason": "让 foreground Agent 正常完成并把结果回传父 turn。"
  450. },
  451. {
  452. "id": "upstream-foreground-child-tool-streaming-completed",
  453. "kind": "main",
  454. "source": "synthetic",
  455. "timingPolicy": "fast-text",
  456. "syntheticReason": "验证 foreground subagent child tool running 窗口后,父 turn 正常收口。"
  457. },
  458. {
  459. "id": "upstream-background-child-tool-idle-agent-tool-call",
  460. "kind": "main",
  461. "source": "synthetic",
  462. "timingPolicy": "fast-tool-use",
  463. "syntheticReason": "稳定触发 background Agent,让 child Bash 运行期间验证 parent idle UI 不显示 fake loading。"
  464. },
  465. {
  466. "id": "upstream-background-child-tool-idle-agent-launch-ack",
  467. "kind": "main",
  468. "source": "synthetic",
  469. "timingPolicy": "fast-text",
  470. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn,制造 parent idle + child tool running 窗口。"
  471. },
  472. {
  473. "id": "upstream-background-child-tool-idle-child-bash-tool-call",
  474. "kind": "subagent",
  475. "source": "synthetic",
  476. "timingPolicy": "fast-tool-use",
  477. "syntheticReason": "用真实 child Bash tool update 覆盖 mirrored background subagent event 的 UI streaming 保护。"
  478. },
  479. {
  480. "id": "upstream-background-child-tool-idle-child-done",
  481. "kind": "subagent",
  482. "source": "synthetic",
  483. "timingPolicy": "fast-text",
  484. "syntheticReason": "让 background Agent 正常完成并产生 parent notification。"
  485. },
  486. {
  487. "id": "upstream-background-child-tool-idle-notification-consumed",
  488. "kind": "main",
  489. "source": "synthetic",
  490. "timingPolicy": "task-notification",
  491. "syntheticReason": "验证 child tool running 窗口后,Agent completion 仍走标准 task-notification 链路。 验证来源提示及非用户授权边界。"
  492. },
  493. {
  494. "id": "upstream-background-child-tool-parent-anchor-agent-tool-call",
  495. "kind": "main",
  496. "source": "synthetic",
  497. "timingPolicy": "fast-tool-use",
  498. "syntheticReason": "稳定制造 background Agent 已启动、父会话已 idle、后续主回复已完成后 child tool update 才到达的 live 聚合窗口。"
  499. },
  500. {
  501. "id": "upstream-background-child-tool-parent-anchor-launch-ack",
  502. "kind": "main",
  503. "source": "synthetic",
  504. "timingPolicy": "fast-text",
  505. "syntheticReason": "让父会话先回 idle,随后用户可发送第二条主消息。"
  506. },
  507. {
  508. "id": "upstream-background-child-tool-parent-anchor-follow-up",
  509. "kind": "main",
  510. "source": "synthetic",
  511. "timingPolicy": "fast-text",
  512. "syntheticReason": "在 child tool update 到达前创建新的主 assistant 回复,用来复现 live child tool 被错误挂到最新回复下的问题。"
  513. },
  514. {
  515. "id": "upstream-background-child-tool-parent-anchor-child-bash-tool-call",
  516. "kind": "subagent",
  517. "source": "synthetic",
  518. "timingPolicy": "delayed-tool-use",
  519. "syntheticReason": "延迟 child Bash tool_use,稳定验证 mirrored child tool update 必须按 parentToolUseId 回挂原 Agent message。"
  520. },
  521. {
  522. "id": "upstream-background-child-tool-parent-anchor-child-done",
  523. "kind": "subagent",
  524. "source": "synthetic",
  525. "timingPolicy": "fast-text",
  526. "syntheticReason": "让 background Agent 正常完成并产生 parent notification。"
  527. },
  528. {
  529. "id": "upstream-background-child-tool-parent-anchor-notification-consumed",
  530. "kind": "main",
  531. "source": "synthetic",
  532. "timingPolicy": "task-notification",
  533. "syntheticReason": "验证 child tool placement 修复不影响标准 task-notification 收口。 验证来源提示及非用户授权边界。"
  534. },
  535. {
  536. "id": "upstream-background-session-switch-agent-tool-call",
  537. "kind": "main",
  538. "source": "synthetic",
  539. "timingPolicy": "fast-tool-use",
  540. "syntheticReason": "稳定制造 background Agent + child Bash tool 已出现,随后切走父 session 的窗口。"
  541. },
  542. {
  543. "id": "upstream-background-session-switch-launch-ack",
  544. "kind": "main",
  545. "source": "synthetic",
  546. "timingPolicy": "fast-text",
  547. "syntheticReason": "让父会话先回 idle,随后测试切到其他 session/draft。"
  548. },
  549. {
  550. "id": "upstream-background-session-switch-child-bash-tool-call",
  551. "kind": "subagent",
  552. "source": "synthetic",
  553. "timingPolicy": "delayed-tool-use",
  554. "syntheticReason": "先让 child Bash running card 进入父 renderer store;命令等待文件 barrier,由测试在父 session 隐藏后释放。"
  555. },
  556. {
  557. "id": "upstream-background-session-switch-child-done",
  558. "kind": "subagent",
  559. "source": "synthetic",
  560. "timingPolicy": "fast-text",
  561. "syntheticReason": "让 hidden/tombstoned terminal tool update 和 Agent completion notification 都完成。"
  562. },
  563. {
  564. "id": "upstream-background-session-switch-notification-consumed",
  565. "kind": "main",
  566. "source": "synthetic",
  567. "timingPolicy": "task-notification",
  568. "syntheticReason": "验证切回后 UI 从 store/snapshot 恢复 terminal child tool 投影。 验证来源提示及非用户授权边界。"
  569. },
  570. {
  571. "id": "upstream-background-switch-back-running-agent-tool-call",
  572. "kind": "main",
  573. "source": "synthetic",
  574. "timingPolicy": "fast-tool-use",
  575. "syntheticReason": "稳定制造 background Agent + child Bash tool 已出现且切回时仍 running 的窗口。"
  576. },
  577. {
  578. "id": "upstream-background-switch-back-running-launch-ack",
  579. "kind": "main",
  580. "source": "synthetic",
  581. "timingPolicy": "fast-text",
  582. "syntheticReason": "让父会话先回 idle,随后测试切到其他 session/draft 后立即切回。"
  583. },
  584. {
  585. "id": "upstream-background-switch-back-running-child-bash-tool-call",
  586. "kind": "subagent",
  587. "source": "synthetic",
  588. "timingPolicy": "delayed-tool-use",
  589. "syntheticReason": "先让 child Bash running card 进入父 renderer store,并保持足够长时间覆盖切回时仍 running 的窗口。"
  590. },
  591. {
  592. "id": "upstream-background-switch-back-running-child-done",
  593. "kind": "subagent",
  594. "source": "synthetic",
  595. "timingPolicy": "fast-text",
  596. "syntheticReason": "验证切回可见状态后 child Bash terminal update 仍会 patch 同一 tool card。"
  597. },
  598. {
  599. "id": "upstream-background-switch-back-running-notification-consumed",
  600. "kind": "main",
  601. "source": "synthetic",
  602. "timingPolicy": "task-notification",
  603. "syntheticReason": "验证切回后后续 Agent completion notification 仍按标准链路消费。 验证来源提示及非用户授权边界。"
  604. },
  605. {
  606. "id": "upstream-background-send-now-queue-agent-tool-call",
  607. "kind": "main",
  608. "source": "synthetic",
  609. "timingPolicy": "fast-tool-use",
  610. "syntheticReason": "稳定制造 main idle + background-only child tool running + held queue 的窗口,复现 queued prompt Send now 不应 stop background task。"
  611. },
  612. {
  613. "id": "upstream-background-send-now-queue-agent-launch-ack",
  614. "kind": "main",
  615. "source": "synthetic",
  616. "timingPolicy": "fast-text",
  617. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn,制造 parent idle + child tool running 窗口。"
  618. },
  619. {
  620. "id": "upstream-background-send-now-queue-child-bash-tool-call",
  621. "kind": "subagent",
  622. "source": "synthetic",
  623. "timingPolicy": "fast-tool-use",
  624. "syntheticReason": "用文件 barrier 控制真实 child Bash 生命周期,让父侧 raw runtime streaming 但 mainActive=false;点击 Send now 后再释放,避免固定 sleep 受全量负载影响。"
  625. },
  626. {
  627. "id": "upstream-background-send-now-queue-hold",
  628. "kind": "main",
  629. "source": "synthetic",
  630. "timingPolicy": "controlled-stream",
  631. "syntheticReason": "使用真实主 turn 与 composer queue 替代已删除的 renderer store 注入,稳定构造 stop 后 background-only + paused queue。"
  632. },
  633. {
  634. "id": "upstream-background-send-now-queue-prompt-received",
  635. "kind": "main",
  636. "source": "synthetic",
  637. "timingPolicy": "fast-text",
  638. "syntheticReason": "验证 background-only running 下 queued prompt Send now 直接触发 provider request,而不是先 stop background task。"
  639. },
  640. {
  641. "id": "upstream-background-send-now-queue-child-done",
  642. "kind": "subagent",
  643. "source": "synthetic",
  644. "timingPolicy": "fast-text",
  645. "syntheticReason": "证明 Send now 没有停止 background Agent;child Bash 自然完成后 Agent 继续产生 completion notification。"
  646. },
  647. {
  648. "id": "upstream-background-send-now-queue-notification-consumed",
  649. "kind": "main",
  650. "source": "synthetic",
  651. "timingPolicy": "task-notification",
  652. "syntheticReason": "验证 queued Send now 后 background Agent completion 仍走标准 task-notification 链路。 验证来源提示及非用户授权边界。"
  653. },
  654. {
  655. "id": "upstream-background-queue-drain-agent-tool-call",
  656. "kind": "main",
  657. "source": "synthetic",
  658. "timingPolicy": "fast-tool-use",
  659. "syntheticReason": "稳定启动真实 background Agent;后续 delayed launch ack 再制造 main running + background running 的 queue 窗口。"
  660. },
  661. {
  662. "id": "upstream-background-queue-drain-agent-launch-ack",
  663. "kind": "main",
  664. "source": "synthetic",
  665. "timingPolicy": "controlled-stream",
  666. "syntheticReason": "延迟父模型 launch ack,稳定制造 background Agent 已 running、main turn 仍 active 时用户消息进入 renderer queue。"
  667. },
  668. {
  669. "id": "upstream-background-queue-drain-child-delayed-result",
  670. "kind": "subagent",
  671. "source": "synthetic",
  672. "timingPolicy": "controlled-stream",
  673. "syntheticReason": "受控挂起 background Agent completion,测试在 Q4 回复完成后再放行,notification 才不会抢在 queued prompt drain 验证前进入父会话。固定延迟会被慢机器上的 drain 间隔追上。"
  674. },
  675. {
  676. "id": "upstream-background-queue-drain-first-queued-prompt",
  677. "kind": "main",
  678. "source": "synthetic",
  679. "timingPolicy": "controlled-stream",
  680. "syntheticReason": "延迟 Q2 响应,稳定验证 launch ack 前已入队的 Q3/Q4 不会在 Q2 drain 后丢失。"
  681. },
  682. {
  683. "id": "upstream-background-queue-drain-second-queued-prompt",
  684. "kind": "main",
  685. "source": "synthetic",
  686. "timingPolicy": "controlled-stream",
  687. "syntheticReason": "延迟 Q3 响应,稳定观察 Q3 已渲染为 user message 且 Q4 仍留在 queue 的 UI 窗口。"
  688. },
  689. {
  690. "id": "upstream-background-queue-drain-third-queued-prompt",
  691. "kind": "main",
  692. "source": "synthetic",
  693. "timingPolicy": "controlled-stream",
  694. "syntheticReason": "延迟 Q4 响应,稳定观察 Q4 drain 后已渲染为 user message。"
  695. },
  696. {
  697. "id": "upstream-background-queue-drain-notification-consumed",
  698. "kind": "main",
  699. "source": "synthetic",
  700. "timingPolicy": "task-notification",
  701. "syntheticReason": "验证 queued prompt drain 不会丢失后续 background Agent completion notification。 验证来源提示及非用户授权边界。"
  702. },
  703. {
  704. "id": "upstream-background-nested-agent-tool-call",
  705. "kind": "main",
  706. "source": "synthetic",
  707. "timingPolicy": "fast-tool-use",
  708. "syntheticReason": "稳定触发 background Agent 内部启动 background Bash,验证 parent surface 只消费 Agent completion。"
  709. },
  710. {
  711. "id": "upstream-background-nested-agent-launch-ack",
  712. "kind": "main",
  713. "source": "synthetic",
  714. "timingPolicy": "fast-text",
  715. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn。"
  716. },
  717. {
  718. "id": "upstream-background-nested-child-bash-tool-call",
  719. "kind": "subagent",
  720. "source": "synthetic",
  721. "timingPolicy": "fast-tool-use",
  722. "syntheticReason": "稳定触发 child runtime 内部 Bash(run_in_background=true)。"
  723. },
  724. {
  725. "id": "upstream-background-nested-child-stops-after-bash-launch",
  726. "kind": "subagent",
  727. "source": "synthetic",
  728. "timingPolicy": "fast-text",
  729. "syntheticReason": "证明 parent Agent completion 不等待 nested Bash terminal。"
  730. },
  731. {
  732. "id": "upstream-background-nested-notification-consumed",
  733. "kind": "main",
  734. "source": "synthetic",
  735. "timingPolicy": "task-notification",
  736. "syntheticReason": "验证 parent surface 只消费 Agent completion notification。 验证来源提示及非用户授权边界。"
  737. },
  738. {
  739. "id": "upstream-background-snapshot-control-ready",
  740. "kind": "main",
  741. "source": "synthetic",
  742. "timingPolicy": "fast-tool-use",
  743. "syntheticReason": "稳定启动两个 background Bash:第一个先完成,第二个保持 running,用真实右上角 background control 面板复现闪没场景。"
  744. },
  745. {
  746. "id": "upstream-background-snapshot-control-launch-ack",
  747. "kind": "main",
  748. "source": "synthetic",
  749. "timingPolicy": "fast-text",
  750. "syntheticReason": "让 main 回到 idle,同时右上角 background control 面板仍有两个 running Bash row。"
  751. },
  752. {
  753. "id": "upstream-background-snapshot-control-first-notification",
  754. "kind": "main",
  755. "source": "synthetic",
  756. "timingPolicy": "task-notification",
  757. "syntheticReason": "消费第一个 background Bash completion notification,并保持第二个 running row 可见。 验证来源提示及非用户授权边界。"
  758. },
  759. {
  760. "id": "upstream-background-snapshot-control-second-stopped",
  761. "kind": "main",
  762. "source": "synthetic",
  763. "timingPolicy": "task-notification",
  764. "syntheticReason": "消费第二个 background Bash stop notification,避免长 running task 泄漏到后续测试。 验证来源提示及非用户授权边界。"
  765. },
  766. {
  767. "id": "upstream-background-agent-control-preserve-ready",
  768. "kind": "main",
  769. "source": "synthetic",
  770. "timingPolicy": "fast-tool-use",
  771. "syntheticReason": "稳定启动四个 background Agent:三个 short-lived Agent 依次完成,long-running Agent 保持 running,用真实右上角 background control 面板复现 Agent row 闪没场景。"
  772. },
  773. {
  774. "id": "upstream-background-agent-control-preserve-long-running-child-keepalive-tool",
  775. "kind": "subagent",
  776. "source": "synthetic",
  777. "timingPolicy": "fast-tool-use",
  778. "syntheticReason": "让 long-running Agent 进入不会自行完成的 child Bash,保持 running,证明另一个 Agent completion notification 不会清掉它的 control row。"
  779. },
  780. {
  781. "id": "upstream-background-agent-control-preserve-short-lived-one-child-result",
  782. "kind": "subagent",
  783. "source": "synthetic",
  784. "timingPolicy": "delayed-text",
  785. "syntheticReason": "短延迟完成第一个 short-lived background Agent,稳定触发 parent task-notification。"
  786. },
  787. {
  788. "id": "upstream-background-agent-control-preserve-short-lived-two-child-result",
  789. "kind": "subagent",
  790. "source": "synthetic",
  791. "timingPolicy": "delayed-text",
  792. "syntheticReason": "短延迟完成第二个 short-lived background Agent,稳定触发 parent task-notification。"
  793. },
  794. {
  795. "id": "upstream-background-agent-control-preserve-short-lived-three-child-result",
  796. "kind": "subagent",
  797. "source": "synthetic",
  798. "timingPolicy": "delayed-text",
  799. "syntheticReason": "短延迟完成第三个 short-lived background Agent,复现真实场景中第三个 completion notification 触发 UI 闪没。"
  800. },
  801. {
  802. "id": "upstream-background-agent-control-preserve-launch-ack",
  803. "kind": "main",
  804. "source": "synthetic",
  805. "timingPolicy": "fast-text",
  806. "syntheticReason": "让 main 回到 idle,同时右上角 background control 面板仍有多个 running Agent row。"
  807. },
  808. {
  809. "id": "upstream-background-agent-control-preserve-short-lived-one-notification",
  810. "kind": "main",
  811. "source": "synthetic",
  812. "timingPolicy": "task-notification",
  813. "syntheticReason": "先消费第一个 short-lived Agent completion notification,复现真实场景中多个 short-lived Agent 依次完成。 验证来源提示及非用户授权边界。"
  814. },
  815. {
  816. "id": "upstream-background-agent-control-preserve-short-lived-two-notification",
  817. "kind": "main",
  818. "source": "synthetic",
  819. "timingPolicy": "task-notification",
  820. "syntheticReason": "再消费第二个 short-lived Agent completion notification,复现真实场景中多个 short-lived Agent 依次完成。 验证来源提示及非用户授权边界。"
  821. },
  822. {
  823. "id": "upstream-background-agent-control-preserve-short-lived-three-notification",
  824. "kind": "main",
  825. "source": "synthetic",
  826. "timingPolicy": "task-notification",
  827. "syntheticReason": "复现真实场景:main 处理第三个 Agent completion notification 时先执行 TodoWrite,覆盖 notification turn 内部状态更新。 验证来源提示及非用户授权边界。"
  828. },
  829. {
  830. "id": "upstream-background-agent-control-preserve-after-todo",
  831. "kind": "main",
  832. "source": "synthetic",
  833. "timingPolicy": "delayed-text",
  834. "syntheticReason": "复现真实场景:TodoWrite 之后 main notification turn 仍在处理,另一个 still-running Agent row 不能从右上角闪没。"
  835. },
  836. {
  837. "id": "upstream-background-agent-control-preserve-long-running-stopped",
  838. "kind": "main",
  839. "source": "synthetic",
  840. "timingPolicy": "task-notification",
  841. "syntheticReason": "测试结束前收口仍 running 的 long-running Agent,避免长 running task 泄漏到后续测试。 验证来源提示及非用户授权边界。"
  842. },
  843. {
  844. "id": "upstream-agent-composition-mixed-launch",
  845. "kind": "main",
  846. "source": "synthetic",
  847. "timingPolicy": "fast-tool-use",
  848. "syntheticReason": "同一 main turn 启动 foreground/background Agent,验证两类结果在同一 provider request 消费后生成 main_plus_fg_bg。"
  849. },
  850. {
  851. "id": "upstream-agent-composition-mixed-foreground-child",
  852. "kind": "subagent",
  853. "source": "synthetic",
  854. "timingPolicy": "delayed-tool-use",
  855. "syntheticReason": "用 child Bash 文件 barrier 等待 background response 完成,再释放 foreground child,稳定制造同一 main turn 的 mixed 消费窗口。"
  856. },
  857. {
  858. "id": "upstream-agent-composition-mixed-foreground-child-done",
  859. "kind": "subagent",
  860. "source": "synthetic",
  861. "timingPolicy": "fast-text",
  862. "syntheticReason": "文件 barrier 释放 foreground child 后返回最终结果,确保 main active-loop 仍可消费已完成的 background notification。"
  863. },
  864. {
  865. "id": "upstream-agent-composition-mixed-background-child",
  866. "kind": "subagent",
  867. "source": "synthetic",
  868. "timingPolicy": "fast-text",
  869. "syntheticReason": "先完成 background child,确保其结构化 subagent notification 在 foreground child 收口前可被 active loop 消费。"
  870. },
  871. {
  872. "id": "upstream-agent-composition-mixed-final",
  873. "kind": "main",
  874. "source": "synthetic",
  875. "timingPolicy": "fast-text",
  876. "syntheticReason": "provider-visible request 同时包含 foreground tool result 与 background subagent notification,验证 mixed composition。 验证来源提示及非用户授权边界。"
  877. }
  878. ]
  879. }