conversation-session-background.json 157 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-background",
  4. "spec": "./test/e2e/conversation-session/background/conversation-session-background.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-background-title",
  8. "description": "Background spec 内所有 E2E 标题生成固定响应,避免 title 请求阻塞业务 replay。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于 background runtime task 语义;同一 spec 还包含 foreground 对照组,因此按通用 E2E marker 稳定返回,避免标题请求重试阻塞业务请求。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-background-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Background E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-background-agent-tool-call",
  31. "description": "BG01: main agent launches a background Agent.",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-tool-use",
  35. "source": "synthetic",
  36. "syntheticReason": "稳定触发 Agent(run_in_background=true),验证 background Agent notification wake。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": [
  43. "E2E_BACKGROUND_AGENT: Launch a background agent and summarize only after its notification."
  44. ],
  45. "bodyExcludes": [
  46. "Async agent launched successfully",
  47. "agentId: agent_",
  48. "Generate a concise title",
  49. "CRITICAL: Respond with TEXT ONLY",
  50. "Verify whether the active session goal"
  51. ],
  52. "lastUserMessageIncludes": [
  53. "E2E_BACKGROUND_AGENT: Launch a background agent and summarize only after its notification."
  54. ]
  55. },
  56. "response": {
  57. "statusCode": 200,
  58. "toolUse": {
  59. "id": "toolu_e2e_background_agent",
  60. "name": "Agent",
  61. "input": {
  62. "description": "Check background",
  63. "prompt": "E2E_BACKGROUND_AGENT_CHILD: Return exactly E2E_BACKGROUND_AGENT_CHILD_RESULT.",
  64. "run_in_background": true
  65. }
  66. }
  67. }
  68. },
  69. {
  70. "id": "upstream-background-agent-launch-ack",
  71. "description": "BG01: parent finishes launch turn after async Agent result.",
  72. "metadata": {
  73. "kind": "main",
  74. "timingPolicy": "fast-text",
  75. "source": "synthetic",
  76. "syntheticReason": "父模型在 async launch tool result 后结束当前 turn。"
  77. },
  78. "maxMatches": 1,
  79. "match": {
  80. "method": "POST",
  81. "pathIncludes": "/messages",
  82. "bodyIncludes": [
  83. "E2E_BACKGROUND_AGENT: Launch a background agent and summarize only after its notification.",
  84. "Async agent launched successfully"
  85. ],
  86. "bodyExcludes": [
  87. "Generate a concise title",
  88. "CRITICAL: Respond with TEXT ONLY",
  89. "Verify whether the active session goal"
  90. ]
  91. },
  92. "response": {
  93. "statusCode": 200,
  94. "text": {
  95. "id": "upstream-e2e-background-agent-launch-ack",
  96. "text": "background-agent-launched-ok"
  97. }
  98. }
  99. },
  100. {
  101. "id": "upstream-background-agent-child-delayed-result",
  102. "description": "BG01: delayed child Agent result.",
  103. "metadata": {
  104. "kind": "subagent",
  105. "timingPolicy": "delayed-text",
  106. "source": "synthetic",
  107. "syntheticReason": "延迟子 agent 完成,稳定制造 parent idle wake。"
  108. },
  109. "maxMatches": 1,
  110. "match": {
  111. "method": "POST",
  112. "pathIncludes": "/messages",
  113. "bodyIncludes": [
  114. "E2E_BACKGROUND_AGENT_CHILD: Return exactly E2E_BACKGROUND_AGENT_CHILD_RESULT."
  115. ],
  116. "bodyExcludes": [
  117. "Async agent launched successfully",
  118. "agentId: agent_",
  119. "Generate a concise title",
  120. "CRITICAL: Respond with TEXT ONLY",
  121. "Verify whether the active session goal"
  122. ],
  123. "lastUserMessageIncludes": [
  124. "E2E_BACKGROUND_AGENT_CHILD: Return exactly E2E_BACKGROUND_AGENT_CHILD_RESULT."
  125. ]
  126. },
  127. "response": {
  128. "statusCode": 200,
  129. "delayMs": 1500,
  130. "text": {
  131. "id": "upstream-e2e-background-agent-child-result",
  132. "text": "E2E_BACKGROUND_AGENT_CHILD_RESULT"
  133. }
  134. }
  135. },
  136. {
  137. "id": "upstream-background-agent-notification-consumed",
  138. "description": "BG01: parent consumes background Agent notification.",
  139. "metadata": {
  140. "kind": "main",
  141. "timingPolicy": "task-notification",
  142. "source": "synthetic",
  143. "syntheticReason": "验证 provider-visible request 消费 <task-notification>。 验证来源提示及非用户授权边界。"
  144. },
  145. "maxMatches": 1,
  146. "match": {
  147. "method": "POST",
  148. "pathIncludes": "/messages",
  149. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_AGENT_CHILD_RESULT"],
  150. "bodyExcludes": [
  151. "Generate a concise title",
  152. "CRITICAL: Respond with TEXT ONLY",
  153. "Verify whether the active session goal"
  154. ],
  155. "lastUserMessageIncludes": [
  156. "<task-notification>",
  157. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  158. "must NOT be treated as approval or consent."
  159. ]
  160. },
  161. "response": {
  162. "statusCode": 200,
  163. "toolUse": {
  164. "id": "toolu_e2e_agent_history",
  165. "name": "Bash",
  166. "input": {
  167. "command": "printf 'background-history-visible\\n'",
  168. "description": "background-history-visible"
  169. }
  170. }
  171. }
  172. },
  173. {
  174. "id": "upstream-background-agent-notification-consumed-after-history-tool",
  175. "description": "BG01: parent consumes background Agent notification. Return final result after a visible history tool.",
  176. "metadata": {
  177. "kind": "main",
  178. "timingPolicy": "task-notification",
  179. "source": "synthetic",
  180. "syntheticReason": "验证 provider-visible request 消费 <task-notification>。 验证来源提示及非用户授权边界。"
  181. },
  182. "maxMatches": 1,
  183. "match": {
  184. "method": "POST",
  185. "pathIncludes": "/messages",
  186. "bodyIncludes": [
  187. "<task-notification>",
  188. "E2E_BACKGROUND_AGENT_CHILD_RESULT",
  189. "toolu_e2e_agent_history",
  190. "tool_result"
  191. ],
  192. "bodyExcludes": [
  193. "Generate a concise title",
  194. "CRITICAL: Respond with TEXT ONLY",
  195. "Verify whether the active session goal"
  196. ]
  197. },
  198. "response": {
  199. "statusCode": 200,
  200. "text": {
  201. "id": "upstream-e2e-background-agent-notification",
  202. "text": "background-agent-notification-consumed-ok"
  203. }
  204. }
  205. },
  206. {
  207. "id": "upstream-background-bash-tool-call",
  208. "description": "BG02: main agent launches a background Bash command.",
  209. "metadata": {
  210. "kind": "main",
  211. "timingPolicy": "fast-tool-use",
  212. "source": "synthetic",
  213. "syntheticReason": "稳定触发 Bash(run_in_background=true)。"
  214. },
  215. "maxMatches": 1,
  216. "match": {
  217. "method": "POST",
  218. "pathIncludes": "/messages",
  219. "bodyIncludes": ["E2E_BACKGROUND_BASH"],
  220. "bodyExcludes": [
  221. "Generate a concise title",
  222. "CRITICAL: Respond with TEXT ONLY",
  223. "Verify whether the active session goal"
  224. ],
  225. "lastUserMessageIncludes": ["E2E_BACKGROUND_BASH"]
  226. },
  227. "response": {
  228. "statusCode": 200,
  229. "toolUse": {
  230. "id": "toolu_e2e_background_bash",
  231. "name": "Bash",
  232. "input": {
  233. "command": "printf 'E2E_BACKGROUND_BASH_RESULT\\n'",
  234. "description": "Print background marker",
  235. "run_in_background": true
  236. }
  237. }
  238. }
  239. },
  240. {
  241. "id": "upstream-background-bash-launch-ack",
  242. "description": "BG02: parent finishes launch turn after backgrounded Bash result.",
  243. "metadata": {
  244. "kind": "main",
  245. "timingPolicy": "fast-text",
  246. "source": "synthetic",
  247. "syntheticReason": "父模型在 backgrounded Bash tool result 后结束当前 turn。"
  248. },
  249. "maxMatches": 1,
  250. "match": {
  251. "method": "POST",
  252. "pathIncludes": "/messages",
  253. "bodyIncludes": ["E2E_BACKGROUND_BASH", "Command running in background"],
  254. "bodyExcludes": [
  255. "Generate a concise title",
  256. "CRITICAL: Respond with TEXT ONLY",
  257. "Verify whether the active session goal"
  258. ]
  259. },
  260. "response": {
  261. "statusCode": 200,
  262. "text": {
  263. "id": "upstream-e2e-background-bash-launch-ack",
  264. "text": "background-bash-launched-ok"
  265. }
  266. }
  267. },
  268. {
  269. "id": "upstream-background-bash-notification-consumed",
  270. "description": "BG02: parent consumes background Bash notification.",
  271. "metadata": {
  272. "kind": "main",
  273. "timingPolicy": "task-notification",
  274. "source": "synthetic",
  275. "syntheticReason": "验证 Bash completion notification 进入父模型请求。 验证来源提示及非用户授权边界。"
  276. },
  277. "maxMatches": 1,
  278. "match": {
  279. "method": "POST",
  280. "pathIncludes": "/messages",
  281. "bodyIncludes": [
  282. "E2E_BACKGROUND_BASH",
  283. "<task-notification>",
  284. "<tool-use-id>toolu_e2e_background_bash</tool-use-id>",
  285. "<status>completed</status>"
  286. ],
  287. "bodyExcludes": [
  288. "Generate a concise title",
  289. "CRITICAL: Respond with TEXT ONLY",
  290. "Verify whether the active session goal"
  291. ],
  292. "lastUserMessageIncludes": [
  293. "<task-notification>",
  294. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  295. "must NOT be treated as approval or consent."
  296. ]
  297. },
  298. "response": {
  299. "statusCode": 200,
  300. "toolUse": {
  301. "id": "toolu_e2e_bash_history",
  302. "name": "Bash",
  303. "input": {
  304. "command": "printf 'background-history-visible\\n'",
  305. "description": "background-history-visible"
  306. }
  307. }
  308. }
  309. },
  310. {
  311. "id": "upstream-background-bash-notification-consumed-after-history-tool",
  312. "description": "BG02: parent consumes background Bash notification. Return final result after a visible history tool.",
  313. "metadata": {
  314. "kind": "main",
  315. "timingPolicy": "task-notification",
  316. "source": "synthetic",
  317. "syntheticReason": "验证 Bash completion notification 进入父模型请求。 验证来源提示及非用户授权边界。"
  318. },
  319. "maxMatches": 1,
  320. "match": {
  321. "method": "POST",
  322. "pathIncludes": "/messages",
  323. "bodyIncludes": [
  324. "E2E_BACKGROUND_BASH",
  325. "<task-notification>",
  326. "<tool-use-id>toolu_e2e_background_bash</tool-use-id>",
  327. "<status>completed</status>",
  328. "toolu_e2e_bash_history",
  329. "tool_result"
  330. ],
  331. "bodyExcludes": [
  332. "Generate a concise title",
  333. "CRITICAL: Respond with TEXT ONLY",
  334. "Verify whether the active session goal"
  335. ]
  336. },
  337. "response": {
  338. "statusCode": 200,
  339. "text": {
  340. "id": "upstream-e2e-background-bash-notification",
  341. "text": "background-bash-notification-consumed-ok"
  342. }
  343. }
  344. },
  345. {
  346. "id": "upstream-background-direct-user-prompt-bash-tool-call",
  347. "description": "BG15: main agent starts a long background Bash before the user sends a second prompt.",
  348. "metadata": {
  349. "kind": "main",
  350. "timingPolicy": "fast-tool-use",
  351. "source": "synthetic",
  352. "syntheticReason": "稳定制造 main idle 但 background task 仍 running 的窗口,验证后续用户普通消息不会进入 queued prompt。"
  353. },
  354. "maxMatches": 1,
  355. "match": {
  356. "method": "POST",
  357. "pathIncludes": "/messages",
  358. "bodyIncludes": ["E2E_BACKGROUND_DIRECT_USER_PROMPT_SETUP"],
  359. "bodyExcludes": [
  360. "Command running in background",
  361. "Generate a concise title",
  362. "CRITICAL: Respond with TEXT ONLY",
  363. "Verify whether the active session goal"
  364. ],
  365. "lastUserMessageIncludes": ["E2E_BACKGROUND_DIRECT_USER_PROMPT_SETUP"]
  366. },
  367. "response": {
  368. "statusCode": 200,
  369. "toolUse": {
  370. "id": "toolu_e2e_background_direct_user_prompt_bash",
  371. "name": "Bash",
  372. "input": {
  373. "command": "sh -c 'sleep 60; printf \"E2E_BACKGROUND_DIRECT_USER_PROMPT_BASH_DONE\\n\"'",
  374. "description": "background direct user prompt bash sleep",
  375. "run_in_background": true
  376. }
  377. }
  378. }
  379. },
  380. {
  381. "id": "upstream-background-direct-user-prompt-launch-ack",
  382. "description": "BG15: parent finishes launch turn while background Bash keeps running.",
  383. "metadata": {
  384. "kind": "main",
  385. "timingPolicy": "fast-text",
  386. "source": "synthetic",
  387. "syntheticReason": "让 main 回到 idle,但统一 background control UI 仍有 running Bash task。"
  388. },
  389. "maxMatches": 1,
  390. "match": {
  391. "method": "POST",
  392. "pathIncludes": "/messages",
  393. "bodyIncludes": [
  394. "E2E_BACKGROUND_DIRECT_USER_PROMPT_SETUP",
  395. "Command running in background"
  396. ],
  397. "bodyExcludes": [
  398. "Generate a concise title",
  399. "CRITICAL: Respond with TEXT ONLY",
  400. "Verify whether the active session goal"
  401. ]
  402. },
  403. "response": {
  404. "statusCode": 200,
  405. "text": {
  406. "id": "upstream-e2e-background-direct-user-prompt-launch-ack",
  407. "text": "background-direct-user-prompt-launched-ok"
  408. }
  409. }
  410. },
  411. {
  412. "id": "upstream-background-direct-user-prompt-received",
  413. "description": "BG15: second user prompt is sent immediately while background task is still running.",
  414. "metadata": {
  415. "kind": "main",
  416. "timingPolicy": "fast-text",
  417. "source": "synthetic",
  418. "syntheticReason": "验证 background task running 不会把用户普通消息放入 queue,而是立即进入 provider request。"
  419. },
  420. "maxMatches": 1,
  421. "match": {
  422. "method": "POST",
  423. "pathIncludes": "/messages",
  424. "bodyIncludes": [
  425. "E2E_BACKGROUND_DIRECT_USER_PROMPT",
  426. "E2E_BACKGROUND_DIRECT_USER_PROMPT_PAYLOAD"
  427. ],
  428. "bodyExcludes": [
  429. "Generate a concise title",
  430. "CRITICAL: Respond with TEXT ONLY",
  431. "Verify whether the active session goal"
  432. ],
  433. "lastUserMessageExcludes": ["<task-notification>"],
  434. "lastUserMessageIncludes": ["E2E_BACKGROUND_DIRECT_USER_PROMPT_PAYLOAD"]
  435. },
  436. "response": {
  437. "statusCode": 200,
  438. "text": {
  439. "id": "upstream-e2e-background-direct-user-prompt-received",
  440. "text": "background-direct-user-prompt-received-ok"
  441. }
  442. }
  443. },
  444. {
  445. "id": "upstream-background-direct-user-prompt-stop-notification-consumed",
  446. "description": "BG15: parent consumes stopped notification after the test stops the still-running background Bash.",
  447. "metadata": {
  448. "kind": "main",
  449. "timingPolicy": "task-notification",
  450. "source": "synthetic",
  451. "syntheticReason": "测试结束前收口长时间 background Bash,避免留下后台进程,同时验证 stop notification 仍走标准链路。 验证来源提示及非用户授权边界。"
  452. },
  453. "maxMatches": 1,
  454. "match": {
  455. "method": "POST",
  456. "pathIncludes": "/messages",
  457. "bodyIncludes": [
  458. "E2E_BACKGROUND_DIRECT_USER_PROMPT_SETUP",
  459. "<task-notification>",
  460. "<tool-use-id>toolu_e2e_background_direct_user_prompt_bash</tool-use-id>",
  461. "<status>killed</status>"
  462. ],
  463. "bodyExcludes": [
  464. "Generate a concise title",
  465. "CRITICAL: Respond with TEXT ONLY",
  466. "Verify whether the active session goal"
  467. ],
  468. "lastUserMessageIncludes": [
  469. "<task-notification>",
  470. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  471. "must NOT be treated as approval or consent."
  472. ]
  473. },
  474. "response": {
  475. "statusCode": 200,
  476. "text": {
  477. "id": "upstream-e2e-background-direct-user-prompt-stop-notification",
  478. "text": "background-direct-user-prompt-bash-stopped-ok"
  479. }
  480. }
  481. },
  482. {
  483. "id": "upstream-background-compact-after-idle-bash-tool-call",
  484. "description": "BG19: main agent starts a background Bash before manual compact.",
  485. "metadata": {
  486. "kind": "main",
  487. "timingPolicy": "fast-tool-use",
  488. "source": "synthetic",
  489. "syntheticReason": "稳定制造 main idle 但 background task running 的窗口,验证此时允许 manual compact。"
  490. },
  491. "maxMatches": 1,
  492. "match": {
  493. "method": "POST",
  494. "pathIncludes": "/messages",
  495. "bodyIncludes": ["E2E_BACKGROUND_COMPACT_AFTER_IDLE"],
  496. "bodyExcludes": [
  497. "Command running in background",
  498. "Generate a concise title",
  499. "CRITICAL: Respond with TEXT ONLY",
  500. "Verify whether the active session goal"
  501. ],
  502. "lastUserMessageIncludes": ["E2E_BACKGROUND_COMPACT_AFTER_IDLE"]
  503. },
  504. "response": {
  505. "statusCode": 200,
  506. "toolUse": {
  507. "id": "toolu_e2e_background_compact_after_idle_bash",
  508. "name": "Bash",
  509. "input": {
  510. "command": "sh -c 'sleep 6; printf \"E2E_BACKGROUND_COMPACT_AFTER_IDLE_DONE\\n\"'",
  511. "description": "background compact bash sleep",
  512. "run_in_background": true
  513. }
  514. }
  515. }
  516. },
  517. {
  518. "id": "upstream-background-compact-after-idle-launch-ack",
  519. "description": "BG19: parent finishes launch turn while background Bash keeps running.",
  520. "metadata": {
  521. "kind": "main",
  522. "timingPolicy": "fast-text",
  523. "source": "synthetic",
  524. "syntheticReason": "让 main 回到 idle,后续手动 compact 不应被 background running 阻塞。"
  525. },
  526. "maxMatches": 1,
  527. "match": {
  528. "method": "POST",
  529. "pathIncludes": "/messages",
  530. "bodyIncludes": [
  531. "E2E_BACKGROUND_COMPACT_AFTER_IDLE",
  532. "E2E_BACKGROUND_COMPACT_AFTER_IDLE_DONE",
  533. "Command running in background"
  534. ],
  535. "bodyExcludes": [
  536. "Generate a concise title",
  537. "CRITICAL: Respond with TEXT ONLY",
  538. "Verify whether the active session goal"
  539. ]
  540. },
  541. "response": {
  542. "statusCode": 200,
  543. "text": {
  544. "id": "upstream-e2e-background-compact-after-idle-launch-ack",
  545. "text": "background-compact-launched-ok"
  546. }
  547. }
  548. },
  549. {
  550. "id": "upstream-background-compact-after-idle-summary",
  551. "description": "BG19: manual compact while background task is running succeeds.",
  552. "metadata": {
  553. "kind": "main",
  554. "timingPolicy": "fast-json",
  555. "source": "synthetic",
  556. "syntheticReason": "给 background completion notification 的后续请求留下可断言的 compact 后摘要 marker。"
  557. },
  558. "maxMatches": 1,
  559. "match": {
  560. "method": "POST",
  561. "pathIncludes": "/messages",
  562. "bodyIncludes": [
  563. "CRITICAL: Respond with TEXT ONLY",
  564. "E2E_BACKGROUND_COMPACT_AFTER_IDLE",
  565. "\"stream\":true"
  566. ]
  567. },
  568. "response": {
  569. "statusCode": 200,
  570. "text": {
  571. "id": "upstream-e2e-background-compact-after-idle-summary",
  572. "inputTokens": 260,
  573. "outputTokens": 64,
  574. "text": "<analysis>Manual compact happened while a background Bash task was running.</analysis>\n\n<summary>E2E_BACKGROUND_COMPACT_SUMMARY_MARKER: compact preserved the background Bash setup while the task continued running.</summary>"
  575. }
  576. }
  577. },
  578. {
  579. "id": "upstream-background-compact-after-idle-notification-consumed",
  580. "description": "BG19: parent consumes background Bash notification after compact.",
  581. "metadata": {
  582. "kind": "main",
  583. "timingPolicy": "task-notification",
  584. "source": "synthetic",
  585. "syntheticReason": "验证 compact 后 background completion notification 仍进入父模型请求,且请求上下文来自 compact 后摘要。 验证来源提示及非用户授权边界。"
  586. },
  587. "maxMatches": 1,
  588. "match": {
  589. "method": "POST",
  590. "pathIncludes": "/messages",
  591. "bodyIncludes": [
  592. "E2E_BACKGROUND_COMPACT_SUMMARY_MARKER",
  593. "<task-notification>",
  594. "toolu_e2e_background_compact_after_idle_bash",
  595. "<status>completed</status>"
  596. ],
  597. "bodyExcludes": [
  598. "Generate a concise title",
  599. "CRITICAL: Respond with TEXT ONLY",
  600. "Verify whether the active session goal"
  601. ],
  602. "lastUserMessageIncludes": [
  603. "<task-notification>",
  604. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  605. "must NOT be treated as approval or consent."
  606. ]
  607. },
  608. "response": {
  609. "statusCode": 200,
  610. "text": {
  611. "id": "upstream-e2e-background-compact-after-idle-notification",
  612. "text": "background-compact-notification-consumed-ok"
  613. }
  614. }
  615. },
  616. {
  617. "id": "upstream-background-auto-timeout-bash-tool-call",
  618. "description": "BG11: main agent starts an eligible foreground Bash command that should auto-background on timeout.",
  619. "metadata": {
  620. "kind": "main",
  621. "timingPolicy": "fast-tool-use",
  622. "source": "synthetic",
  623. "syntheticReason": "稳定触发 foreground Bash timeout auto-background,验证没有显式 run_in_background 时也能进入 background task control UI。"
  624. },
  625. "maxMatches": 1,
  626. "match": {
  627. "method": "POST",
  628. "pathIncludes": "/messages",
  629. "bodyIncludes": ["E2E_BACKGROUND_AUTO_TIMEOUT_BASH"],
  630. "bodyExcludes": [
  631. "and was moved to the background (ID:",
  632. "Generate a concise title",
  633. "CRITICAL: Respond with TEXT ONLY",
  634. "Verify whether the active session goal"
  635. ],
  636. "lastUserMessageIncludes": ["E2E_BACKGROUND_AUTO_TIMEOUT_BASH"]
  637. },
  638. "response": {
  639. "statusCode": 200,
  640. "toolUse": {
  641. "id": "toolu_e2e_background_auto_timeout_bash",
  642. "name": "Bash",
  643. "input": {
  644. "command": "sh -c 'sleep 1.5; printf \"E2E_BACKGROUND_AUTO_TIMEOUT_BASH_DONE\\n\"'",
  645. "description": "auto timeout bash sleep",
  646. "timeout": 1
  647. }
  648. }
  649. }
  650. },
  651. {
  652. "id": "upstream-background-auto-timeout-bash-launch-ack",
  653. "description": "BG11: parent finishes launch turn after foreground Bash auto-backgrounds.",
  654. "metadata": {
  655. "kind": "main",
  656. "timingPolicy": "fast-text",
  657. "source": "synthetic",
  658. "syntheticReason": "让 UI 在 Bash 自然完成前展示 auto-background 后的 running control row。"
  659. },
  660. "maxMatches": 1,
  661. "match": {
  662. "method": "POST",
  663. "pathIncludes": "/messages",
  664. "bodyIncludes": [
  665. "E2E_BACKGROUND_AUTO_TIMEOUT_BASH",
  666. "and was moved to the background (ID:"
  667. ],
  668. "bodyExcludes": [
  669. "Generate a concise title",
  670. "CRITICAL: Respond with TEXT ONLY",
  671. "Verify whether the active session goal"
  672. ]
  673. },
  674. "response": {
  675. "statusCode": 200,
  676. "text": {
  677. "id": "upstream-e2e-background-auto-timeout-bash-launch-ack",
  678. "text": "background-auto-timeout-bash-launched-ok"
  679. }
  680. }
  681. },
  682. {
  683. "id": "upstream-background-auto-timeout-bash-notification-consumed",
  684. "description": "BG12: parent consumes completed notification and UI should remove the auto-background Bash row.",
  685. "metadata": {
  686. "kind": "main",
  687. "timingPolicy": "task-notification",
  688. "source": "synthetic",
  689. "syntheticReason": "验证 auto-background Bash 自然完成后 provider-visible notification 和 UI control row cleanup。 验证来源提示及非用户授权边界。"
  690. },
  691. "maxMatches": 1,
  692. "match": {
  693. "method": "POST",
  694. "pathIncludes": "/messages",
  695. "bodyIncludes": [
  696. "E2E_BACKGROUND_AUTO_TIMEOUT_BASH",
  697. "<task-notification>",
  698. "<tool-use-id>toolu_e2e_background_auto_timeout_bash</tool-use-id>",
  699. "<status>completed</status>"
  700. ],
  701. "bodyExcludes": [
  702. "Generate a concise title",
  703. "CRITICAL: Respond with TEXT ONLY",
  704. "Verify whether the active session goal"
  705. ],
  706. "lastUserMessageIncludes": [
  707. "<task-notification>",
  708. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  709. "must NOT be treated as approval or consent."
  710. ]
  711. },
  712. "response": {
  713. "statusCode": 200,
  714. "text": {
  715. "id": "upstream-e2e-background-auto-timeout-bash-notification",
  716. "text": "background-auto-timeout-bash-completed-ok"
  717. }
  718. }
  719. },
  720. {
  721. "id": "upstream-bg37-explicit-timeout-tool-call",
  722. "description": "BG37: main agent starts explicit background Bash with an input timeout shorter than its runtime.",
  723. "metadata": {
  724. "kind": "main",
  725. "timingPolicy": "fast-tool-use",
  726. "source": "synthetic",
  727. "syntheticReason": "稳定验证 explicit background commit 后 input timeout 不再终止进程。"
  728. },
  729. "maxMatches": 1,
  730. "match": {
  731. "method": "POST",
  732. "pathIncludes": "/messages",
  733. "bodyIncludes": ["E2E_BG37_EXPLICIT_TIMEOUT"],
  734. "bodyExcludes": [
  735. "Command running in background",
  736. "Generate a concise title",
  737. "CRITICAL: Respond with TEXT ONLY",
  738. "Verify whether the active session goal"
  739. ],
  740. "lastUserMessageIncludes": ["E2E_BG37_EXPLICIT_TIMEOUT"]
  741. },
  742. "response": {
  743. "statusCode": 200,
  744. "toolUse": {
  745. "id": "toolu_e2e_bg37_explicit_timeout",
  746. "name": "Bash",
  747. "input": {
  748. "command": "printf 'E2E_BG37_STARTED\\n'; sleep 8; printf 'E2E_BG37_DONE\\n'",
  749. "description": "BG37 explicit timeout bash",
  750. "run_in_background": true,
  751. "timeout": 10
  752. }
  753. }
  754. }
  755. },
  756. {
  757. "id": "upstream-bg37-explicit-timeout-launch-ack",
  758. "description": "BG37: parent finishes the launch turn while explicit Bash remains running past its input timeout.",
  759. "metadata": {
  760. "kind": "main",
  761. "timingPolicy": "fast-text",
  762. "source": "synthetic",
  763. "syntheticReason": "保留 input timeout 后仍可见的 running control row 窗口。"
  764. },
  765. "maxMatches": 1,
  766. "match": {
  767. "method": "POST",
  768. "pathIncludes": "/messages",
  769. "bodyIncludes": ["E2E_BG37_EXPLICIT_TIMEOUT", "Command running in background"],
  770. "bodyExcludes": [
  771. "Generate a concise title",
  772. "CRITICAL: Respond with TEXT ONLY",
  773. "Verify whether the active session goal"
  774. ],
  775. "lastUserMessageExcludes": ["<task-notification>"]
  776. },
  777. "response": {
  778. "statusCode": 200,
  779. "text": {
  780. "id": "upstream-e2e-bg37-explicit-timeout-launch-ack",
  781. "text": "bg37-explicit-timeout-launched-ok"
  782. }
  783. }
  784. },
  785. {
  786. "id": "upstream-bg37-explicit-timeout-auto-compact-summary",
  787. "description": "BG37: automatic compact preserves the explicit Bash setup before consuming its completion notification.",
  788. "metadata": {
  789. "kind": "main",
  790. "timingPolicy": "fast-text",
  791. "source": "synthetic",
  792. "syntheticReason": "Bash prompt 变长后该轮会先自动 compact;固定 summary 以继续验证 completion notification,而不是让 replay 缺 fixture。"
  793. },
  794. "maxMatches": 1,
  795. "match": {
  796. "method": "POST",
  797. "pathIncludes": "/messages",
  798. "bodyIncludes": [
  799. "CRITICAL: Respond with TEXT ONLY",
  800. "E2E_BG37_EXPLICIT_TIMEOUT",
  801. "toolu_e2e_bg37_explicit_timeout",
  802. "\"stream\":true"
  803. ],
  804. "bodyExcludes": ["Generate a concise title", "Verify whether the active session goal"]
  805. },
  806. "response": {
  807. "statusCode": 200,
  808. "text": {
  809. "id": "upstream-e2e-bg37-explicit-timeout-auto-compact-summary",
  810. "inputTokens": 210,
  811. "outputTokens": 64,
  812. "text": "<analysis>Automatic compact preserved the explicit background Bash launch while it continued beyond its input timeout.</analysis>\n\n<summary>E2E_BG37_EXPLICIT_TIMEOUT remains active as toolu_e2e_bg37_explicit_timeout and its single completion notification is still pending.</summary>"
  813. }
  814. }
  815. },
  816. {
  817. "id": "upstream-bg37-explicit-timeout-notification-consumed",
  818. "description": "BG37: parent consumes the one completed notification from explicit Bash.",
  819. "metadata": {
  820. "kind": "main",
  821. "timingPolicy": "task-notification",
  822. "source": "synthetic",
  823. "syntheticReason": "验证 explicit Bash 越过 input timeout 后自然完成且只通知一次。 验证来源提示及非用户授权边界。"
  824. },
  825. "maxMatches": 1,
  826. "match": {
  827. "method": "POST",
  828. "pathIncludes": "/messages",
  829. "bodyIncludes": [
  830. "E2E_BG37_EXPLICIT_TIMEOUT",
  831. "<task-notification>",
  832. "<tool-use-id>toolu_e2e_bg37_explicit_timeout</tool-use-id>",
  833. "<status>completed</status>"
  834. ],
  835. "bodyExcludes": [
  836. "Generate a concise title",
  837. "CRITICAL: Respond with TEXT ONLY",
  838. "Verify whether the active session goal"
  839. ],
  840. "lastUserMessageIncludes": [
  841. "<task-notification>",
  842. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  843. "must NOT be treated as approval or consent."
  844. ]
  845. },
  846. "response": {
  847. "statusCode": 200,
  848. "text": {
  849. "id": "upstream-e2e-bg37-explicit-timeout-notification",
  850. "text": "bg37-explicit-timeout-completed-ok"
  851. }
  852. }
  853. },
  854. {
  855. "id": "upstream-bg38-parent-abort-tool-call",
  856. "description": "BG38: main agent commits an explicit Bash before the parent turn is stopped.",
  857. "metadata": {
  858. "kind": "main",
  859. "timingPolicy": "fast-tool-use",
  860. "source": "synthetic",
  861. "syntheticReason": "后台命令先写 started marker,再由测试停止仍 active 的 parent turn。"
  862. },
  863. "maxMatches": 1,
  864. "match": {
  865. "method": "POST",
  866. "pathIncludes": "/messages",
  867. "bodyIncludes": ["E2E_BG38_PARENT_ABORT"],
  868. "bodyExcludes": [
  869. "Command running in background",
  870. "Generate a concise title",
  871. "CRITICAL: Respond with TEXT ONLY",
  872. "Verify whether the active session goal"
  873. ],
  874. "lastUserMessageIncludes": ["E2E_BG38_PARENT_ABORT"]
  875. },
  876. "response": {
  877. "statusCode": 200,
  878. "toolUse": {
  879. "id": "toolu_e2e_bg38_parent_abort",
  880. "name": "Bash",
  881. "input": {
  882. "command": "printf 'E2E_BG38_STARTED\\n' > .zcode-e2e/conversation-session-background/bg38-bash-started; printf 'E2E_BG38_STARTED\\n'; sleep 4; printf 'E2E_BG38_DONE\\n'",
  883. "description": "BG38 parent abort bash",
  884. "run_in_background": true,
  885. "timeout": 10
  886. }
  887. }
  888. }
  889. },
  890. {
  891. "id": "upstream-bg38-parent-abort-launch-running",
  892. "description": "BG38: keep the parent launch response active so the test can stop it after Bash commit.",
  893. "metadata": {
  894. "kind": "main",
  895. "timingPolicy": "controlled-stream",
  896. "source": "synthetic",
  897. "syntheticReason": "延迟 launch response,稳定制造 task 已 commit 但 parent turn 仍 active 的 abort 窗口。"
  898. },
  899. "maxMatches": 1,
  900. "match": {
  901. "method": "POST",
  902. "pathIncludes": "/messages",
  903. "bodyIncludes": ["E2E_BG38_PARENT_ABORT", "Command running in background"],
  904. "bodyExcludes": [
  905. "Generate a concise title",
  906. "CRITICAL: Respond with TEXT ONLY",
  907. "Verify whether the active session goal"
  908. ],
  909. "lastUserMessageExcludes": ["<task-notification>"]
  910. },
  911. "response": {
  912. "statusCode": 200,
  913. "delayMs": 8000,
  914. "text": {
  915. "id": "upstream-e2e-bg38-parent-abort-launch-running",
  916. "text": "bg38-parent-turn-should-be-stopped"
  917. }
  918. }
  919. },
  920. {
  921. "id": "upstream-bg38-parent-abort-notification-consumed",
  922. "description": "BG38: parent consumes completed notification after its original turn was stopped.",
  923. "metadata": {
  924. "kind": "main",
  925. "timingPolicy": "task-notification",
  926. "source": "synthetic",
  927. "syntheticReason": "验证 parent abort 不会杀死已 commit Bash,且不会产生重复 notification。 验证来源提示及非用户授权边界。"
  928. },
  929. "maxMatches": 1,
  930. "match": {
  931. "method": "POST",
  932. "pathIncludes": "/messages",
  933. "bodyIncludes": [
  934. "E2E_BG38_PARENT_ABORT",
  935. "<task-notification>",
  936. "<tool-use-id>toolu_e2e_bg38_parent_abort</tool-use-id>",
  937. "<status>completed</status>",
  938. "E2E_BG38_STARTED",
  939. "E2E_BG38_DONE"
  940. ],
  941. "bodyExcludes": [
  942. "Generate a concise title",
  943. "CRITICAL: Respond with TEXT ONLY",
  944. "Verify whether the active session goal"
  945. ],
  946. "lastUserMessageIncludes": [
  947. "<task-notification>",
  948. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  949. "must NOT be treated as approval or consent."
  950. ]
  951. },
  952. "response": {
  953. "statusCode": 200,
  954. "text": {
  955. "id": "upstream-e2e-bg38-parent-abort-notification",
  956. "text": "bg38-parent-abort-background-completed-ok"
  957. }
  958. }
  959. },
  960. {
  961. "id": "upstream-bg39-sleep-hard-timeout-tool-call",
  962. "description": "BG39: main agent starts a foreground Bash whose first raw token is sleep.",
  963. "metadata": {
  964. "kind": "main",
  965. "timingPolicy": "fast-tool-use",
  966. "source": "synthetic",
  967. "syntheticReason": "稳定验证首 token sleep 沿用 foreground hard timeout,不进入 auto-background。"
  968. },
  969. "maxMatches": 1,
  970. "match": {
  971. "method": "POST",
  972. "pathIncludes": "/messages",
  973. "bodyIncludes": ["E2E_BG39_SLEEP_HARD_TIMEOUT"],
  974. "bodyExcludes": [
  975. "Command running in background",
  976. "Generate a concise title",
  977. "CRITICAL: Respond with TEXT ONLY",
  978. "Verify whether the active session goal"
  979. ],
  980. "lastUserMessageIncludes": ["E2E_BG39_SLEEP_HARD_TIMEOUT"]
  981. },
  982. "response": {
  983. "statusCode": 200,
  984. "toolUse": {
  985. "id": "toolu_e2e_bg39_sleep_timeout",
  986. "name": "Bash",
  987. "input": {
  988. "command": "sleep 2; printf 'E2E_BG39_UNEXPECTED\\n'",
  989. "description": "BG39 sleep hard timeout",
  990. "timeout": 50
  991. }
  992. }
  993. }
  994. },
  995. {
  996. "id": "upstream-bg39-sleep-hard-timeout-completed",
  997. "description": "BG39: parent receives the foreground hard-timeout result without a background task ID.",
  998. "metadata": {
  999. "kind": "main",
  1000. "timingPolicy": "fast-text",
  1001. "source": "synthetic",
  1002. "syntheticReason": "验证 provider-visible result 为 foreground 硬超时(Exit code 143 与超时行),且没有 background notification。"
  1003. },
  1004. "maxMatches": 1,
  1005. "match": {
  1006. "method": "POST",
  1007. "pathIncludes": "/messages",
  1008. "bodyIncludes": [
  1009. "E2E_BG39_SLEEP_HARD_TIMEOUT",
  1010. "Exit code 143",
  1011. "Command timed out after 0s"
  1012. ],
  1013. "bodyExcludes": [
  1014. "Command running in background",
  1015. "Command was aborted before completion",
  1016. "Generate a concise title",
  1017. "CRITICAL: Respond with TEXT ONLY",
  1018. "Verify whether the active session goal"
  1019. ],
  1020. "lastUserMessageExcludes": ["<task-notification>"]
  1021. },
  1022. "response": {
  1023. "statusCode": 200,
  1024. "text": {
  1025. "id": "upstream-e2e-bg39-sleep-hard-timeout",
  1026. "text": "bg39-sleep-hard-timeout-ok"
  1027. }
  1028. }
  1029. },
  1030. {
  1031. "id": "upstream-background-cancel-bash-tool-call",
  1032. "description": "BG08: main agent launches a cross-PGID background Bash process tree that will be stopped from the UI.",
  1033. "metadata": {
  1034. "kind": "main",
  1035. "timingPolicy": "fast-tool-use",
  1036. "source": "synthetic",
  1037. "syntheticReason": "稳定触发由 Bash job control 构造的跨 PGID launcher/worker 子树,用于验证统一 background control UI 的 stop 杀树路径。"
  1038. },
  1039. "maxMatches": 1,
  1040. "match": {
  1041. "method": "POST",
  1042. "pathIncludes": "/messages",
  1043. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_BASH"],
  1044. "bodyExcludes": [
  1045. "Command running in background",
  1046. "Generate a concise title",
  1047. "CRITICAL: Respond with TEXT ONLY",
  1048. "Verify whether the active session goal"
  1049. ],
  1050. "lastUserMessageIncludes": ["E2E_BACKGROUND_CANCEL_BASH"]
  1051. },
  1052. "response": {
  1053. "statusCode": 200,
  1054. "toolUse": {
  1055. "id": "toolu_e2e_background_cancel_bash",
  1056. "name": "Bash",
  1057. "input": {
  1058. "command": "bash -c 'printf \"%s\\n\" \"$$\" > .zcode-e2e/conversation-session-background/bg08-root.pid; set -m; node .zcode-e2e/conversation-session-background/bg08-launcher.cjs .zcode-e2e/conversation-session-background/bg08-launcher.pid .zcode-e2e/conversation-session-background/bg08-worker.pid & wait'",
  1059. "description": "background cancel bash process tree",
  1060. "run_in_background": true
  1061. }
  1062. }
  1063. }
  1064. },
  1065. {
  1066. "id": "upstream-background-cancel-bash-launch-ack",
  1067. "description": "BG08: parent finishes launch turn after backgrounded Bash result.",
  1068. "metadata": {
  1069. "kind": "main",
  1070. "timingPolicy": "fast-text",
  1071. "source": "synthetic",
  1072. "syntheticReason": "让 UI 在 idle 状态展示 running background Bash control,随后由测试点击 stop。"
  1073. },
  1074. "maxMatches": 1,
  1075. "match": {
  1076. "method": "POST",
  1077. "pathIncludes": "/messages",
  1078. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_BASH", "Command running in background"],
  1079. "bodyExcludes": [
  1080. "Generate a concise title",
  1081. "CRITICAL: Respond with TEXT ONLY",
  1082. "Verify whether the active session goal"
  1083. ]
  1084. },
  1085. "response": {
  1086. "statusCode": 200,
  1087. "text": {
  1088. "id": "upstream-e2e-background-cancel-bash-launch-ack",
  1089. "text": "background-cancel-bash-launched-ok"
  1090. }
  1091. }
  1092. },
  1093. {
  1094. "id": "upstream-background-cancel-bash-notification-consumed",
  1095. "description": "BG08: parent consumes stopped Bash notification after UI stop.",
  1096. "metadata": {
  1097. "kind": "main",
  1098. "timingPolicy": "task-notification",
  1099. "source": "synthetic",
  1100. "syntheticReason": "验证 UI stop Bash 仍走 background task notification,而不是只在 UI 本地消失。 验证来源提示及非用户授权边界。"
  1101. },
  1102. "maxMatches": 1,
  1103. "match": {
  1104. "method": "POST",
  1105. "pathIncludes": "/messages",
  1106. "bodyIncludes": [
  1107. "E2E_BACKGROUND_CANCEL_BASH",
  1108. "<task-notification>",
  1109. "<tool-use-id>toolu_e2e_background_cancel_bash</tool-use-id>",
  1110. "<status>killed</status>"
  1111. ],
  1112. "bodyExcludes": [
  1113. "Generate a concise title",
  1114. "CRITICAL: Respond with TEXT ONLY",
  1115. "Verify whether the active session goal"
  1116. ],
  1117. "lastUserMessageIncludes": [
  1118. "<task-notification>",
  1119. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1120. "must NOT be treated as approval or consent."
  1121. ]
  1122. },
  1123. "response": {
  1124. "statusCode": 200,
  1125. "text": {
  1126. "id": "upstream-e2e-background-cancel-bash-notification",
  1127. "text": "background-cancel-bash-stopped-ok"
  1128. }
  1129. }
  1130. },
  1131. {
  1132. "id": "upstream-background-cancel-agent-tool-call",
  1133. "description": "BG09: main agent launches a long background Agent that will be stopped from the UI.",
  1134. "metadata": {
  1135. "kind": "main",
  1136. "timingPolicy": "fast-tool-use",
  1137. "source": "synthetic",
  1138. "syntheticReason": "稳定触发 running local_agent task,验证统一 background control UI 能停止 subagent。"
  1139. },
  1140. "maxMatches": 1,
  1141. "match": {
  1142. "method": "POST",
  1143. "pathIncludes": "/messages",
  1144. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_AGENT"],
  1145. "bodyExcludes": [
  1146. "Async agent launched successfully",
  1147. "agentId: agent_",
  1148. "Generate a concise title",
  1149. "CRITICAL: Respond with TEXT ONLY",
  1150. "Verify whether the active session goal"
  1151. ],
  1152. "lastUserMessageIncludes": ["E2E_BACKGROUND_CANCEL_AGENT"]
  1153. },
  1154. "response": {
  1155. "statusCode": 200,
  1156. "toolUse": {
  1157. "id": "toolu_e2e_background_cancel_agent",
  1158. "name": "Agent",
  1159. "input": {
  1160. "description": "E2E background cancel agent",
  1161. "prompt": "E2E_BACKGROUND_CANCEL_AGENT_CHILD: Stay running until stopped. If not stopped, return E2E_BACKGROUND_CANCEL_AGENT_CHILD_UNEXPECTED.",
  1162. "run_in_background": true
  1163. }
  1164. }
  1165. }
  1166. },
  1167. {
  1168. "id": "upstream-background-cancel-agent-launch-ack",
  1169. "description": "BG09: parent finishes launch turn after async Agent result.",
  1170. "metadata": {
  1171. "kind": "main",
  1172. "timingPolicy": "fast-text",
  1173. "source": "synthetic",
  1174. "syntheticReason": "让 UI 在 idle 状态展示 running background Agent control,随后由测试点击 stop。"
  1175. },
  1176. "maxMatches": 1,
  1177. "match": {
  1178. "method": "POST",
  1179. "pathIncludes": "/messages",
  1180. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_AGENT", "Async agent launched successfully"],
  1181. "bodyExcludes": [
  1182. "Generate a concise title",
  1183. "CRITICAL: Respond with TEXT ONLY",
  1184. "Verify whether the active session goal"
  1185. ]
  1186. },
  1187. "response": {
  1188. "statusCode": 200,
  1189. "text": {
  1190. "id": "upstream-e2e-background-cancel-agent-launch-ack",
  1191. "text": "background-cancel-agent-launched-ok"
  1192. }
  1193. }
  1194. },
  1195. {
  1196. "id": "upstream-background-cancel-agent-child-delayed-result",
  1197. "description": "BG09: delayed child Agent response that should be aborted by UI stop.",
  1198. "metadata": {
  1199. "kind": "subagent",
  1200. "timingPolicy": "delayed-text",
  1201. "source": "synthetic",
  1202. "syntheticReason": "保持 child provider request 运行,验证 stop 会 abort running background Agent。"
  1203. },
  1204. "maxMatches": 1,
  1205. "match": {
  1206. "method": "POST",
  1207. "pathIncludes": "/messages",
  1208. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_AGENT_CHILD"],
  1209. "lastUserMessageIncludes": ["E2E_BACKGROUND_CANCEL_AGENT_CHILD"]
  1210. },
  1211. "response": {
  1212. "statusCode": 200,
  1213. "delayMs": 60000,
  1214. "text": {
  1215. "id": "upstream-e2e-background-cancel-agent-child-unexpected",
  1216. "text": "E2E_BACKGROUND_CANCEL_AGENT_CHILD_UNEXPECTED"
  1217. }
  1218. }
  1219. },
  1220. {
  1221. "id": "upstream-background-cancel-agent-notification-consumed",
  1222. "description": "BG09: parent consumes stopped Agent notification after UI stop.",
  1223. "metadata": {
  1224. "kind": "main",
  1225. "timingPolicy": "task-notification",
  1226. "source": "synthetic",
  1227. "syntheticReason": "验证 UI stop subagent 复用 local_agent task notification 链路。 验证来源提示及非用户授权边界。"
  1228. },
  1229. "maxMatches": 1,
  1230. "match": {
  1231. "method": "POST",
  1232. "pathIncludes": "/messages",
  1233. "bodyIncludes": [
  1234. "E2E_BACKGROUND_CANCEL_AGENT",
  1235. "<task-notification>",
  1236. "<tool-use-id>toolu_e2e_background_cancel_agent</tool-use-id>",
  1237. "<status>killed</status>"
  1238. ],
  1239. "bodyExcludes": [
  1240. "Generate a concise title",
  1241. "CRITICAL: Respond with TEXT ONLY",
  1242. "Verify whether the active session goal"
  1243. ],
  1244. "lastUserMessageIncludes": [
  1245. "<task-notification>",
  1246. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1247. "must NOT be treated as approval or consent."
  1248. ]
  1249. },
  1250. "response": {
  1251. "statusCode": 200,
  1252. "text": {
  1253. "id": "upstream-e2e-background-cancel-agent-notification",
  1254. "text": "background-cancel-agent-stopped-ok"
  1255. }
  1256. }
  1257. },
  1258. {
  1259. "id": "upstream-background-taskstop-agent-tool-call",
  1260. "description": "BG10: main agent launches a background Agent that the model will stop with TaskStop.",
  1261. "metadata": {
  1262. "kind": "main",
  1263. "timingPolicy": "fast-tool-use",
  1264. "source": "synthetic",
  1265. "syntheticReason": "稳定触发 running local_agent task,后续 provider replay 用 TaskStop 停止它。"
  1266. },
  1267. "maxMatches": 1,
  1268. "match": {
  1269. "method": "POST",
  1270. "pathIncludes": "/messages",
  1271. "bodyIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT"],
  1272. "bodyExcludes": [
  1273. "Async agent launched successfully",
  1274. "agentId: agent_",
  1275. "Generate a concise title",
  1276. "CRITICAL: Respond with TEXT ONLY",
  1277. "Verify whether the active session goal"
  1278. ],
  1279. "lastUserMessageIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT"]
  1280. },
  1281. "response": {
  1282. "statusCode": 200,
  1283. "toolUse": {
  1284. "id": "toolu_e2e_background_taskstop_agent",
  1285. "name": "Agent",
  1286. "input": {
  1287. "description": "E2E background TaskStop agent",
  1288. "prompt": "E2E_BACKGROUND_TASKSTOP_AGENT_CHILD: Stay running until stopped. If not stopped, return E2E_BACKGROUND_TASKSTOP_AGENT_CHILD_UNEXPECTED.",
  1289. "run_in_background": true
  1290. }
  1291. }
  1292. }
  1293. },
  1294. {
  1295. "id": "upstream-background-taskstop-agent-tool-stop",
  1296. "description": "BG10: parent uses TaskStop with the launched Agent task id.",
  1297. "metadata": {
  1298. "kind": "main",
  1299. "timingPolicy": "fast-tool-use",
  1300. "source": "synthetic",
  1301. "syntheticReason": "验证 provider-visible TaskStop tool 会复用 runtime background stop dispatcher。"
  1302. },
  1303. "maxMatches": 1,
  1304. "match": {
  1305. "method": "POST",
  1306. "pathIncludes": "/messages",
  1307. "bodyIncludes": [
  1308. "E2E_BACKGROUND_TASKSTOP_AGENT",
  1309. "Async agent launched successfully",
  1310. "agentId: agent_"
  1311. ],
  1312. "bodyExcludes": [
  1313. "Generate a concise title",
  1314. "CRITICAL: Respond with TEXT ONLY",
  1315. "Verify whether the active session goal"
  1316. ]
  1317. },
  1318. "response": {
  1319. "statusCode": 200,
  1320. "toolUse": {
  1321. "id": "toolu_e2e_background_taskstop_stop",
  1322. "name": "TaskStop",
  1323. "input": {
  1324. "task_id": "{{latestAgentId}}"
  1325. }
  1326. }
  1327. }
  1328. },
  1329. {
  1330. "id": "upstream-background-taskstop-agent-child-delayed-result",
  1331. "description": "BG10: delayed child Agent response that should be aborted by TaskStop.",
  1332. "metadata": {
  1333. "kind": "subagent",
  1334. "timingPolicy": "delayed-text",
  1335. "source": "synthetic",
  1336. "syntheticReason": "保持 child provider request 运行,验证 TaskStop 会 abort running background Agent。"
  1337. },
  1338. "maxMatches": 1,
  1339. "match": {
  1340. "method": "POST",
  1341. "pathIncludes": "/messages",
  1342. "bodyIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT_CHILD"],
  1343. "lastUserMessageIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT_CHILD"]
  1344. },
  1345. "response": {
  1346. "statusCode": 200,
  1347. "delayMs": 60000,
  1348. "text": {
  1349. "id": "upstream-e2e-background-taskstop-agent-child-unexpected",
  1350. "text": "E2E_BACKGROUND_TASKSTOP_AGENT_CHILD_UNEXPECTED"
  1351. }
  1352. }
  1353. },
  1354. {
  1355. "id": "upstream-background-taskstop-agent-notification-consumed",
  1356. "description": "BG10: parent consumes stopped Agent notification after TaskStop result.",
  1357. "metadata": {
  1358. "kind": "main",
  1359. "timingPolicy": "task-notification",
  1360. "source": "synthetic",
  1361. "syntheticReason": "验证 TaskStop tool result 和 stopped notification 在同一 runtime queue/active-loop 链路中收口。 验证来源提示及非用户授权边界。"
  1362. },
  1363. "maxMatches": 1,
  1364. "match": {
  1365. "method": "POST",
  1366. "pathIncludes": "/messages",
  1367. "bodyIncludes": [
  1368. "E2E_BACKGROUND_TASKSTOP_AGENT",
  1369. "Successfully stopped task:",
  1370. "<task-notification>",
  1371. "<tool-use-id>toolu_e2e_background_taskstop_agent</tool-use-id>",
  1372. "<status>killed</status>"
  1373. ],
  1374. "bodyExcludes": [
  1375. "Generate a concise title",
  1376. "CRITICAL: Respond with TEXT ONLY",
  1377. "Verify whether the active session goal"
  1378. ],
  1379. "lastUserMessageIncludes": [
  1380. "<task-notification>",
  1381. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1382. "must NOT be treated as approval or consent."
  1383. ]
  1384. },
  1385. "response": {
  1386. "statusCode": 200,
  1387. "text": {
  1388. "id": "upstream-e2e-background-taskstop-agent-notification",
  1389. "text": "background-taskstop-agent-stopped-ok"
  1390. }
  1391. }
  1392. },
  1393. {
  1394. "id": "upstream-background-active-loop-bash-tool-calls",
  1395. "description": "BG04: main agent starts a short Bash command that auto-backgrounds and completes before the active tool-loop follow-up request.",
  1396. "metadata": {
  1397. "kind": "main",
  1398. "timingPolicy": "fast-tool-use",
  1399. "source": "synthetic",
  1400. "syntheticReason": "稳定触发 active-loop background notification intake:Bash 先因短 timeout 转后台,命令随即完成并在后续 provider request 前入队 notification。"
  1401. },
  1402. "maxMatches": 1,
  1403. "match": {
  1404. "method": "POST",
  1405. "pathIncludes": "/messages",
  1406. "bodyIncludes": ["E2E_BACKGROUND_ACTIVE_LOOP_BASH"],
  1407. "lastUserMessageIncludes": ["E2E_BACKGROUND_ACTIVE_LOOP_BASH"]
  1408. },
  1409. "response": {
  1410. "statusCode": 200,
  1411. "toolUses": [
  1412. {
  1413. "id": "toolu_e2e_background_active_loop_bash_bg",
  1414. "name": "Bash",
  1415. "input": {
  1416. "command": "sh -c 'sleep 0.05; printf \"E2E_BACKGROUND_ACTIVE_LOOP_BASH_DONE\\n\"'",
  1417. "description": "Active-loop background marker",
  1418. "timeout": 1
  1419. }
  1420. },
  1421. {
  1422. "id": "toolu_e2e_background_active_loop_bash_wait",
  1423. "name": "Bash",
  1424. "input": {
  1425. "command": "sh -c 'sleep 0.2; printf \"E2E_BACKGROUND_ACTIVE_LOOP_WAIT_DONE\\n\"'",
  1426. "description": "Hold active tool loop for background completion"
  1427. }
  1428. }
  1429. ]
  1430. }
  1431. },
  1432. {
  1433. "id": "upstream-background-active-loop-notification-consumed",
  1434. "description": "BG04: parent consumes completed background Bash notification in the active tool-loop follow-up request.",
  1435. "metadata": {
  1436. "kind": "main",
  1437. "timingPolicy": "task-notification",
  1438. "source": "synthetic",
  1439. "syntheticReason": "验证同一次 provider request 同时包含上一轮 Bash tool result 与 <task-notification>,而不是等 idle wake 单独开一轮。 验证来源提示及非用户授权边界。"
  1440. },
  1441. "maxMatches": 1,
  1442. "match": {
  1443. "method": "POST",
  1444. "pathIncludes": "/messages",
  1445. "bodyIncludes": [
  1446. "E2E_BACKGROUND_ACTIVE_LOOP_BASH",
  1447. "E2E_BACKGROUND_ACTIVE_LOOP_WAIT_DONE",
  1448. "<task-notification>",
  1449. "<tool-use-id>toolu_e2e_background_active_loop_bash_bg</tool-use-id>",
  1450. "<status>completed</status>"
  1451. ],
  1452. "lastUserMessageIncludes": [
  1453. "<task-notification>",
  1454. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1455. "must NOT be treated as approval or consent."
  1456. ]
  1457. },
  1458. "response": {
  1459. "statusCode": 200,
  1460. "text": {
  1461. "id": "upstream-e2e-background-active-loop-notification",
  1462. "text": "background-active-loop-notification-consumed-ok"
  1463. }
  1464. }
  1465. },
  1466. {
  1467. "id": "upstream-background-goal-seed",
  1468. "description": "BG34: create the v4 session before setting the background goal.",
  1469. "metadata": {
  1470. "kind": "main",
  1471. "timingPolicy": "fast-text",
  1472. "source": "synthetic",
  1473. "syntheticReason": "V4 /goal 需要已有 session;首轮仅建立 BG34 的稳定会话边界。"
  1474. },
  1475. "maxMatches": 1,
  1476. "match": {
  1477. "method": "POST",
  1478. "pathIncludes": "/messages",
  1479. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_SEED"],
  1480. "bodyExcludes": [
  1481. "Generate a concise title",
  1482. "CRITICAL: Respond with TEXT ONLY",
  1483. "Continue working toward the active session goal"
  1484. ]
  1485. },
  1486. "response": {
  1487. "statusCode": 200,
  1488. "text": {
  1489. "id": "upstream-e2e-background-goal-seed",
  1490. "text": "background-goal-seed-ok"
  1491. }
  1492. }
  1493. },
  1494. {
  1495. "id": "upstream-background-goal-agent-tool-call",
  1496. "description": "BG03: goal continuation launches a background Agent.",
  1497. "metadata": {
  1498. "kind": "main",
  1499. "timingPolicy": "fast-tool-use",
  1500. "source": "synthetic",
  1501. "syntheticReason": "goal continuation 中启动 background Agent。"
  1502. },
  1503. "maxMatches": 1,
  1504. "match": {
  1505. "method": "POST",
  1506. "pathIncludes": "/messages",
  1507. "bodyIncludes": ["E2E_BACKGROUND_GOAL", "Continue working toward the active session goal"],
  1508. "bodyExcludes": [
  1509. "Generate a concise title",
  1510. "CRITICAL: Respond with TEXT ONLY",
  1511. "Verify whether the active session goal"
  1512. ]
  1513. },
  1514. "response": {
  1515. "statusCode": 200,
  1516. "toolUse": {
  1517. "id": "toolu_e2e_background_goal_agent",
  1518. "name": "Agent",
  1519. "input": {
  1520. "description": "Goal background",
  1521. "prompt": "E2E_BACKGROUND_GOAL_CHILD: Return exactly E2E_BACKGROUND_GOAL_CHILD_RESULT.",
  1522. "run_in_background": true
  1523. }
  1524. }
  1525. }
  1526. },
  1527. {
  1528. "id": "upstream-background-goal-agent-launch-ack",
  1529. "description": "BG03: goal continuation finishes before child Agent result.",
  1530. "metadata": {
  1531. "kind": "main",
  1532. "timingPolicy": "fast-text",
  1533. "source": "synthetic",
  1534. "syntheticReason": "goal continuation 的当前 turn 在子任务完成前先结束。"
  1535. },
  1536. "maxMatches": 1,
  1537. "match": {
  1538. "method": "POST",
  1539. "pathIncludes": "/messages",
  1540. "bodyIncludes": ["E2E_BACKGROUND_GOAL", "Async agent launched successfully"],
  1541. "bodyExcludes": [
  1542. "Generate a concise title",
  1543. "CRITICAL: Respond with TEXT ONLY",
  1544. "Verify whether the active session goal"
  1545. ]
  1546. },
  1547. "response": {
  1548. "statusCode": 200,
  1549. "text": {
  1550. "id": "upstream-e2e-background-goal-launch-ack",
  1551. "text": "background-goal-agent-launched-ok"
  1552. }
  1553. }
  1554. },
  1555. {
  1556. "id": "upstream-background-goal-direct-prompt",
  1557. "description": "BG34: a real user prompt starts immediately while only the goal background Agent is running.",
  1558. "metadata": {
  1559. "kind": "main",
  1560. "timingPolicy": "fast-text",
  1561. "source": "synthetic",
  1562. "syntheticReason": "稳定证明 active goal 的 background-only 状态不等于 main busy,用户输入不经过 future queue。"
  1563. },
  1564. "maxMatches": 1,
  1565. "match": {
  1566. "method": "POST",
  1567. "pathIncludes": "/messages",
  1568. "bodyIncludes": ["E2E_BACKGROUND_GOAL_DIRECT_PROMPT"],
  1569. "bodyExcludes": [
  1570. "Generate a concise title",
  1571. "CRITICAL: Respond with TEXT ONLY",
  1572. "Verify whether the active session goal"
  1573. ],
  1574. "lastUserMessageExcludes": ["<task-notification>"],
  1575. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_DIRECT_PROMPT"]
  1576. },
  1577. "response": {
  1578. "statusCode": 200,
  1579. "text": {
  1580. "id": "upstream-e2e-background-goal-direct-prompt",
  1581. "text": "background-goal-direct-prompt-ok"
  1582. }
  1583. }
  1584. },
  1585. {
  1586. "id": "upstream-background-goal-child-delayed-result",
  1587. "description": "BG03: delayed child Agent result for goal.",
  1588. "metadata": {
  1589. "kind": "subagent",
  1590. "timingPolicy": "delayed-text",
  1591. "source": "synthetic",
  1592. "syntheticReason": "延迟子 agent 完成,证明 verifier 会等 notification。"
  1593. },
  1594. "maxMatches": 1,
  1595. "match": {
  1596. "method": "POST",
  1597. "pathIncludes": "/messages",
  1598. "bodyIncludes": ["E2E_BACKGROUND_GOAL_CHILD"],
  1599. "bodyExcludes": [
  1600. "Generate a concise title",
  1601. "CRITICAL: Respond with TEXT ONLY",
  1602. "Verify whether the active session goal"
  1603. ],
  1604. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_CHILD"]
  1605. },
  1606. "response": {
  1607. "statusCode": 200,
  1608. "delayMs": 8000,
  1609. "text": {
  1610. "id": "upstream-e2e-background-goal-child-result",
  1611. "text": "E2E_BACKGROUND_GOAL_CHILD_RESULT"
  1612. }
  1613. }
  1614. },
  1615. {
  1616. "id": "upstream-background-goal-notification-consumed",
  1617. "description": "BG03: parent consumes goal background notification.",
  1618. "metadata": {
  1619. "kind": "main",
  1620. "timingPolicy": "task-notification",
  1621. "source": "synthetic",
  1622. "syntheticReason": "goal notification turn 消费子结果。 验证来源提示及非用户授权边界。"
  1623. },
  1624. "maxMatches": 1,
  1625. "match": {
  1626. "method": "POST",
  1627. "pathIncludes": "/messages",
  1628. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_GOAL_CHILD_RESULT"],
  1629. "bodyExcludes": [
  1630. "Generate a concise title",
  1631. "CRITICAL: Respond with TEXT ONLY",
  1632. "Verify whether the active session goal"
  1633. ],
  1634. "lastUserMessageIncludes": [
  1635. "<task-notification>",
  1636. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1637. "must NOT be treated as approval or consent."
  1638. ]
  1639. },
  1640. "response": {
  1641. "statusCode": 200,
  1642. "text": {
  1643. "id": "upstream-e2e-background-goal-notification",
  1644. "text": "E2E_BACKGROUND_GOAL_NOTIFICATION_CONSUMED"
  1645. }
  1646. }
  1647. },
  1648. {
  1649. "id": "upstream-background-goal-verifier-passed",
  1650. "description": "BG03: verifier passes only after background notification is consumed.",
  1651. "metadata": {
  1652. "kind": "goal-verifier",
  1653. "timingPolicy": "controlled-stream",
  1654. "source": "synthetic",
  1655. "syntheticReason": "验证 verifier 只在 notification 后执行并通过,并稳定留出 future queue admission 窗口。"
  1656. },
  1657. "maxMatches": 1,
  1658. "match": {
  1659. "method": "POST",
  1660. "pathIncludes": "/messages",
  1661. "bodyIncludes": [
  1662. "E2E_BACKGROUND_GOAL",
  1663. "E2E_BACKGROUND_GOAL_NOTIFICATION_CONSUMED",
  1664. "Verify whether the active session goal"
  1665. ],
  1666. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  1667. },
  1668. "response": {
  1669. "statusCode": 200,
  1670. "delayMs": 4000,
  1671. "headers": {
  1672. "content-type": "application/json; charset=utf-8"
  1673. },
  1674. "body": "{\"id\":\"upstream-e2e-background-goal-verifier-passed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"passed\\\":true,\\\"reason\\\":\\\"The background notification has been consumed.\\\",\\\"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\"}}"
  1675. }
  1676. },
  1677. {
  1678. "id": "upstream-background-goal-verifier-queue-drained",
  1679. "description": "BG34: verifier pass promotes the queued real user prompt without another legacy mutation.",
  1680. "metadata": {
  1681. "kind": "main",
  1682. "timingPolicy": "fast-text",
  1683. "source": "synthetic",
  1684. "syntheticReason": "稳定验证 TargetChanged(complete) 本身会重新评估 CLI queue gate 并自动提升队首。"
  1685. },
  1686. "maxMatches": 1,
  1687. "match": {
  1688. "method": "POST",
  1689. "pathIncludes": "/messages",
  1690. "bodyIncludes": ["E2E_BACKGROUND_GOAL_VERIFIER_QUEUE"],
  1691. "bodyExcludes": [
  1692. "Generate a concise title",
  1693. "CRITICAL: Respond with TEXT ONLY",
  1694. "Verify whether the active session goal"
  1695. ],
  1696. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_VERIFIER_QUEUE"]
  1697. },
  1698. "response": {
  1699. "statusCode": 200,
  1700. "text": {
  1701. "id": "upstream-e2e-background-goal-verifier-queue-drained",
  1702. "text": "background-goal-verifier-queue-drained-ok"
  1703. }
  1704. }
  1705. },
  1706. {
  1707. "id": "upstream-background-send-agent-tool-call",
  1708. "description": "BG07: main agent launches a background Agent before sending it a coordinator message.",
  1709. "metadata": {
  1710. "kind": "main",
  1711. "timingPolicy": "fast-tool-use",
  1712. "source": "synthetic",
  1713. "syntheticReason": "稳定触发 Agent(run_in_background=true),后续用 SendMessage 验证 running child steer。"
  1714. },
  1715. "maxMatches": 1,
  1716. "match": {
  1717. "method": "POST",
  1718. "pathIncludes": "/messages",
  1719. "bodyIncludes": ["E2E_BACKGROUND_SEND_MESSAGE"],
  1720. "bodyExcludes": [
  1721. "Async agent launched successfully",
  1722. "agentId: agent_",
  1723. "Generate a concise title",
  1724. "CRITICAL: Respond with TEXT ONLY",
  1725. "Verify whether the active session goal"
  1726. ],
  1727. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_MESSAGE"]
  1728. },
  1729. "response": {
  1730. "statusCode": 200,
  1731. "toolUse": {
  1732. "id": "toolu_e2e_background_send_agent",
  1733. "name": "Agent",
  1734. "input": {
  1735. "description": "Wait for coordinator message",
  1736. "prompt": "E2E_BACKGROUND_SEND_MESSAGE_CHILD: Start working. When the coordinator message arrives, reply exactly E2E_BACKGROUND_SEND_MESSAGE_CHILD_RECEIVED.",
  1737. "run_in_background": true
  1738. }
  1739. }
  1740. }
  1741. },
  1742. {
  1743. "id": "upstream-background-send-message-tool-call",
  1744. "description": "BG07: parent sends a message to the running background Agent after the launch tool result.",
  1745. "metadata": {
  1746. "kind": "main",
  1747. "timingPolicy": "fast-tool-use",
  1748. "source": "synthetic",
  1749. "syntheticReason": "根据 Agent tool result 中的 agentId 调用 SendMessage,验证父 agent 能 steer running child。"
  1750. },
  1751. "maxMatches": 1,
  1752. "match": {
  1753. "method": "POST",
  1754. "pathIncludes": "/messages",
  1755. "bodyIncludes": [
  1756. "E2E_BACKGROUND_SEND_MESSAGE",
  1757. "Async agent launched successfully",
  1758. "agentId: agent_"
  1759. ],
  1760. "bodyExcludes": [
  1761. "sent to its active turn",
  1762. "Generate a concise title",
  1763. "CRITICAL: Respond with TEXT ONLY",
  1764. "Verify whether the active session goal"
  1765. ],
  1766. "lastUserMessageExcludes": ["<task-notification>"]
  1767. },
  1768. "response": {
  1769. "statusCode": 200,
  1770. "toolUse": {
  1771. "id": "toolu_e2e_background_send_message",
  1772. "name": "SendMessage",
  1773. "input": {
  1774. "to": "{{latestAgentId}}",
  1775. "summary": "E2E_BACKGROUND_SEND_MESSAGE_STEER",
  1776. "message": "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD"
  1777. }
  1778. }
  1779. }
  1780. },
  1781. {
  1782. "id": "upstream-background-send-message-ack",
  1783. "description": "BG07: parent finishes the SendMessage turn after delivery status.",
  1784. "metadata": {
  1785. "kind": "main",
  1786. "timingPolicy": "fast-text",
  1787. "source": "synthetic",
  1788. "syntheticReason": "父模型收到 SendMessage tool result 后结束当前 turn,等待 background notification。"
  1789. },
  1790. "maxMatches": 1,
  1791. "match": {
  1792. "method": "POST",
  1793. "pathIncludes": "/messages",
  1794. "bodyIncludes": [
  1795. "E2E_BACKGROUND_SEND_MESSAGE",
  1796. "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD",
  1797. "sent to its active turn"
  1798. ],
  1799. "bodyExcludes": [
  1800. "Generate a concise title",
  1801. "CRITICAL: Respond with TEXT ONLY",
  1802. "Verify whether the active session goal"
  1803. ],
  1804. "lastUserMessageExcludes": ["<task-notification>"]
  1805. },
  1806. "response": {
  1807. "statusCode": 200,
  1808. "text": {
  1809. "id": "upstream-e2e-background-send-message-ack",
  1810. "text": "background-send-message-sent-ok"
  1811. }
  1812. }
  1813. },
  1814. {
  1815. "id": "upstream-background-send-child-bash-tool-call",
  1816. "description": "BG07: child Agent starts a long local Bash tool so it can receive SendMessage during an active turn.",
  1817. "metadata": {
  1818. "kind": "subagent",
  1819. "timingPolicy": "fast-tool-use",
  1820. "source": "synthetic",
  1821. "syntheticReason": "子 agent 首轮立即释放 provider 连接,但通过 build mode 可直接允许且不会自动后台化的 sleep foreground Bash 保持 active turn,稳定覆盖 running child steer。"
  1822. },
  1823. "maxMatches": 1,
  1824. "match": {
  1825. "method": "POST",
  1826. "pathIncludes": "/messages",
  1827. "bodyIncludes": ["E2E_BACKGROUND_SEND_MESSAGE_CHILD"],
  1828. "bodyExcludes": [
  1829. "Generate a concise title",
  1830. "CRITICAL: Respond with TEXT ONLY",
  1831. "Verify whether the active session goal"
  1832. ],
  1833. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_MESSAGE_CHILD"]
  1834. },
  1835. "response": {
  1836. "statusCode": 200,
  1837. "toolUse": {
  1838. "id": "toolu_e2e_background_send_child_bash",
  1839. "name": "Bash",
  1840. "input": {
  1841. "command": "sleep 8; printf 'E2E_BACKGROUND_SEND_MESSAGE_CHILD_BASH_DONE\\n'",
  1842. "description": "Keep child turn active"
  1843. }
  1844. }
  1845. }
  1846. },
  1847. {
  1848. "id": "upstream-background-send-child-steered-result",
  1849. "description": "BG07: child Agent receives SendMessage as coordinator input.",
  1850. "metadata": {
  1851. "kind": "subagent",
  1852. "timingPolicy": "fast-text",
  1853. "source": "synthetic",
  1854. "syntheticReason": "验证子 agent 的 provider-visible request 收到完整 coordinator 中途提示。 验证来源提示及非用户授权边界。"
  1855. },
  1856. "maxMatches": 1,
  1857. "match": {
  1858. "method": "POST",
  1859. "pathIncludes": "/messages",
  1860. "bodyIncludes": [
  1861. "E2E_BACKGROUND_SEND_MESSAGE_CHILD",
  1862. "E2E_BACKGROUND_SEND_MESSAGE_CHILD_BASH_DONE",
  1863. "The coordinator sent a message while you were working:\nE2E_BACKGROUND_SEND_MESSAGE_PAYLOAD",
  1864. "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD"
  1865. ],
  1866. "bodyExcludes": [
  1867. "Generate a concise title",
  1868. "CRITICAL: Respond with TEXT ONLY",
  1869. "Verify whether the active session goal"
  1870. ],
  1871. "lastUserMessageIncludes": [
  1872. "The coordinator sent a message while you were working:\nE2E_BACKGROUND_SEND_MESSAGE_PAYLOAD",
  1873. "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD"
  1874. ]
  1875. },
  1876. "response": {
  1877. "statusCode": 200,
  1878. "text": {
  1879. "id": "upstream-e2e-background-send-child-received",
  1880. "text": "E2E_BACKGROUND_SEND_MESSAGE_CHILD_RECEIVED"
  1881. }
  1882. }
  1883. },
  1884. {
  1885. "id": "upstream-background-send-notification-consumed",
  1886. "description": "BG07: parent consumes completion notification after SendMessage-steered child result.",
  1887. "metadata": {
  1888. "kind": "main",
  1889. "timingPolicy": "task-notification",
  1890. "source": "synthetic",
  1891. "syntheticReason": "验证 SendMessage steer 后的子 agent completion 仍走 background notification。 验证来源提示及非用户授权边界。"
  1892. },
  1893. "maxMatches": 1,
  1894. "match": {
  1895. "method": "POST",
  1896. "pathIncludes": "/messages",
  1897. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_SEND_MESSAGE_CHILD_RECEIVED"],
  1898. "bodyExcludes": [
  1899. "Generate a concise title",
  1900. "CRITICAL: Respond with TEXT ONLY",
  1901. "Verify whether the active session goal"
  1902. ],
  1903. "lastUserMessageIncludes": [
  1904. "<task-notification>",
  1905. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1906. "must NOT be treated as approval or consent."
  1907. ]
  1908. },
  1909. "response": {
  1910. "statusCode": 200,
  1911. "text": {
  1912. "id": "upstream-e2e-background-send-notification",
  1913. "text": "background-send-message-notification-consumed-ok"
  1914. }
  1915. }
  1916. },
  1917. {
  1918. "id": "upstream-foreground-long-bash-loading-tool-call",
  1919. "description": "BG14: main agent starts a normal foreground Bash command that should keep the parent loading while running.",
  1920. "metadata": {
  1921. "kind": "main",
  1922. "timingPolicy": "fast-tool-use",
  1923. "source": "synthetic",
  1924. "syntheticReason": "稳定制造普通 foreground Bash running 窗口,验证 background event 豁免没有误伤前台 loading。"
  1925. },
  1926. "maxMatches": 1,
  1927. "match": {
  1928. "method": "POST",
  1929. "pathIncludes": "/messages",
  1930. "bodyIncludes": ["E2E_FOREGROUND_LONG_BASH_LOADING"],
  1931. "bodyExcludes": [
  1932. "E2E_FOREGROUND_LONG_BASH_DONE",
  1933. "Command running in background",
  1934. "Generate a concise title",
  1935. "CRITICAL: Respond with TEXT ONLY",
  1936. "Verify whether the active session goal"
  1937. ],
  1938. "lastUserMessageIncludes": ["E2E_FOREGROUND_LONG_BASH_LOADING"]
  1939. },
  1940. "response": {
  1941. "statusCode": 200,
  1942. "toolUse": {
  1943. "id": "toolu_e2e_foreground_long_bash_loading",
  1944. "name": "Bash",
  1945. "input": {
  1946. "command": "sh -c 'i=1; while [ \"$i\" -le 120 ]; do printf \"progress-line-%s\\n\" \"$i\"; i=$((i+1)); done; i=0; while [ ! -f .zcode-e2e/conversation-session-background/bg14-preview-release ] && [ \"$i\" -lt 400 ]; do sleep 0.1; i=$((i+1)); done; i=0; while [ \"$i\" -lt 4000 ]; do printf \"padding-%s\\n\" \"$i\"; i=$((i+1)); done; printf \"E2E_FOREGROUND_LONG_BASH_DONE\\n\"'",
  1947. "description": "foreground long bash loading sleep"
  1948. }
  1949. }
  1950. }
  1951. },
  1952. {
  1953. "id": "upstream-foreground-long-bash-loading-completed",
  1954. "description": "BG14: parent continues after the normal foreground Bash command completes.",
  1955. "metadata": {
  1956. "kind": "main",
  1957. "timingPolicy": "fast-text",
  1958. "source": "synthetic",
  1959. "syntheticReason": "验证 foreground Bash 完成后仍正常进入 provider continuation 并回到 idle。"
  1960. },
  1961. "maxMatches": 1,
  1962. "match": {
  1963. "method": "POST",
  1964. "pathIncludes": "/messages",
  1965. "bodyIncludes": ["E2E_FOREGROUND_LONG_BASH_LOADING", "<persisted-output>"],
  1966. "bodyExcludes": [
  1967. "Command running in background",
  1968. "Generate a concise title",
  1969. "CRITICAL: Respond with TEXT ONLY",
  1970. "Verify whether the active session goal"
  1971. ],
  1972. "lastUserMessageExcludes": ["<task-notification>"]
  1973. },
  1974. "response": {
  1975. "statusCode": 200,
  1976. "text": {
  1977. "id": "upstream-e2e-foreground-long-bash-loading-completed",
  1978. "text": "foreground-long-bash-loading-completed-ok"
  1979. }
  1980. }
  1981. },
  1982. {
  1983. "id": "upstream-foreground-child-tool-streaming-agent-tool-call",
  1984. "description": "BG13: main agent launches a foreground Agent whose child tool updates should keep the parent streaming.",
  1985. "metadata": {
  1986. "kind": "main",
  1987. "timingPolicy": "fast-tool-use",
  1988. "source": "synthetic",
  1989. "syntheticReason": "稳定触发 foreground Agent,让 child Bash 运行期间验证 parent loading 仍按原语义显示。"
  1990. },
  1991. "maxMatches": 1,
  1992. "match": {
  1993. "method": "POST",
  1994. "pathIncludes": "/messages",
  1995. "bodyIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING_STATUS"],
  1996. "bodyExcludes": [
  1997. "E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE",
  1998. "Generate a concise title",
  1999. "CRITICAL: Respond with TEXT ONLY",
  2000. "Verify whether the active session goal"
  2001. ],
  2002. "lastUserMessageIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING_STATUS"]
  2003. },
  2004. "response": {
  2005. "statusCode": 200,
  2006. "toolUse": {
  2007. "id": "toolu_e2e_foreground_child_tool_agent",
  2008. "name": "Agent",
  2009. "input": {
  2010. "description": "E2E foreground child tool streaming",
  2011. "prompt": "E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING: Run Bash with description foreground child visible bash sleep, then reply exactly E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE."
  2012. }
  2013. }
  2014. }
  2015. },
  2016. {
  2017. "id": "upstream-foreground-child-tool-streaming-child-bash-tool-call",
  2018. "description": "BG13: foreground child Agent starts a visible foreground Bash tool while parent remains running.",
  2019. "metadata": {
  2020. "kind": "subagent",
  2021. "timingPolicy": "fast-tool-use",
  2022. "source": "synthetic",
  2023. "syntheticReason": "用真实 child Bash tool update 覆盖 foreground mirrored subagent event 的 streaming 保留分支。"
  2024. },
  2025. "maxMatches": 1,
  2026. "match": {
  2027. "method": "POST",
  2028. "pathIncludes": "/messages",
  2029. "bodyIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING"],
  2030. "bodyExcludes": [
  2031. "E2E_FOREGROUND_AGENT_CHILD_TOOL_BASH_DONE",
  2032. "Generate a concise title",
  2033. "CRITICAL: Respond with TEXT ONLY",
  2034. "Verify whether the active session goal"
  2035. ],
  2036. "lastUserMessageExcludes": ["<task-notification>"],
  2037. "lastUserMessageIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING"]
  2038. },
  2039. "response": {
  2040. "statusCode": 200,
  2041. "toolUse": {
  2042. "id": "toolu_e2e_foreground_child_tool_bash",
  2043. "name": "Bash",
  2044. "input": {
  2045. "command": "sh -c 'sleep 4; printf \"E2E_FOREGROUND_AGENT_CHILD_TOOL_BASH_DONE\\n\"'",
  2046. "description": "foreground child visible bash sleep"
  2047. }
  2048. }
  2049. }
  2050. },
  2051. {
  2052. "id": "upstream-foreground-child-tool-streaming-child-done",
  2053. "description": "BG13: foreground child Agent completes after the visible Bash tool finishes.",
  2054. "metadata": {
  2055. "kind": "subagent",
  2056. "timingPolicy": "fast-text",
  2057. "source": "synthetic",
  2058. "syntheticReason": "让 foreground Agent 正常完成并把结果回传父 turn。"
  2059. },
  2060. "maxMatches": 1,
  2061. "match": {
  2062. "method": "POST",
  2063. "pathIncludes": "/messages",
  2064. "bodyIncludes": [
  2065. "E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING",
  2066. "E2E_FOREGROUND_AGENT_CHILD_TOOL_BASH_DONE"
  2067. ],
  2068. "bodyExcludes": [
  2069. "Generate a concise title",
  2070. "CRITICAL: Respond with TEXT ONLY",
  2071. "Verify whether the active session goal"
  2072. ],
  2073. "lastUserMessageExcludes": ["<task-notification>"]
  2074. },
  2075. "response": {
  2076. "statusCode": 200,
  2077. "text": {
  2078. "id": "upstream-e2e-foreground-child-tool-streaming-child-done",
  2079. "text": "E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE"
  2080. }
  2081. }
  2082. },
  2083. {
  2084. "id": "upstream-foreground-child-tool-streaming-completed",
  2085. "description": "BG13: parent consumes the foreground Agent result and completes.",
  2086. "metadata": {
  2087. "kind": "main",
  2088. "timingPolicy": "fast-text",
  2089. "source": "synthetic",
  2090. "syntheticReason": "验证 foreground subagent child tool running 窗口后,父 turn 正常收口。"
  2091. },
  2092. "maxMatches": 1,
  2093. "match": {
  2094. "method": "POST",
  2095. "pathIncludes": "/messages",
  2096. "bodyIncludes": [
  2097. "E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING_STATUS",
  2098. "E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE"
  2099. ],
  2100. "bodyExcludes": [
  2101. "Generate a concise title",
  2102. "CRITICAL: Respond with TEXT ONLY",
  2103. "Verify whether the active session goal"
  2104. ],
  2105. "lastUserMessageExcludes": ["<task-notification>"]
  2106. },
  2107. "response": {
  2108. "statusCode": 200,
  2109. "text": {
  2110. "id": "upstream-e2e-foreground-child-tool-streaming-completed",
  2111. "text": "foreground-agent-child-tool-streaming-completed-ok"
  2112. }
  2113. }
  2114. },
  2115. {
  2116. "id": "upstream-background-child-tool-idle-agent-tool-call",
  2117. "description": "BG13: main agent launches a background Agent whose child tool updates should not mark the parent idle turn as streaming.",
  2118. "metadata": {
  2119. "kind": "main",
  2120. "timingPolicy": "fast-tool-use",
  2121. "source": "synthetic",
  2122. "syntheticReason": "稳定触发 background Agent,让 child Bash 运行期间验证 parent idle UI 不显示 fake loading。"
  2123. },
  2124. "maxMatches": 1,
  2125. "match": {
  2126. "method": "POST",
  2127. "pathIncludes": "/messages",
  2128. "bodyIncludes": [
  2129. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_STATUS: Launch a background agent that runs a visible child Bash tool while the parent conversation is idle."
  2130. ],
  2131. "bodyExcludes": [
  2132. "Async agent launched successfully",
  2133. "agentId: agent_",
  2134. "Generate a concise title",
  2135. "CRITICAL: Respond with TEXT ONLY",
  2136. "Verify whether the active session goal"
  2137. ],
  2138. "lastUserMessageIncludes": [
  2139. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_STATUS: Launch a background agent that runs a visible child Bash tool while the parent conversation is idle."
  2140. ]
  2141. },
  2142. "response": {
  2143. "statusCode": 200,
  2144. "toolUse": {
  2145. "id": "toolu_e2e_background_idle_child_tool_agent",
  2146. "name": "Agent",
  2147. "input": {
  2148. "description": "E2E background child tool idle",
  2149. "prompt": "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE: Run Bash with description background idle child visible bash sleep, then reply exactly E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_DONE.",
  2150. "run_in_background": true
  2151. }
  2152. }
  2153. }
  2154. },
  2155. {
  2156. "id": "upstream-background-child-tool-idle-agent-launch-ack",
  2157. "description": "BG13: parent finishes launch turn while child Agent continues running a local tool.",
  2158. "metadata": {
  2159. "kind": "main",
  2160. "timingPolicy": "fast-text",
  2161. "source": "synthetic",
  2162. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn,制造 parent idle + child tool running 窗口。"
  2163. },
  2164. "maxMatches": 1,
  2165. "match": {
  2166. "method": "POST",
  2167. "pathIncludes": "/messages",
  2168. "bodyIncludes": [
  2169. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_STATUS",
  2170. "Async agent launched successfully"
  2171. ],
  2172. "bodyExcludes": [
  2173. "Generate a concise title",
  2174. "CRITICAL: Respond with TEXT ONLY",
  2175. "Verify whether the active session goal"
  2176. ]
  2177. },
  2178. "response": {
  2179. "statusCode": 200,
  2180. "text": {
  2181. "id": "upstream-e2e-background-child-tool-idle-launch-ack",
  2182. "text": "background-agent-child-tool-idle-launched-ok"
  2183. }
  2184. }
  2185. },
  2186. {
  2187. "id": "upstream-background-child-tool-idle-child-bash-tool-call",
  2188. "description": "BG13: child Agent starts a visible foreground Bash tool while parent remains idle.",
  2189. "metadata": {
  2190. "kind": "subagent",
  2191. "timingPolicy": "fast-tool-use",
  2192. "source": "synthetic",
  2193. "syntheticReason": "用真实 child Bash tool update 覆盖 mirrored background subagent event 的 UI streaming 保护。"
  2194. },
  2195. "maxMatches": 1,
  2196. "match": {
  2197. "method": "POST",
  2198. "pathIncludes": "/messages",
  2199. "bodyIncludes": ["E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE"],
  2200. "bodyExcludes": [
  2201. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_BASH_DONE",
  2202. "Generate a concise title",
  2203. "CRITICAL: Respond with TEXT ONLY",
  2204. "Verify whether the active session goal"
  2205. ],
  2206. "lastUserMessageExcludes": ["<task-notification>"],
  2207. "lastUserMessageIncludes": ["E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE"]
  2208. },
  2209. "response": {
  2210. "statusCode": 200,
  2211. "toolUse": {
  2212. "id": "toolu_e2e_background_idle_child_tool_bash",
  2213. "name": "Bash",
  2214. "input": {
  2215. "command": "sh -c 'while [ ! -f \".zcode-e2e/conversation-session-background/background-child-tool-idle-release\" ]; do sleep 0.1; done; printf \"E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_BASH_DONE\\n\"'",
  2216. "description": "background idle child visible bash sleep"
  2217. }
  2218. }
  2219. }
  2220. },
  2221. {
  2222. "id": "upstream-background-child-tool-idle-child-done",
  2223. "description": "BG13: child Agent completes after the visible Bash tool finishes.",
  2224. "metadata": {
  2225. "kind": "subagent",
  2226. "timingPolicy": "fast-text",
  2227. "source": "synthetic",
  2228. "syntheticReason": "让 background Agent 正常完成并产生 parent notification。"
  2229. },
  2230. "maxMatches": 1,
  2231. "match": {
  2232. "method": "POST",
  2233. "pathIncludes": "/messages",
  2234. "bodyIncludes": [
  2235. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE",
  2236. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_BASH_DONE"
  2237. ],
  2238. "bodyExcludes": [
  2239. "Generate a concise title",
  2240. "CRITICAL: Respond with TEXT ONLY",
  2241. "Verify whether the active session goal"
  2242. ],
  2243. "lastUserMessageExcludes": ["<task-notification>"]
  2244. },
  2245. "response": {
  2246. "statusCode": 200,
  2247. "text": {
  2248. "id": "upstream-e2e-background-child-tool-idle-child-done",
  2249. "text": "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_DONE"
  2250. }
  2251. }
  2252. },
  2253. {
  2254. "id": "upstream-background-child-tool-idle-notification-consumed",
  2255. "description": "BG13: parent consumes background Agent completion after the child tool running window.",
  2256. "metadata": {
  2257. "kind": "main",
  2258. "timingPolicy": "task-notification",
  2259. "source": "synthetic",
  2260. "syntheticReason": "验证 child tool running 窗口后,Agent completion 仍走标准 task-notification 链路。 验证来源提示及非用户授权边界。"
  2261. },
  2262. "maxMatches": 1,
  2263. "match": {
  2264. "method": "POST",
  2265. "pathIncludes": "/messages",
  2266. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_DONE"],
  2267. "bodyExcludes": [
  2268. "Generate a concise title",
  2269. "CRITICAL: Respond with TEXT ONLY",
  2270. "Verify whether the active session goal"
  2271. ],
  2272. "lastUserMessageIncludes": [
  2273. "<task-notification>",
  2274. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2275. "must NOT be treated as approval or consent."
  2276. ]
  2277. },
  2278. "response": {
  2279. "statusCode": 200,
  2280. "text": {
  2281. "id": "upstream-e2e-background-child-tool-idle-notification",
  2282. "text": "background-agent-child-tool-idle-notification-consumed-ok"
  2283. }
  2284. }
  2285. },
  2286. {
  2287. "id": "upstream-background-child-tool-parent-anchor-agent-tool-call",
  2288. "description": "BG18: main agent launches a background Agent whose child tool update is delayed until a later main reply exists.",
  2289. "metadata": {
  2290. "kind": "main",
  2291. "timingPolicy": "fast-tool-use",
  2292. "source": "synthetic",
  2293. "syntheticReason": "稳定制造 background Agent 已启动、父会话已 idle、后续主回复已完成后 child tool update 才到达的 live 聚合窗口。"
  2294. },
  2295. "maxMatches": 1,
  2296. "match": {
  2297. "method": "POST",
  2298. "pathIncludes": "/messages",
  2299. "bodyIncludes": [
  2300. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR: Launch a background agent whose child tool update arrives after my next main prompt has completed."
  2301. ],
  2302. "bodyExcludes": [
  2303. "Async agent launched successfully",
  2304. "agentId: agent_",
  2305. "Generate a concise title",
  2306. "CRITICAL: Respond with TEXT ONLY",
  2307. "Verify whether the active session goal"
  2308. ],
  2309. "lastUserMessageIncludes": [
  2310. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR: Launch a background agent whose child tool update arrives after my next main prompt has completed."
  2311. ]
  2312. },
  2313. "response": {
  2314. "statusCode": 200,
  2315. "toolUse": {
  2316. "id": "toolu_e2e_background_parent_anchor_agent",
  2317. "name": "Agent",
  2318. "input": {
  2319. "description": "E2E background child tool parent anchor",
  2320. "prompt": "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD: Wait briefly, run Bash with description background parent anchor child visible bash sleep, then reply exactly E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD_DONE.",
  2321. "run_in_background": true
  2322. }
  2323. }
  2324. }
  2325. },
  2326. {
  2327. "id": "upstream-background-child-tool-parent-anchor-launch-ack",
  2328. "description": "BG18: parent finishes the launch turn while child Agent remains running.",
  2329. "metadata": {
  2330. "kind": "main",
  2331. "timingPolicy": "fast-text",
  2332. "source": "synthetic",
  2333. "syntheticReason": "让父会话先回 idle,随后用户可发送第二条主消息。"
  2334. },
  2335. "maxMatches": 1,
  2336. "match": {
  2337. "method": "POST",
  2338. "pathIncludes": "/messages",
  2339. "bodyIncludes": [
  2340. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR",
  2341. "Async agent launched successfully"
  2342. ],
  2343. "bodyExcludes": [
  2344. "Generate a concise title",
  2345. "CRITICAL: Respond with TEXT ONLY",
  2346. "Verify whether the active session goal"
  2347. ]
  2348. },
  2349. "response": {
  2350. "statusCode": 200,
  2351. "text": {
  2352. "id": "upstream-e2e-background-child-tool-parent-anchor-launch-ack",
  2353. "text": "background-child-tool-parent-anchor-launched-ok"
  2354. }
  2355. }
  2356. },
  2357. {
  2358. "id": "upstream-background-child-tool-parent-anchor-follow-up",
  2359. "description": "BG18: a later main prompt completes while the background child tool response is still delayed.",
  2360. "metadata": {
  2361. "kind": "main",
  2362. "timingPolicy": "fast-text",
  2363. "source": "synthetic",
  2364. "syntheticReason": "在 child tool update 到达前创建新的主 assistant 回复,用来复现 live child tool 被错误挂到最新回复下的问题。"
  2365. },
  2366. "maxMatches": 1,
  2367. "match": {
  2368. "method": "POST",
  2369. "pathIncludes": "/messages",
  2370. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_FOLLOWUP"],
  2371. "bodyExcludes": [
  2372. "Generate a concise title",
  2373. "CRITICAL: Respond with TEXT ONLY",
  2374. "Verify whether the active session goal"
  2375. ],
  2376. "lastUserMessageExcludes": ["<task-notification>"],
  2377. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_FOLLOWUP"]
  2378. },
  2379. "response": {
  2380. "statusCode": 200,
  2381. "text": {
  2382. "id": "upstream-e2e-background-child-tool-parent-anchor-follow-up",
  2383. "text": "background-child-tool-parent-anchor-main-followup-ok"
  2384. }
  2385. }
  2386. },
  2387. {
  2388. "id": "upstream-background-child-tool-parent-anchor-child-bash-tool-call",
  2389. "description": "BG18: child Agent starts a visible Bash tool after the later main reply already exists.",
  2390. "metadata": {
  2391. "kind": "subagent",
  2392. "timingPolicy": "delayed-tool-use",
  2393. "source": "synthetic",
  2394. "syntheticReason": "延迟 child Bash tool_use,稳定验证 mirrored child tool update 必须按 parentToolUseId 回挂原 Agent message。"
  2395. },
  2396. "maxMatches": 1,
  2397. "match": {
  2398. "method": "POST",
  2399. "pathIncludes": "/messages",
  2400. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD"],
  2401. "bodyExcludes": [
  2402. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_BASH_DONE",
  2403. "Generate a concise title",
  2404. "CRITICAL: Respond with TEXT ONLY",
  2405. "Verify whether the active session goal"
  2406. ],
  2407. "lastUserMessageExcludes": ["<task-notification>"],
  2408. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD"]
  2409. },
  2410. "response": {
  2411. "statusCode": 200,
  2412. "delayMs": 6000,
  2413. "toolUse": {
  2414. "id": "toolu_e2e_background_parent_anchor_child_bash",
  2415. "name": "Bash",
  2416. "input": {
  2417. "command": "sh -c 'while [ ! -f \".zcode-e2e/conversation-session-background/background-parent-anchor-release\" ]; do sleep 0.1; done; printf \"E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_BASH_DONE\\n\"'",
  2418. "description": "background parent anchor child visible bash sleep"
  2419. }
  2420. }
  2421. }
  2422. },
  2423. {
  2424. "id": "upstream-background-child-tool-parent-anchor-child-done",
  2425. "description": "BG18: child Agent completes after its visible Bash tool finishes.",
  2426. "metadata": {
  2427. "kind": "subagent",
  2428. "timingPolicy": "fast-text",
  2429. "source": "synthetic",
  2430. "syntheticReason": "让 background Agent 正常完成并产生 parent notification。"
  2431. },
  2432. "maxMatches": 1,
  2433. "match": {
  2434. "method": "POST",
  2435. "pathIncludes": "/messages",
  2436. "bodyIncludes": [
  2437. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD",
  2438. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_BASH_DONE"
  2439. ],
  2440. "bodyExcludes": [
  2441. "Generate a concise title",
  2442. "CRITICAL: Respond with TEXT ONLY",
  2443. "Verify whether the active session goal"
  2444. ],
  2445. "lastUserMessageExcludes": ["<task-notification>"]
  2446. },
  2447. "response": {
  2448. "statusCode": 200,
  2449. "text": {
  2450. "id": "upstream-e2e-background-child-tool-parent-anchor-child-done",
  2451. "text": "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD_DONE"
  2452. }
  2453. }
  2454. },
  2455. {
  2456. "id": "upstream-background-child-tool-parent-anchor-notification-consumed",
  2457. "description": "BG18: parent consumes background Agent completion after the parented child tool placement assertion.",
  2458. "metadata": {
  2459. "kind": "main",
  2460. "timingPolicy": "task-notification",
  2461. "source": "synthetic",
  2462. "syntheticReason": "验证 child tool placement 修复不影响标准 task-notification 收口。 验证来源提示及非用户授权边界。"
  2463. },
  2464. "maxMatches": 1,
  2465. "match": {
  2466. "method": "POST",
  2467. "pathIncludes": "/messages",
  2468. "bodyIncludes": [
  2469. "<task-notification>",
  2470. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD_DONE"
  2471. ],
  2472. "bodyExcludes": [
  2473. "Generate a concise title",
  2474. "CRITICAL: Respond with TEXT ONLY",
  2475. "Verify whether the active session goal"
  2476. ],
  2477. "lastUserMessageIncludes": [
  2478. "<task-notification>",
  2479. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2480. "must NOT be treated as approval or consent."
  2481. ]
  2482. },
  2483. "response": {
  2484. "statusCode": 200,
  2485. "text": {
  2486. "id": "upstream-e2e-background-child-tool-parent-anchor-notification",
  2487. "text": "background-child-tool-parent-anchor-notification-consumed-ok"
  2488. }
  2489. }
  2490. },
  2491. {
  2492. "id": "upstream-background-session-switch-agent-tool-call",
  2493. "description": "BG21: main agent launches a background Agent whose child Bash completes while the user is viewing another session.",
  2494. "metadata": {
  2495. "kind": "main",
  2496. "timingPolicy": "fast-tool-use",
  2497. "source": "synthetic",
  2498. "syntheticReason": "稳定制造 background Agent + child Bash tool 已出现,随后切走父 session 的窗口。"
  2499. },
  2500. "maxMatches": 1,
  2501. "match": {
  2502. "method": "POST",
  2503. "pathIncludes": "/messages",
  2504. "bodyIncludes": [
  2505. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH: Launch a background agent whose child Bash completes while I am viewing another session."
  2506. ],
  2507. "bodyExcludes": [
  2508. "Async agent launched successfully",
  2509. "agentId: agent_",
  2510. "Generate a concise title",
  2511. "CRITICAL: Respond with TEXT ONLY",
  2512. "Verify whether the active session goal"
  2513. ],
  2514. "lastUserMessageIncludes": [
  2515. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH: Launch a background agent whose child Bash completes while I am viewing another session."
  2516. ]
  2517. },
  2518. "response": {
  2519. "statusCode": 200,
  2520. "toolUse": {
  2521. "id": "toolu_e2e_background_session_switch_agent",
  2522. "name": "Agent",
  2523. "input": {
  2524. "description": "E2E background session switch child tool",
  2525. "prompt": "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD: Run Bash with description background session switch child visible bash, then reply exactly E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD_DONE.",
  2526. "run_in_background": true
  2527. }
  2528. }
  2529. }
  2530. },
  2531. {
  2532. "id": "upstream-background-session-switch-launch-ack",
  2533. "description": "BG21: parent finishes launch turn while child Agent remains running.",
  2534. "metadata": {
  2535. "kind": "main",
  2536. "timingPolicy": "fast-text",
  2537. "source": "synthetic",
  2538. "syntheticReason": "让父会话先回 idle,随后测试切到其他 session/draft。"
  2539. },
  2540. "maxMatches": 1,
  2541. "match": {
  2542. "method": "POST",
  2543. "pathIncludes": "/messages",
  2544. "bodyIncludes": [
  2545. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH",
  2546. "Async agent launched successfully"
  2547. ],
  2548. "bodyExcludes": [
  2549. "Generate a concise title",
  2550. "CRITICAL: Respond with TEXT ONLY",
  2551. "Verify whether the active session goal"
  2552. ]
  2553. },
  2554. "response": {
  2555. "statusCode": 200,
  2556. "text": {
  2557. "id": "upstream-e2e-background-session-switch-launch-ack",
  2558. "text": "background-session-switch-launched-ok"
  2559. }
  2560. }
  2561. },
  2562. {
  2563. "id": "upstream-background-session-switch-child-bash-tool-call",
  2564. "description": "BG21: child Agent starts a visible Bash tool before the parent session is hidden.",
  2565. "metadata": {
  2566. "kind": "subagent",
  2567. "timingPolicy": "delayed-tool-use",
  2568. "source": "synthetic",
  2569. "syntheticReason": "先让 child Bash running card 进入父 renderer store;命令等待文件 barrier,由测试在父 session 隐藏后释放。"
  2570. },
  2571. "maxMatches": 1,
  2572. "match": {
  2573. "method": "POST",
  2574. "pathIncludes": "/messages",
  2575. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD"],
  2576. "bodyExcludes": [
  2577. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_BASH_DONE",
  2578. "Generate a concise title",
  2579. "CRITICAL: Respond with TEXT ONLY",
  2580. "Verify whether the active session goal"
  2581. ],
  2582. "lastUserMessageExcludes": ["<task-notification>"],
  2583. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD"]
  2584. },
  2585. "response": {
  2586. "statusCode": 200,
  2587. "delayMs": 500,
  2588. "toolUse": {
  2589. "id": "toolu_e2e_background_session_switch_child_bash",
  2590. "name": "Bash",
  2591. "input": {
  2592. "command": "sh -c 'while [ ! -f .zcode-e2e/conversation-session-background/bg21-child-tool-release ]; do sleep 0.1; done; printf \"E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_BASH_DONE\\n\"'",
  2593. "description": "background session switch child visible bash"
  2594. }
  2595. }
  2596. }
  2597. },
  2598. {
  2599. "id": "upstream-background-session-switch-child-done",
  2600. "description": "BG21: child Agent completes after Bash finishes while the parent session is hidden.",
  2601. "metadata": {
  2602. "kind": "subagent",
  2603. "timingPolicy": "fast-text",
  2604. "source": "synthetic",
  2605. "syntheticReason": "让 hidden/tombstoned terminal tool update 和 Agent completion notification 都完成。"
  2606. },
  2607. "maxMatches": 1,
  2608. "match": {
  2609. "method": "POST",
  2610. "pathIncludes": "/messages",
  2611. "bodyIncludes": [
  2612. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD",
  2613. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_BASH_DONE"
  2614. ],
  2615. "bodyExcludes": [
  2616. "Generate a concise title",
  2617. "CRITICAL: Respond with TEXT ONLY",
  2618. "Verify whether the active session goal"
  2619. ],
  2620. "lastUserMessageExcludes": ["<task-notification>"]
  2621. },
  2622. "response": {
  2623. "statusCode": 200,
  2624. "text": {
  2625. "id": "upstream-e2e-background-session-switch-child-done",
  2626. "text": "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD_DONE"
  2627. }
  2628. }
  2629. },
  2630. {
  2631. "id": "upstream-background-session-switch-notification-consumed",
  2632. "description": "BG21: parent consumes completion notification while the task is not active.",
  2633. "metadata": {
  2634. "kind": "main",
  2635. "timingPolicy": "task-notification",
  2636. "source": "synthetic",
  2637. "syntheticReason": "验证切回后 UI 从 store/snapshot 恢复 terminal child tool 投影。 验证来源提示及非用户授权边界。"
  2638. },
  2639. "maxMatches": 1,
  2640. "match": {
  2641. "method": "POST",
  2642. "pathIncludes": "/messages",
  2643. "bodyIncludes": [
  2644. "<task-notification>",
  2645. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD_DONE"
  2646. ],
  2647. "bodyExcludes": [
  2648. "Generate a concise title",
  2649. "CRITICAL: Respond with TEXT ONLY",
  2650. "Verify whether the active session goal"
  2651. ],
  2652. "lastUserMessageIncludes": [
  2653. "<task-notification>",
  2654. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2655. "must NOT be treated as approval or consent."
  2656. ]
  2657. },
  2658. "response": {
  2659. "statusCode": 200,
  2660. "text": {
  2661. "id": "upstream-e2e-background-session-switch-notification",
  2662. "text": "background-session-switch-notification-consumed-ok"
  2663. }
  2664. }
  2665. },
  2666. {
  2667. "id": "upstream-background-switch-back-running-agent-tool-call",
  2668. "description": "BG22: main agent launches a background Agent whose child Bash is still running when the user switches back.",
  2669. "metadata": {
  2670. "kind": "main",
  2671. "timingPolicy": "fast-tool-use",
  2672. "source": "synthetic",
  2673. "syntheticReason": "稳定制造 background Agent + child Bash tool 已出现且切回时仍 running 的窗口。"
  2674. },
  2675. "maxMatches": 1,
  2676. "match": {
  2677. "method": "POST",
  2678. "pathIncludes": "/messages",
  2679. "bodyIncludes": [
  2680. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING: Launch a background agent whose child Bash is still running when I switch back."
  2681. ],
  2682. "bodyExcludes": [
  2683. "Async agent launched successfully",
  2684. "agentId: agent_",
  2685. "Generate a concise title",
  2686. "CRITICAL: Respond with TEXT ONLY",
  2687. "Verify whether the active session goal"
  2688. ],
  2689. "lastUserMessageIncludes": [
  2690. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING: Launch a background agent whose child Bash is still running when I switch back."
  2691. ]
  2692. },
  2693. "response": {
  2694. "statusCode": 200,
  2695. "toolUse": {
  2696. "id": "toolu_e2e_background_switch_back_running_agent",
  2697. "name": "Agent",
  2698. "input": {
  2699. "description": "E2E background switch back running child tool",
  2700. "prompt": "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD: Run Bash with description background switch back running child visible bash, then reply exactly E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD_DONE.",
  2701. "run_in_background": true
  2702. }
  2703. }
  2704. }
  2705. },
  2706. {
  2707. "id": "upstream-background-switch-back-running-launch-ack",
  2708. "description": "BG22: parent finishes launch turn while child Agent remains running.",
  2709. "metadata": {
  2710. "kind": "main",
  2711. "timingPolicy": "fast-text",
  2712. "source": "synthetic",
  2713. "syntheticReason": "让父会话先回 idle,随后测试切到其他 session/draft 后立即切回。"
  2714. },
  2715. "maxMatches": 1,
  2716. "match": {
  2717. "method": "POST",
  2718. "pathIncludes": "/messages",
  2719. "bodyIncludes": [
  2720. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING",
  2721. "Async agent launched successfully"
  2722. ],
  2723. "bodyExcludes": [
  2724. "Generate a concise title",
  2725. "CRITICAL: Respond with TEXT ONLY",
  2726. "Verify whether the active session goal"
  2727. ]
  2728. },
  2729. "response": {
  2730. "statusCode": 200,
  2731. "text": {
  2732. "id": "upstream-e2e-background-switch-back-running-launch-ack",
  2733. "text": "background-switch-back-running-launched-ok"
  2734. }
  2735. }
  2736. },
  2737. {
  2738. "id": "upstream-background-switch-back-running-child-bash-tool-call",
  2739. "description": "BG22: child Agent starts a visible Bash tool that is still running when the parent session is selected again.",
  2740. "metadata": {
  2741. "kind": "subagent",
  2742. "timingPolicy": "delayed-tool-use",
  2743. "source": "synthetic",
  2744. "syntheticReason": "先让 child Bash running card 进入父 renderer store,并保持足够长时间覆盖切回时仍 running 的窗口。"
  2745. },
  2746. "maxMatches": 1,
  2747. "match": {
  2748. "method": "POST",
  2749. "pathIncludes": "/messages",
  2750. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD"],
  2751. "bodyExcludes": [
  2752. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_BASH_DONE",
  2753. "Generate a concise title",
  2754. "CRITICAL: Respond with TEXT ONLY",
  2755. "Verify whether the active session goal"
  2756. ],
  2757. "lastUserMessageExcludes": ["<task-notification>"],
  2758. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD"]
  2759. },
  2760. "response": {
  2761. "statusCode": 200,
  2762. "delayMs": 500,
  2763. "toolUse": {
  2764. "id": "toolu_e2e_background_switch_back_running_child_bash",
  2765. "name": "Bash",
  2766. "input": {
  2767. "command": "sh -c 'while [ ! -f \".zcode-e2e/conversation-session-background/background-switch-back-release\" ]; do sleep 0.1; done; printf \"E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_BASH_DONE\\n\"'",
  2768. "description": "background switch back running child visible bash"
  2769. }
  2770. }
  2771. }
  2772. },
  2773. {
  2774. "id": "upstream-background-switch-back-running-child-done",
  2775. "description": "BG22: child Agent completes after Bash finishes while the parent session is visible again.",
  2776. "metadata": {
  2777. "kind": "subagent",
  2778. "timingPolicy": "fast-text",
  2779. "source": "synthetic",
  2780. "syntheticReason": "验证切回可见状态后 child Bash terminal update 仍会 patch 同一 tool card。"
  2781. },
  2782. "maxMatches": 1,
  2783. "match": {
  2784. "method": "POST",
  2785. "pathIncludes": "/messages",
  2786. "bodyIncludes": [
  2787. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD",
  2788. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_BASH_DONE"
  2789. ],
  2790. "bodyExcludes": [
  2791. "Generate a concise title",
  2792. "CRITICAL: Respond with TEXT ONLY",
  2793. "Verify whether the active session goal"
  2794. ],
  2795. "lastUserMessageExcludes": ["<task-notification>"]
  2796. },
  2797. "response": {
  2798. "statusCode": 200,
  2799. "text": {
  2800. "id": "upstream-e2e-background-switch-back-running-child-done",
  2801. "text": "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD_DONE"
  2802. }
  2803. }
  2804. },
  2805. {
  2806. "id": "upstream-background-switch-back-running-notification-consumed",
  2807. "description": "BG22: parent consumes completion notification after the user has switched back.",
  2808. "metadata": {
  2809. "kind": "main",
  2810. "timingPolicy": "task-notification",
  2811. "source": "synthetic",
  2812. "syntheticReason": "验证切回后后续 Agent completion notification 仍按标准链路消费。 验证来源提示及非用户授权边界。"
  2813. },
  2814. "maxMatches": 1,
  2815. "match": {
  2816. "method": "POST",
  2817. "pathIncludes": "/messages",
  2818. "bodyIncludes": [
  2819. "<task-notification>",
  2820. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD_DONE"
  2821. ],
  2822. "bodyExcludes": [
  2823. "Generate a concise title",
  2824. "CRITICAL: Respond with TEXT ONLY",
  2825. "Verify whether the active session goal"
  2826. ],
  2827. "lastUserMessageIncludes": [
  2828. "<task-notification>",
  2829. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2830. "must NOT be treated as approval or consent."
  2831. ]
  2832. },
  2833. "response": {
  2834. "statusCode": 200,
  2835. "text": {
  2836. "id": "upstream-e2e-background-switch-back-running-notification",
  2837. "text": "background-switch-back-running-notification-consumed-ok"
  2838. }
  2839. }
  2840. },
  2841. {
  2842. "id": "upstream-background-send-now-queue-agent-tool-call",
  2843. "description": "BG16: main agent launches a background Agent whose child tool keeps raw runtime streaming while main is idle.",
  2844. "metadata": {
  2845. "kind": "main",
  2846. "timingPolicy": "fast-tool-use",
  2847. "source": "synthetic",
  2848. "syntheticReason": "稳定制造 main idle + background-only child tool running + held queue 的窗口,复现 queued prompt Send now 不应 stop background task。"
  2849. },
  2850. "maxMatches": 1,
  2851. "match": {
  2852. "method": "POST",
  2853. "pathIncludes": "/messages",
  2854. "bodyIncludes": [
  2855. "E2E_BACKGROUND_SEND_NOW_QUEUE: Launch a background agent with a visible child Bash tool, then wait."
  2856. ],
  2857. "bodyExcludes": [
  2858. "Async agent launched successfully",
  2859. "agentId: agent_",
  2860. "Generate a concise title",
  2861. "CRITICAL: Respond with TEXT ONLY",
  2862. "Verify whether the active session goal"
  2863. ],
  2864. "lastUserMessageIncludes": [
  2865. "E2E_BACKGROUND_SEND_NOW_QUEUE: Launch a background agent with a visible child Bash tool, then wait."
  2866. ]
  2867. },
  2868. "response": {
  2869. "statusCode": 200,
  2870. "toolUse": {
  2871. "id": "toolu_e2e_background_send_now_queue_agent",
  2872. "name": "Agent",
  2873. "input": {
  2874. "description": "E2E background send now queue",
  2875. "prompt": "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD: Run Bash with description background send now queue child bash sleep, then reply exactly E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_DONE.",
  2876. "run_in_background": true
  2877. }
  2878. }
  2879. }
  2880. },
  2881. {
  2882. "id": "upstream-background-send-now-queue-agent-launch-ack",
  2883. "description": "BG16: parent finishes launch turn while background Agent continues running.",
  2884. "metadata": {
  2885. "kind": "main",
  2886. "timingPolicy": "fast-text",
  2887. "source": "synthetic",
  2888. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn,制造 parent idle + child tool running 窗口。"
  2889. },
  2890. "maxMatches": 1,
  2891. "match": {
  2892. "method": "POST",
  2893. "pathIncludes": "/messages",
  2894. "bodyIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE", "Async agent launched successfully"],
  2895. "bodyExcludes": [
  2896. "Generate a concise title",
  2897. "CRITICAL: Respond with TEXT ONLY",
  2898. "Verify whether the active session goal"
  2899. ]
  2900. },
  2901. "response": {
  2902. "statusCode": 200,
  2903. "text": {
  2904. "id": "upstream-e2e-background-send-now-queue-launch-ack",
  2905. "text": "background-send-now-queue-launched-ok"
  2906. }
  2907. }
  2908. },
  2909. {
  2910. "id": "upstream-background-send-now-queue-child-bash-tool-call",
  2911. "description": "BG16: child Agent starts a visible foreground Bash tool while parent remains idle.",
  2912. "metadata": {
  2913. "kind": "subagent",
  2914. "timingPolicy": "fast-tool-use",
  2915. "source": "synthetic",
  2916. "syntheticReason": "用文件 barrier 控制真实 child Bash 生命周期,让父侧 raw runtime streaming 但 mainActive=false;点击 Send now 后再释放,避免固定 sleep 受全量负载影响。"
  2917. },
  2918. "maxMatches": 1,
  2919. "match": {
  2920. "method": "POST",
  2921. "pathIncludes": "/messages",
  2922. "bodyIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD"],
  2923. "bodyExcludes": [
  2924. "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_BASH_DONE",
  2925. "Generate a concise title",
  2926. "CRITICAL: Respond with TEXT ONLY",
  2927. "Verify whether the active session goal"
  2928. ],
  2929. "lastUserMessageExcludes": ["<task-notification>"],
  2930. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD"]
  2931. },
  2932. "response": {
  2933. "statusCode": 200,
  2934. "toolUse": {
  2935. "id": "toolu_e2e_background_send_now_queue_child_bash",
  2936. "name": "Bash",
  2937. "input": {
  2938. "command": "sh -c 'while [ ! -f \".zcode-e2e/conversation-session-background/background-send-now-queue-release\" ]; do sleep 0.1; done; printf \"E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_BASH_DONE\\n\"'",
  2939. "description": "background send now queue child bash sleep"
  2940. }
  2941. }
  2942. }
  2943. },
  2944. {
  2945. "id": "upstream-background-send-now-queue-hold",
  2946. "description": "BG16: foreground hold turn creates a real typed queue before stop transitions to background-only idle.",
  2947. "metadata": {
  2948. "kind": "main",
  2949. "timingPolicy": "controlled-stream",
  2950. "source": "synthetic",
  2951. "syntheticReason": "使用真实主 turn 与 composer queue 替代已删除的 renderer store 注入,稳定构造 stop 后 background-only + paused queue。"
  2952. },
  2953. "maxMatches": 1,
  2954. "match": {
  2955. "method": "POST",
  2956. "pathIncludes": "/messages",
  2957. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_BACKGROUND_SEND_NOW_QUEUE_HOLD"],
  2958. "bodyExcludes": [
  2959. "Generate a concise title",
  2960. "CRITICAL: Respond with TEXT ONLY",
  2961. "Verify whether the active session goal"
  2962. ],
  2963. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_HOLD"]
  2964. },
  2965. "response": {
  2966. "statusCode": 200,
  2967. "delayMs": 60000,
  2968. "text": {
  2969. "id": "upstream-e2e-background-send-now-queue-hold",
  2970. "inputTokens": 120,
  2971. "outputTokens": 12,
  2972. "text": "upstream-e2e-ok"
  2973. }
  2974. }
  2975. },
  2976. {
  2977. "id": "upstream-background-send-now-queue-prompt-received",
  2978. "description": "BG16: clicked queued prompt is sent as a normal provider request without stopping background task.",
  2979. "metadata": {
  2980. "kind": "main",
  2981. "timingPolicy": "fast-text",
  2982. "source": "synthetic",
  2983. "syntheticReason": "验证 background-only running 下 queued prompt Send now 直接触发 provider request,而不是先 stop background task。"
  2984. },
  2985. "maxMatches": 1,
  2986. "match": {
  2987. "method": "POST",
  2988. "pathIncludes": "/messages",
  2989. "bodyIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_PAYLOAD"],
  2990. "bodyExcludes": [
  2991. "Generate a concise title",
  2992. "CRITICAL: Respond with TEXT ONLY",
  2993. "Verify whether the active session goal"
  2994. ],
  2995. "lastUserMessageExcludes": ["<task-notification>"],
  2996. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_PAYLOAD"]
  2997. },
  2998. "response": {
  2999. "statusCode": 200,
  3000. "text": {
  3001. "id": "upstream-e2e-background-send-now-queue-received",
  3002. "text": "background-send-now-queue-received-ok"
  3003. }
  3004. }
  3005. },
  3006. {
  3007. "id": "upstream-background-send-now-queue-child-done",
  3008. "description": "BG16: child Agent completes after the queued prompt has already been sent.",
  3009. "metadata": {
  3010. "kind": "subagent",
  3011. "timingPolicy": "fast-text",
  3012. "source": "synthetic",
  3013. "syntheticReason": "证明 Send now 没有停止 background Agent;child Bash 自然完成后 Agent 继续产生 completion notification。"
  3014. },
  3015. "maxMatches": 1,
  3016. "match": {
  3017. "method": "POST",
  3018. "pathIncludes": "/messages",
  3019. "bodyIncludes": [
  3020. "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD",
  3021. "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_BASH_DONE"
  3022. ],
  3023. "bodyExcludes": [
  3024. "Generate a concise title",
  3025. "CRITICAL: Respond with TEXT ONLY",
  3026. "Verify whether the active session goal"
  3027. ],
  3028. "lastUserMessageExcludes": ["<task-notification>"]
  3029. },
  3030. "response": {
  3031. "statusCode": 200,
  3032. "text": {
  3033. "id": "upstream-e2e-background-send-now-queue-child-done",
  3034. "text": "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_DONE"
  3035. }
  3036. }
  3037. },
  3038. {
  3039. "id": "upstream-background-send-now-queue-notification-consumed",
  3040. "description": "BG16: parent consumes background Agent completion after queued Send now.",
  3041. "metadata": {
  3042. "kind": "main",
  3043. "timingPolicy": "task-notification",
  3044. "source": "synthetic",
  3045. "syntheticReason": "验证 queued Send now 后 background Agent completion 仍走标准 task-notification 链路。 验证来源提示及非用户授权边界。"
  3046. },
  3047. "maxMatches": 1,
  3048. "match": {
  3049. "method": "POST",
  3050. "pathIncludes": "/messages",
  3051. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_DONE"],
  3052. "bodyExcludes": [
  3053. "Generate a concise title",
  3054. "CRITICAL: Respond with TEXT ONLY",
  3055. "Verify whether the active session goal"
  3056. ],
  3057. "lastUserMessageIncludes": [
  3058. "<task-notification>",
  3059. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3060. "must NOT be treated as approval or consent."
  3061. ]
  3062. },
  3063. "response": {
  3064. "statusCode": 200,
  3065. "text": {
  3066. "id": "upstream-e2e-background-send-now-queue-notification",
  3067. "text": "background-send-now-queue-notification-consumed-ok"
  3068. }
  3069. }
  3070. },
  3071. {
  3072. "id": "upstream-background-queue-drain-agent-tool-call",
  3073. "description": "BG17: main agent starts a background Agent before user follow-up messages are queued.",
  3074. "metadata": {
  3075. "kind": "main",
  3076. "timingPolicy": "fast-tool-use",
  3077. "source": "synthetic",
  3078. "syntheticReason": "稳定启动真实 background Agent;后续 delayed launch ack 再制造 main running + background running 的 queue 窗口。"
  3079. },
  3080. "maxMatches": 1,
  3081. "match": {
  3082. "method": "POST",
  3083. "pathIncludes": "/messages",
  3084. "bodyIncludes": [
  3085. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END: Start a background agent, but let me queue follow-up messages while this main turn is still running."
  3086. ],
  3087. "bodyExcludes": [
  3088. "Async agent launched successfully",
  3089. "agentId: agent_",
  3090. "Generate a concise title",
  3091. "CRITICAL: Respond with TEXT ONLY",
  3092. "Verify whether the active session goal"
  3093. ],
  3094. "lastUserMessageIncludes": [
  3095. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END: Start a background agent, but let me queue follow-up messages while this main turn is still running."
  3096. ]
  3097. },
  3098. "response": {
  3099. "statusCode": 200,
  3100. "toolUse": {
  3101. "id": "toolu_e2e_background_queue_drain_agent",
  3102. "name": "Agent",
  3103. "input": {
  3104. "description": "E2E background queue drain agent",
  3105. "prompt": "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD: Wait briefly, then reply exactly E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE.",
  3106. "run_in_background": true
  3107. }
  3108. }
  3109. }
  3110. },
  3111. {
  3112. "id": "upstream-background-queue-drain-agent-launch-ack",
  3113. "description": "BG17: parent keeps the launch turn active after starting the background Agent.",
  3114. "metadata": {
  3115. "kind": "main",
  3116. "timingPolicy": "controlled-stream",
  3117. "source": "synthetic",
  3118. "syntheticReason": "延迟父模型 launch ack,稳定制造 background Agent 已 running、main turn 仍 active 时用户消息进入 renderer queue。"
  3119. },
  3120. "maxMatches": 1,
  3121. "match": {
  3122. "method": "POST",
  3123. "pathIncludes": "/messages",
  3124. "bodyIncludes": [
  3125. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END",
  3126. "Async agent launched successfully"
  3127. ],
  3128. "bodyExcludes": [
  3129. "Generate a concise title",
  3130. "CRITICAL: Respond with TEXT ONLY",
  3131. "Verify whether the active session goal"
  3132. ]
  3133. },
  3134. "response": {
  3135. "statusCode": 200,
  3136. "delayMs": 8000,
  3137. "text": {
  3138. "id": "upstream-e2e-background-queue-drain-launch-ack",
  3139. "text": "background-queue-drain-launched-ok"
  3140. }
  3141. }
  3142. },
  3143. {
  3144. "id": "upstream-background-queue-drain-child-delayed-result",
  3145. "description": "BG17: child Agent stays running until the test releases it after Q4 is consumed.",
  3146. "metadata": {
  3147. "kind": "subagent",
  3148. "timingPolicy": "controlled-stream",
  3149. "source": "synthetic",
  3150. "syntheticReason": "受控挂起 background Agent completion,测试在 Q4 回复完成后再放行,notification 才不会抢在 queued prompt drain 验证前进入父会话。固定延迟会被慢机器上的 drain 间隔追上。"
  3151. },
  3152. "maxMatches": 1,
  3153. "match": {
  3154. "method": "POST",
  3155. "pathIncludes": "/messages",
  3156. "bodyIncludes": [
  3157. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD: Wait briefly, then reply exactly E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE."
  3158. ],
  3159. "bodyExcludes": [
  3160. "Generate a concise title",
  3161. "CRITICAL: Respond with TEXT ONLY",
  3162. "Verify whether the active session goal"
  3163. ],
  3164. "lastUserMessageExcludes": ["<task-notification>"],
  3165. "lastUserMessageIncludes": [
  3166. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD: Wait briefly, then reply exactly E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE."
  3167. ]
  3168. },
  3169. "response": {
  3170. "statusCode": 200,
  3171. "statusMessage": "OK",
  3172. "headers": {
  3173. "cache-control": "no-cache",
  3174. "content-type": "text/event-stream; charset=utf-8"
  3175. },
  3176. "releaseAfterChunks": 1,
  3177. "chunks": [
  3178. {
  3179. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-background-queue-drain-child-done\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n",
  3180. "delayMs": 0
  3181. },
  3182. {
  3183. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  3184. "delayMs": 0
  3185. },
  3186. {
  3187. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE\"}}\n\n",
  3188. "delayMs": 0
  3189. },
  3190. {
  3191. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  3192. "delayMs": 0
  3193. },
  3194. {
  3195. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":118,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n",
  3196. "delayMs": 0
  3197. },
  3198. { "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "delayMs": 0 }
  3199. ]
  3200. }
  3201. },
  3202. {
  3203. "id": "upstream-background-queue-drain-first-queued-prompt",
  3204. "description": "BG17: first follow-up prompt after the background launch stays active long enough to queue another prompt.",
  3205. "metadata": {
  3206. "kind": "main",
  3207. "timingPolicy": "controlled-stream",
  3208. "source": "synthetic",
  3209. "syntheticReason": "延迟 Q2 响应,稳定验证 launch ack 前已入队的 Q3/Q4 不会在 Q2 drain 后丢失。"
  3210. },
  3211. "maxMatches": 1,
  3212. "match": {
  3213. "method": "POST",
  3214. "pathIncludes": "/messages",
  3215. "bodyIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q2"],
  3216. "bodyExcludes": [
  3217. "Generate a concise title",
  3218. "CRITICAL: Respond with TEXT ONLY",
  3219. "Verify whether the active session goal"
  3220. ],
  3221. "lastUserMessageExcludes": ["<task-notification>"],
  3222. "lastUserMessageIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q2"]
  3223. },
  3224. "response": {
  3225. "statusCode": 200,
  3226. "delayMs": 8000,
  3227. "text": {
  3228. "id": "upstream-e2e-background-queue-drain-first",
  3229. "text": "background-queue-drain-first-ok"
  3230. }
  3231. }
  3232. },
  3233. {
  3234. "id": "upstream-background-queue-drain-second-queued-prompt",
  3235. "description": "BG17: second follow-up prompt drains after Q2 completes.",
  3236. "metadata": {
  3237. "kind": "main",
  3238. "timingPolicy": "controlled-stream",
  3239. "source": "synthetic",
  3240. "syntheticReason": "延迟 Q3 响应,稳定观察 Q3 已渲染为 user message 且 Q4 仍留在 queue 的 UI 窗口。"
  3241. },
  3242. "maxMatches": 1,
  3243. "match": {
  3244. "method": "POST",
  3245. "pathIncludes": "/messages",
  3246. "bodyIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q3"],
  3247. "bodyExcludes": [
  3248. "Generate a concise title",
  3249. "CRITICAL: Respond with TEXT ONLY",
  3250. "Verify whether the active session goal"
  3251. ],
  3252. "lastUserMessageExcludes": ["<task-notification>"],
  3253. "lastUserMessageIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q3"]
  3254. },
  3255. "response": {
  3256. "statusCode": 200,
  3257. "delayMs": 8000,
  3258. "text": {
  3259. "id": "upstream-e2e-background-queue-drain-second",
  3260. "text": "background-queue-drain-second-ok"
  3261. }
  3262. }
  3263. },
  3264. {
  3265. "id": "upstream-background-queue-drain-third-queued-prompt",
  3266. "description": "BG17: Q4 queued before launch ack drains after Q3.",
  3267. "metadata": {
  3268. "kind": "main",
  3269. "timingPolicy": "controlled-stream",
  3270. "source": "synthetic",
  3271. "syntheticReason": "延迟 Q4 响应,稳定观察 Q4 drain 后已渲染为 user message。"
  3272. },
  3273. "maxMatches": 1,
  3274. "match": {
  3275. "method": "POST",
  3276. "pathIncludes": "/messages",
  3277. "bodyIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q4"],
  3278. "bodyExcludes": [
  3279. "Generate a concise title",
  3280. "CRITICAL: Respond with TEXT ONLY",
  3281. "Verify whether the active session goal"
  3282. ],
  3283. "lastUserMessageExcludes": ["<task-notification>"],
  3284. "lastUserMessageIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q4"]
  3285. },
  3286. "response": {
  3287. "statusCode": 200,
  3288. "delayMs": 2000,
  3289. "text": {
  3290. "id": "upstream-e2e-background-queue-drain-third",
  3291. "text": "background-queue-drain-third-ok"
  3292. }
  3293. }
  3294. },
  3295. {
  3296. "id": "upstream-background-queue-drain-notification-consumed",
  3297. "description": "BG17: parent consumes background Agent completion after queued prompt drain.",
  3298. "metadata": {
  3299. "kind": "main",
  3300. "timingPolicy": "task-notification",
  3301. "source": "synthetic",
  3302. "syntheticReason": "验证 queued prompt drain 不会丢失后续 background Agent completion notification。 验证来源提示及非用户授权边界。"
  3303. },
  3304. "maxMatches": 1,
  3305. "match": {
  3306. "method": "POST",
  3307. "pathIncludes": "/messages",
  3308. "bodyIncludes": [
  3309. "<task-notification>",
  3310. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE"
  3311. ],
  3312. "bodyExcludes": [
  3313. "Generate a concise title",
  3314. "CRITICAL: Respond with TEXT ONLY",
  3315. "Verify whether the active session goal"
  3316. ],
  3317. "lastUserMessageIncludes": [
  3318. "<task-notification>",
  3319. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3320. "must NOT be treated as approval or consent."
  3321. ]
  3322. },
  3323. "response": {
  3324. "statusCode": 200,
  3325. "text": {
  3326. "id": "upstream-e2e-background-queue-drain-notification",
  3327. "text": "background-queue-drain-notification-consumed-ok"
  3328. }
  3329. }
  3330. },
  3331. {
  3332. "id": "upstream-background-nested-agent-tool-call",
  3333. "description": "BG06: main agent launches a background Agent that starts a nested background Bash.",
  3334. "metadata": {
  3335. "kind": "main",
  3336. "timingPolicy": "fast-tool-use",
  3337. "source": "synthetic",
  3338. "syntheticReason": "稳定触发 background Agent 内部启动 background Bash,验证 parent surface 只消费 Agent completion。"
  3339. },
  3340. "maxMatches": 1,
  3341. "match": {
  3342. "method": "POST",
  3343. "pathIncludes": "/messages",
  3344. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH"],
  3345. "bodyExcludes": [
  3346. "Async agent launched successfully",
  3347. "agentId: agent_",
  3348. "Generate a concise title",
  3349. "CRITICAL: Respond with TEXT ONLY",
  3350. "Verify whether the active session goal"
  3351. ],
  3352. "lastUserMessageIncludes": ["E2E_BACKGROUND_NESTED_BASH"]
  3353. },
  3354. "response": {
  3355. "statusCode": 200,
  3356. "toolUse": {
  3357. "id": "toolu_e2e_background_nested_agent",
  3358. "name": "Agent",
  3359. "input": {
  3360. "description": "Nested background Bash",
  3361. "prompt": "E2E_BACKGROUND_NESTED_BASH_CHILD: Start Bash(run_in_background=true), then finish with exactly E2E_BACKGROUND_NESTED_BASH_CHILD_DONE.",
  3362. "run_in_background": true
  3363. }
  3364. }
  3365. }
  3366. },
  3367. {
  3368. "id": "upstream-background-nested-agent-launch-ack",
  3369. "description": "BG06: parent finishes launch turn after nested Agent starts asynchronously.",
  3370. "metadata": {
  3371. "kind": "main",
  3372. "timingPolicy": "fast-text",
  3373. "source": "synthetic",
  3374. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn。"
  3375. },
  3376. "maxMatches": 1,
  3377. "match": {
  3378. "method": "POST",
  3379. "pathIncludes": "/messages",
  3380. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH", "Async agent launched successfully"],
  3381. "bodyExcludes": [
  3382. "Generate a concise title",
  3383. "CRITICAL: Respond with TEXT ONLY",
  3384. "Verify whether the active session goal"
  3385. ]
  3386. },
  3387. "response": {
  3388. "statusCode": 200,
  3389. "text": {
  3390. "id": "upstream-e2e-background-nested-launch-ack",
  3391. "text": "background-nested-bash-launched-ok"
  3392. }
  3393. }
  3394. },
  3395. {
  3396. "id": "upstream-background-nested-child-bash-tool-call",
  3397. "description": "BG06: child Agent starts a background Bash command and then should be allowed to complete before Bash exits.",
  3398. "metadata": {
  3399. "kind": "subagent",
  3400. "timingPolicy": "fast-tool-use",
  3401. "source": "synthetic",
  3402. "syntheticReason": "稳定触发 child runtime 内部 Bash(run_in_background=true)。"
  3403. },
  3404. "maxMatches": 1,
  3405. "match": {
  3406. "method": "POST",
  3407. "pathIncludes": "/messages",
  3408. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH_CHILD"],
  3409. "bodyExcludes": [
  3410. "Command running in background",
  3411. "Generate a concise title",
  3412. "CRITICAL: Respond with TEXT ONLY",
  3413. "Verify whether the active session goal"
  3414. ],
  3415. "lastUserMessageExcludes": ["<task-notification>"],
  3416. "lastUserMessageIncludes": ["E2E_BACKGROUND_NESTED_BASH_CHILD"]
  3417. },
  3418. "response": {
  3419. "statusCode": 200,
  3420. "toolUse": {
  3421. "id": "toolu_e2e_background_nested_child_bash",
  3422. "name": "Bash",
  3423. "input": {
  3424. "command": "sleep 1; printf 'nested bash done\\n'",
  3425. "description": "Nested child background Bash",
  3426. "run_in_background": true
  3427. }
  3428. }
  3429. }
  3430. },
  3431. {
  3432. "id": "upstream-background-nested-child-stops-after-bash-launch",
  3433. "description": "BG06: child Agent stops after receiving the backgrounded Bash launch result.",
  3434. "metadata": {
  3435. "kind": "subagent",
  3436. "timingPolicy": "fast-text",
  3437. "source": "synthetic",
  3438. "syntheticReason": "证明 parent Agent completion 不等待 nested Bash terminal。"
  3439. },
  3440. "maxMatches": 1,
  3441. "match": {
  3442. "method": "POST",
  3443. "pathIncludes": "/messages",
  3444. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH_CHILD", "Command running in background"],
  3445. "bodyExcludes": [
  3446. "Generate a concise title",
  3447. "CRITICAL: Respond with TEXT ONLY",
  3448. "Verify whether the active session goal"
  3449. ],
  3450. "lastUserMessageExcludes": ["<task-notification>"]
  3451. },
  3452. "response": {
  3453. "statusCode": 200,
  3454. "text": {
  3455. "id": "upstream-e2e-background-nested-child-done",
  3456. "text": "E2E_BACKGROUND_NESTED_BASH_CHILD_DONE"
  3457. }
  3458. }
  3459. },
  3460. {
  3461. "id": "upstream-background-nested-notification-consumed",
  3462. "description": "BG06: parent consumes the Agent completion notification and does not receive a second parent result for nested Bash.",
  3463. "metadata": {
  3464. "kind": "main",
  3465. "timingPolicy": "task-notification",
  3466. "source": "synthetic",
  3467. "syntheticReason": "验证 parent surface 只消费 Agent completion notification。 验证来源提示及非用户授权边界。"
  3468. },
  3469. "maxMatches": 1,
  3470. "match": {
  3471. "method": "POST",
  3472. "pathIncludes": "/messages",
  3473. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_NESTED_BASH_CHILD_DONE"],
  3474. "bodyExcludes": [
  3475. "toolu_e2e_background_nested_child_bash",
  3476. "Generate a concise title",
  3477. "CRITICAL: Respond with TEXT ONLY",
  3478. "Verify whether the active session goal"
  3479. ],
  3480. "lastUserMessageIncludes": [
  3481. "<task-notification>",
  3482. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3483. "must NOT be treated as approval or consent."
  3484. ]
  3485. },
  3486. "response": {
  3487. "statusCode": 200,
  3488. "text": {
  3489. "id": "upstream-e2e-background-nested-notification",
  3490. "text": "background-nested-bash-notification-consumed-ok"
  3491. }
  3492. }
  3493. },
  3494. {
  3495. "id": "upstream-background-snapshot-control-ready",
  3496. "description": "BG23: launch two real background Bash tasks so the right summary panel can reproduce a partial terminal update.",
  3497. "metadata": {
  3498. "kind": "main",
  3499. "timingPolicy": "fast-tool-use",
  3500. "source": "synthetic",
  3501. "syntheticReason": "稳定启动两个 background Bash:第一个先完成,第二个保持 running,用真实右上角 background control 面板复现闪没场景。"
  3502. },
  3503. "maxMatches": 1,
  3504. "match": {
  3505. "method": "POST",
  3506. "pathIncludes": "/messages",
  3507. "bodyIncludes": ["E2E_BACKGROUND_SNAPSHOT_CONTROL"],
  3508. "bodyExcludes": [
  3509. "Generate a concise title",
  3510. "CRITICAL: Respond with TEXT ONLY",
  3511. "Verify whether the active session goal"
  3512. ],
  3513. "lastUserMessageIncludes": ["E2E_BACKGROUND_SNAPSHOT_CONTROL"]
  3514. },
  3515. "response": {
  3516. "statusCode": 200,
  3517. "toolUses": [
  3518. {
  3519. "id": "toolu_e2e_bg23_bash_one",
  3520. "name": "Bash",
  3521. "input": {
  3522. "command": "sh -c 'sleep 8; printf \"E2E_BG23_BASH_ONE_DONE\\n\"'",
  3523. "description": "E2E BG23 bash one",
  3524. "run_in_background": true
  3525. }
  3526. },
  3527. {
  3528. "id": "toolu_e2e_bg23_bash_two",
  3529. "name": "Bash",
  3530. "input": {
  3531. "command": "sh -c 'sleep 60; printf \"E2E_BG23_BASH_TWO_DONE\\n\"'",
  3532. "description": "E2E BG23 bash two",
  3533. "run_in_background": true
  3534. }
  3535. }
  3536. ]
  3537. }
  3538. },
  3539. {
  3540. "id": "upstream-background-snapshot-control-launch-ack",
  3541. "description": "BG23: parent finishes the launch turn while both background Bash controls are visible.",
  3542. "metadata": {
  3543. "kind": "main",
  3544. "timingPolicy": "fast-text",
  3545. "source": "synthetic",
  3546. "syntheticReason": "让 main 回到 idle,同时右上角 background control 面板仍有两个 running Bash row。"
  3547. },
  3548. "maxMatches": 1,
  3549. "match": {
  3550. "method": "POST",
  3551. "pathIncludes": "/messages",
  3552. "bodyIncludes": [
  3553. "E2E_BACKGROUND_SNAPSHOT_CONTROL",
  3554. "toolu_e2e_bg23_bash_one",
  3555. "toolu_e2e_bg23_bash_two",
  3556. "Command running in background"
  3557. ],
  3558. "bodyExcludes": [
  3559. "Generate a concise title",
  3560. "CRITICAL: Respond with TEXT ONLY",
  3561. "Verify whether the active session goal"
  3562. ]
  3563. },
  3564. "response": {
  3565. "statusCode": 200,
  3566. "text": {
  3567. "id": "upstream-e2e-background-snapshot-control-ready",
  3568. "text": "background-snapshot-control-ready-ok"
  3569. }
  3570. }
  3571. },
  3572. {
  3573. "id": "upstream-background-snapshot-control-first-notification",
  3574. "description": "BG23: first background Bash completes while the second stays running.",
  3575. "metadata": {
  3576. "kind": "main",
  3577. "timingPolicy": "task-notification",
  3578. "source": "synthetic",
  3579. "syntheticReason": "消费第一个 background Bash completion notification,并保持第二个 running row 可见。 验证来源提示及非用户授权边界。"
  3580. },
  3581. "maxMatches": 1,
  3582. "match": {
  3583. "method": "POST",
  3584. "pathIncludes": "/messages",
  3585. "bodyIncludes": [
  3586. "E2E_BACKGROUND_SNAPSHOT_CONTROL",
  3587. "<task-notification>",
  3588. "<tool-use-id>toolu_e2e_bg23_bash_one</tool-use-id>",
  3589. "<status>completed</status>"
  3590. ],
  3591. "bodyExcludes": [
  3592. "Generate a concise title",
  3593. "CRITICAL: Respond with TEXT ONLY",
  3594. "Verify whether the active session goal"
  3595. ],
  3596. "lastUserMessageIncludes": [
  3597. "<task-notification>",
  3598. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3599. "must NOT be treated as approval or consent."
  3600. ]
  3601. },
  3602. "response": {
  3603. "statusCode": 200,
  3604. "text": {
  3605. "id": "upstream-e2e-background-snapshot-control-first-notification",
  3606. "text": "background-snapshot-control-first-notification-ok"
  3607. }
  3608. }
  3609. },
  3610. {
  3611. "id": "upstream-background-snapshot-control-second-stopped",
  3612. "description": "BG23: stop the second background Bash for deterministic cleanup.",
  3613. "metadata": {
  3614. "kind": "main",
  3615. "timingPolicy": "task-notification",
  3616. "source": "synthetic",
  3617. "syntheticReason": "消费第二个 background Bash stop notification,避免长 running task 泄漏到后续测试。 验证来源提示及非用户授权边界。"
  3618. },
  3619. "maxMatches": 1,
  3620. "match": {
  3621. "method": "POST",
  3622. "pathIncludes": "/messages",
  3623. "bodyIncludes": [
  3624. "E2E_BACKGROUND_SNAPSHOT_CONTROL",
  3625. "<task-notification>",
  3626. "<tool-use-id>toolu_e2e_bg23_bash_two</tool-use-id>",
  3627. "<status>killed</status>"
  3628. ],
  3629. "bodyExcludes": [
  3630. "Generate a concise title",
  3631. "CRITICAL: Respond with TEXT ONLY",
  3632. "Verify whether the active session goal"
  3633. ],
  3634. "lastUserMessageIncludes": [
  3635. "<task-notification>",
  3636. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3637. "must NOT be treated as approval or consent."
  3638. ]
  3639. },
  3640. "response": {
  3641. "statusCode": 200,
  3642. "text": {
  3643. "id": "upstream-e2e-background-snapshot-control-second-stopped",
  3644. "text": "background-snapshot-control-second-stopped-ok"
  3645. }
  3646. }
  3647. },
  3648. {
  3649. "id": "upstream-background-agent-control-preserve-ready",
  3650. "description": "BG24: launch one long-running background Agent and three short-lived background Agent tasks so the third short-lived completion notification can run while the long-running peer remains running.",
  3651. "metadata": {
  3652. "kind": "main",
  3653. "timingPolicy": "fast-tool-use",
  3654. "source": "synthetic",
  3655. "syntheticReason": "稳定启动四个 background Agent:三个 short-lived Agent 依次完成,long-running Agent 保持 running,用真实右上角 background control 面板复现 Agent row 闪没场景。"
  3656. },
  3657. "maxMatches": 1,
  3658. "match": {
  3659. "method": "POST",
  3660. "pathIncludes": "/messages",
  3661. "bodyIncludes": ["E2E_BACKGROUND_AGENT_CONTROL_PRESERVE"],
  3662. "bodyExcludes": [
  3663. "Async agent launched successfully",
  3664. "agentId: agent_",
  3665. "Generate a concise title",
  3666. "CRITICAL: Respond with TEXT ONLY",
  3667. "Verify whether the active session goal"
  3668. ],
  3669. "lastUserMessageIncludes": ["E2E_BACKGROUND_AGENT_CONTROL_PRESERVE"]
  3670. },
  3671. "response": {
  3672. "statusCode": 200,
  3673. "toolUses": [
  3674. {
  3675. "id": "toolu_e2e_bg24_long_running_agent",
  3676. "name": "Agent",
  3677. "input": {
  3678. "description": "E2E BG24 long-running keepalive agent",
  3679. "prompt": "E2E_BG24_LONG_RUNNING_CHILD: Stay running until stopped. If not stopped, return E2E_BG24_LONG_RUNNING_CHILD_UNEXPECTED.",
  3680. "run_in_background": true
  3681. }
  3682. },
  3683. {
  3684. "id": "toolu_e2e_bg24_short_lived_one_agent",
  3685. "name": "Agent",
  3686. "input": {
  3687. "description": "E2E BG24 short-lived one agent",
  3688. "prompt": "E2E_BG24_SHORT_LIVED_ONE_CHILD: Finish after a short delay and return exactly E2E_BG24_SHORT_LIVED_ONE_CHILD_DONE.",
  3689. "run_in_background": true
  3690. }
  3691. },
  3692. {
  3693. "id": "toolu_e2e_bg24_short_lived_two_agent",
  3694. "name": "Agent",
  3695. "input": {
  3696. "description": "E2E BG24 short-lived two agent",
  3697. "prompt": "E2E_BG24_SHORT_LIVED_TWO_CHILD: Finish after a short delay and return exactly E2E_BG24_SHORT_LIVED_TWO_CHILD_DONE.",
  3698. "run_in_background": true
  3699. }
  3700. },
  3701. {
  3702. "id": "toolu_e2e_bg24_short_lived_three_agent",
  3703. "name": "Agent",
  3704. "input": {
  3705. "description": "E2E BG24 short-lived three agent",
  3706. "prompt": "E2E_BG24_SHORT_LIVED_THREE_CHILD: Finish after a short delay and return exactly E2E_BG24_SHORT_LIVED_THREE_CHILD_DONE.",
  3707. "run_in_background": true
  3708. }
  3709. }
  3710. ]
  3711. }
  3712. },
  3713. {
  3714. "id": "upstream-background-agent-control-preserve-long-running-child-keepalive-tool",
  3715. "description": "BG24: long-running peer Agent stays running while short-lived Agent completes.",
  3716. "metadata": {
  3717. "kind": "subagent",
  3718. "timingPolicy": "fast-tool-use",
  3719. "source": "synthetic",
  3720. "syntheticReason": "让 long-running Agent 进入不会自行完成的 child Bash,保持 running,证明另一个 Agent completion notification 不会清掉它的 control row。"
  3721. },
  3722. "maxMatches": 1,
  3723. "match": {
  3724. "method": "POST",
  3725. "pathIncludes": "/messages",
  3726. "bodyIncludes": ["E2E_BG24_LONG_RUNNING_CHILD"],
  3727. "lastUserMessageIncludes": ["E2E_BG24_LONG_RUNNING_CHILD"]
  3728. },
  3729. "response": {
  3730. "statusCode": 200,
  3731. "toolUse": {
  3732. "id": "toolu_e2e_bg24_long_running_keepalive_bash",
  3733. "name": "Bash",
  3734. "input": {
  3735. "command": "while true; do sleep 1; done",
  3736. "description": "E2E BG24 long-running keepalive bash"
  3737. }
  3738. }
  3739. }
  3740. },
  3741. {
  3742. "id": "upstream-background-agent-control-preserve-short-lived-one-child-result",
  3743. "description": "BG24: first short-lived peer Agent completes first.",
  3744. "metadata": {
  3745. "kind": "subagent",
  3746. "timingPolicy": "delayed-text",
  3747. "source": "synthetic",
  3748. "syntheticReason": "短延迟完成第一个 short-lived background Agent,稳定触发 parent task-notification。"
  3749. },
  3750. "maxMatches": 1,
  3751. "match": {
  3752. "method": "POST",
  3753. "pathIncludes": "/messages",
  3754. "bodyIncludes": ["E2E_BG24_SHORT_LIVED_ONE_CHILD"],
  3755. "lastUserMessageIncludes": ["E2E_BG24_SHORT_LIVED_ONE_CHILD"]
  3756. },
  3757. "response": {
  3758. "statusCode": 200,
  3759. "delayMs": 4000,
  3760. "text": {
  3761. "id": "upstream-e2e-bg24-zcode-one-child-done",
  3762. "text": "E2E_BG24_SHORT_LIVED_ONE_CHILD_DONE"
  3763. }
  3764. }
  3765. },
  3766. {
  3767. "id": "upstream-background-agent-control-preserve-short-lived-two-child-result",
  3768. "description": "BG24: second short-lived peer Agent completes second.",
  3769. "metadata": {
  3770. "kind": "subagent",
  3771. "timingPolicy": "delayed-text",
  3772. "source": "synthetic",
  3773. "syntheticReason": "短延迟完成第二个 short-lived background Agent,稳定触发 parent task-notification。"
  3774. },
  3775. "maxMatches": 1,
  3776. "match": {
  3777. "method": "POST",
  3778. "pathIncludes": "/messages",
  3779. "bodyIncludes": ["E2E_BG24_SHORT_LIVED_TWO_CHILD"],
  3780. "lastUserMessageIncludes": ["E2E_BG24_SHORT_LIVED_TWO_CHILD"]
  3781. },
  3782. "response": {
  3783. "statusCode": 200,
  3784. "delayMs": 14000,
  3785. "text": {
  3786. "id": "upstream-e2e-bg24-zcode-two-child-done",
  3787. "text": "E2E_BG24_SHORT_LIVED_TWO_CHILD_DONE"
  3788. }
  3789. }
  3790. },
  3791. {
  3792. "id": "upstream-background-agent-control-preserve-short-lived-three-child-result",
  3793. "description": "BG24: third short-lived peer Agent completes third.",
  3794. "metadata": {
  3795. "kind": "subagent",
  3796. "timingPolicy": "delayed-text",
  3797. "source": "synthetic",
  3798. "syntheticReason": "短延迟完成第三个 short-lived background Agent,复现真实场景中第三个 completion notification 触发 UI 闪没。"
  3799. },
  3800. "maxMatches": 1,
  3801. "match": {
  3802. "method": "POST",
  3803. "pathIncludes": "/messages",
  3804. "bodyIncludes": ["E2E_BG24_SHORT_LIVED_THREE_CHILD"],
  3805. "lastUserMessageIncludes": ["E2E_BG24_SHORT_LIVED_THREE_CHILD"]
  3806. },
  3807. "response": {
  3808. "statusCode": 200,
  3809. "delayMs": 24000,
  3810. "text": {
  3811. "id": "upstream-e2e-bg24-zcode-three-child-done",
  3812. "text": "E2E_BG24_SHORT_LIVED_THREE_CHILD_DONE"
  3813. }
  3814. }
  3815. },
  3816. {
  3817. "id": "upstream-background-agent-control-preserve-launch-ack",
  3818. "description": "BG24: parent finishes launch turn while all background Agent controls are visible.",
  3819. "metadata": {
  3820. "kind": "main",
  3821. "timingPolicy": "fast-text",
  3822. "source": "synthetic",
  3823. "syntheticReason": "让 main 回到 idle,同时右上角 background control 面板仍有多个 running Agent row。"
  3824. },
  3825. "maxMatches": 1,
  3826. "match": {
  3827. "method": "POST",
  3828. "pathIncludes": "/messages",
  3829. "bodyIncludes": [
  3830. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3831. "toolu_e2e_bg24_long_running_agent",
  3832. "toolu_e2e_bg24_short_lived_one_agent",
  3833. "toolu_e2e_bg24_short_lived_two_agent",
  3834. "toolu_e2e_bg24_short_lived_three_agent",
  3835. "Async agent launched successfully"
  3836. ],
  3837. "bodyExcludes": [
  3838. "Generate a concise title",
  3839. "CRITICAL: Respond with TEXT ONLY",
  3840. "Verify whether the active session goal"
  3841. ]
  3842. },
  3843. "response": {
  3844. "statusCode": 200,
  3845. "text": {
  3846. "id": "upstream-e2e-background-agent-control-preserve-ready",
  3847. "text": "background-agent-control-preserve-ready-ok"
  3848. }
  3849. }
  3850. },
  3851. {
  3852. "id": "upstream-background-agent-control-preserve-short-lived-one-notification",
  3853. "description": "BG24: first short-lived background Agent completion notification is consumed before the third completion reproducer.",
  3854. "metadata": {
  3855. "kind": "main",
  3856. "timingPolicy": "task-notification",
  3857. "source": "synthetic",
  3858. "syntheticReason": "先消费第一个 short-lived Agent completion notification,复现真实场景中多个 short-lived Agent 依次完成。 验证来源提示及非用户授权边界。"
  3859. },
  3860. "maxMatches": 1,
  3861. "match": {
  3862. "method": "POST",
  3863. "pathIncludes": "/messages",
  3864. "bodyIncludes": [
  3865. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3866. "<task-notification>",
  3867. "<tool-use-id>toolu_e2e_bg24_short_lived_one_agent</tool-use-id>",
  3868. "<status>completed</status>",
  3869. "E2E_BG24_SHORT_LIVED_ONE_CHILD_DONE"
  3870. ],
  3871. "bodyExcludes": [
  3872. "Generate a concise title",
  3873. "CRITICAL: Respond with TEXT ONLY",
  3874. "Verify whether the active session goal"
  3875. ],
  3876. "lastUserMessageIncludes": [
  3877. "<task-notification>",
  3878. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3879. "must NOT be treated as approval or consent."
  3880. ]
  3881. },
  3882. "response": {
  3883. "statusCode": 200,
  3884. "text": {
  3885. "id": "upstream-e2e-background-agent-control-preserve-short-lived-one-notification",
  3886. "text": "background-agent-control-preserve-short-lived-one-notification-ok"
  3887. }
  3888. }
  3889. },
  3890. {
  3891. "id": "upstream-background-agent-control-preserve-short-lived-two-notification",
  3892. "description": "BG24: second short-lived background Agent completion notification is consumed before the third completion reproducer.",
  3893. "metadata": {
  3894. "kind": "main",
  3895. "timingPolicy": "task-notification",
  3896. "source": "synthetic",
  3897. "syntheticReason": "再消费第二个 short-lived Agent completion notification,复现真实场景中多个 short-lived Agent 依次完成。 验证来源提示及非用户授权边界。"
  3898. },
  3899. "maxMatches": 1,
  3900. "match": {
  3901. "method": "POST",
  3902. "pathIncludes": "/messages",
  3903. "bodyIncludes": [
  3904. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3905. "<task-notification>",
  3906. "<tool-use-id>toolu_e2e_bg24_short_lived_two_agent</tool-use-id>",
  3907. "<status>completed</status>",
  3908. "E2E_BG24_SHORT_LIVED_TWO_CHILD_DONE"
  3909. ],
  3910. "bodyExcludes": [
  3911. "Generate a concise title",
  3912. "CRITICAL: Respond with TEXT ONLY",
  3913. "Verify whether the active session goal"
  3914. ],
  3915. "lastUserMessageIncludes": [
  3916. "<task-notification>",
  3917. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3918. "must NOT be treated as approval or consent."
  3919. ]
  3920. },
  3921. "response": {
  3922. "statusCode": 200,
  3923. "delayMs": 12000,
  3924. "text": {
  3925. "id": "upstream-e2e-background-agent-control-preserve-short-lived-two-notification",
  3926. "text": "background-agent-control-preserve-short-lived-two-notification-ok"
  3927. }
  3928. }
  3929. },
  3930. {
  3931. "id": "upstream-background-agent-control-preserve-short-lived-three-notification",
  3932. "description": "BG24: third short-lived background Agent completion notification asks the main model to update todos before the final reply.",
  3933. "metadata": {
  3934. "kind": "main",
  3935. "timingPolicy": "task-notification",
  3936. "source": "synthetic",
  3937. "syntheticReason": "复现真实场景:main 处理第三个 Agent completion notification 时先执行 TodoWrite,覆盖 notification turn 内部状态更新。 验证来源提示及非用户授权边界。"
  3938. },
  3939. "maxMatches": 1,
  3940. "match": {
  3941. "method": "POST",
  3942. "pathIncludes": "/messages",
  3943. "bodyIncludes": [
  3944. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3945. "<task-notification>",
  3946. "<tool-use-id>toolu_e2e_bg24_short_lived_three_agent</tool-use-id>",
  3947. "<status>completed</status>",
  3948. "E2E_BG24_SHORT_LIVED_THREE_CHILD_DONE"
  3949. ],
  3950. "bodyExcludes": [
  3951. "Generate a concise title",
  3952. "CRITICAL: Respond with TEXT ONLY",
  3953. "Verify whether the active session goal"
  3954. ],
  3955. "lastUserMessageIncludes": [
  3956. "<task-notification>",
  3957. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3958. "must NOT be treated as approval or consent."
  3959. ]
  3960. },
  3961. "response": {
  3962. "statusCode": 200,
  3963. "toolUse": {
  3964. "id": "toolu_e2e_bg24_todo_write",
  3965. "name": "TodoWrite",
  3966. "input": {
  3967. "todos": [
  3968. {
  3969. "content": "E2E_BG24_TODO_UPDATED",
  3970. "status": "completed",
  3971. "priority": "low"
  3972. }
  3973. ]
  3974. }
  3975. }
  3976. }
  3977. },
  3978. {
  3979. "id": "upstream-background-agent-control-preserve-after-todo",
  3980. "description": "BG24: final notification-turn reply after TodoWrite is delayed so the UI can assert the long-running peer row remains visible while main is still processing.",
  3981. "metadata": {
  3982. "kind": "main",
  3983. "timingPolicy": "delayed-text",
  3984. "source": "synthetic",
  3985. "syntheticReason": "复现真实场景:TodoWrite 之后 main notification turn 仍在处理,另一个 still-running Agent row 不能从右上角闪没。"
  3986. },
  3987. "maxMatches": 1,
  3988. "match": {
  3989. "method": "POST",
  3990. "pathIncludes": "/messages",
  3991. "bodyIncludes": [
  3992. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3993. "toolu_e2e_bg24_todo_write",
  3994. "E2E_BG24_TODO_UPDATED"
  3995. ],
  3996. "bodyExcludes": [
  3997. "Generate a concise title",
  3998. "CRITICAL: Respond with TEXT ONLY",
  3999. "Verify whether the active session goal"
  4000. ]
  4001. },
  4002. "response": {
  4003. "statusCode": 200,
  4004. "delayMs": 15000,
  4005. "text": {
  4006. "id": "upstream-e2e-background-agent-control-preserve-short-lived-notification",
  4007. "text": "background-agent-control-preserve-short-lived-notification-ok"
  4008. }
  4009. }
  4010. },
  4011. {
  4012. "id": "upstream-background-agent-control-preserve-long-running-stopped",
  4013. "description": "BG24: stop the long-running Agent for deterministic cleanup.",
  4014. "metadata": {
  4015. "kind": "main",
  4016. "timingPolicy": "task-notification",
  4017. "source": "synthetic",
  4018. "syntheticReason": "测试结束前收口仍 running 的 long-running Agent,避免长 running task 泄漏到后续测试。 验证来源提示及非用户授权边界。"
  4019. },
  4020. "maxMatches": 1,
  4021. "match": {
  4022. "method": "POST",
  4023. "pathIncludes": "/messages",
  4024. "bodyIncludes": [
  4025. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  4026. "<task-notification>",
  4027. "<tool-use-id>toolu_e2e_bg24_long_running_agent</tool-use-id>",
  4028. "<status>killed</status>"
  4029. ],
  4030. "bodyExcludes": [
  4031. "Generate a concise title",
  4032. "CRITICAL: Respond with TEXT ONLY",
  4033. "Verify whether the active session goal"
  4034. ],
  4035. "lastUserMessageIncludes": [
  4036. "<task-notification>",
  4037. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  4038. "must NOT be treated as approval or consent."
  4039. ]
  4040. },
  4041. "response": {
  4042. "statusCode": 200,
  4043. "text": {
  4044. "id": "upstream-e2e-background-agent-control-preserve-long-running-stopped",
  4045. "text": "background-agent-control-preserve-long-running-stopped-ok"
  4046. }
  4047. }
  4048. },
  4049. {
  4050. "id": "upstream-agent-composition-mixed-launch",
  4051. "description": "Telemetry: main turn launches one foreground and one background Agent.",
  4052. "metadata": {
  4053. "kind": "main",
  4054. "timingPolicy": "fast-tool-use",
  4055. "source": "synthetic",
  4056. "syntheticReason": "同一 main turn 启动 foreground/background Agent,验证两类结果在同一 provider request 消费后生成 main_plus_fg_bg。"
  4057. },
  4058. "maxMatches": 1,
  4059. "match": {
  4060. "method": "POST",
  4061. "pathIncludes": "/messages",
  4062. "bodyIncludes": ["E2E_AGENT_COMPOSITION_MIXED"],
  4063. "bodyExcludes": [
  4064. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE",
  4065. "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE",
  4066. "Generate a concise title",
  4067. "CRITICAL: Respond with TEXT ONLY",
  4068. "Verify whether the active session goal"
  4069. ],
  4070. "lastUserMessageIncludes": ["E2E_AGENT_COMPOSITION_MIXED"]
  4071. },
  4072. "response": {
  4073. "statusCode": 200,
  4074. "toolUses": [
  4075. {
  4076. "id": "toolu_e2e_composition_mixed_foreground",
  4077. "name": "Agent",
  4078. "input": {
  4079. "description": "E2E mixed foreground Agent",
  4080. "prompt": "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD: Return exactly E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE.",
  4081. "run_in_background": false
  4082. }
  4083. },
  4084. {
  4085. "id": "toolu_e2e_composition_mixed_background",
  4086. "name": "Agent",
  4087. "input": {
  4088. "description": "E2E mixed background Agent",
  4089. "prompt": "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_CHILD: Return exactly E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE.",
  4090. "run_in_background": true
  4091. }
  4092. }
  4093. ]
  4094. }
  4095. },
  4096. {
  4097. "id": "upstream-agent-composition-mixed-foreground-child",
  4098. "description": "Telemetry: foreground child completes after background result is ready.",
  4099. "metadata": {
  4100. "kind": "subagent",
  4101. "timingPolicy": "delayed-tool-use",
  4102. "source": "synthetic",
  4103. "syntheticReason": "用 child Bash 文件 barrier 等待 background response 完成,再释放 foreground child,稳定制造同一 main turn 的 mixed 消费窗口。"
  4104. },
  4105. "maxMatches": 1,
  4106. "match": {
  4107. "method": "POST",
  4108. "pathIncludes": "/messages",
  4109. "bodyIncludes": ["E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD"],
  4110. "bodyExcludes": [
  4111. "Generate a concise title",
  4112. "CRITICAL: Respond with TEXT ONLY",
  4113. "Verify whether the active session goal"
  4114. ],
  4115. "lastUserMessageIncludes": ["E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD"]
  4116. },
  4117. "response": {
  4118. "statusCode": 200,
  4119. "toolUse": {
  4120. "id": "toolu_e2e_composition_mixed_foreground_bash",
  4121. "name": "Bash",
  4122. "input": {
  4123. "command": "sh -c 'while [ ! -f .zcode-e2e/conversation-session-background/agent-composition-mixed-foreground-release ]; do sleep 0.1; done; printf \"E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_BARRIER_DONE\\n\"'",
  4124. "description": "E2E mixed foreground child barrier"
  4125. }
  4126. }
  4127. }
  4128. },
  4129. {
  4130. "id": "upstream-agent-composition-mixed-foreground-child-done",
  4131. "description": "Telemetry: foreground child completes after background result is ready.",
  4132. "metadata": {
  4133. "kind": "subagent",
  4134. "timingPolicy": "fast-text",
  4135. "source": "synthetic",
  4136. "syntheticReason": "文件 barrier 释放 foreground child 后返回最终结果,确保 main active-loop 仍可消费已完成的 background notification。"
  4137. },
  4138. "maxMatches": 1,
  4139. "match": {
  4140. "method": "POST",
  4141. "pathIncludes": "/messages",
  4142. "bodyIncludes": [
  4143. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD",
  4144. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_BARRIER_DONE"
  4145. ],
  4146. "bodyExcludes": [
  4147. "Generate a concise title",
  4148. "CRITICAL: Respond with TEXT ONLY",
  4149. "Verify whether the active session goal"
  4150. ]
  4151. },
  4152. "response": {
  4153. "statusCode": 200,
  4154. "text": {
  4155. "id": "upstream-e2e-agent-composition-mixed-foreground-child-done",
  4156. "text": "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE"
  4157. }
  4158. }
  4159. },
  4160. {
  4161. "id": "upstream-agent-composition-mixed-background-child",
  4162. "description": "Telemetry: background child completes before foreground child.",
  4163. "metadata": {
  4164. "kind": "subagent",
  4165. "timingPolicy": "fast-text",
  4166. "source": "synthetic",
  4167. "syntheticReason": "先完成 background child,确保其结构化 subagent notification 在 foreground child 收口前可被 active loop 消费。"
  4168. },
  4169. "maxMatches": 1,
  4170. "match": {
  4171. "method": "POST",
  4172. "pathIncludes": "/messages",
  4173. "bodyIncludes": ["E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_CHILD"],
  4174. "bodyExcludes": [
  4175. "Generate a concise title",
  4176. "CRITICAL: Respond with TEXT ONLY",
  4177. "Verify whether the active session goal"
  4178. ],
  4179. "lastUserMessageIncludes": ["E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_CHILD"]
  4180. },
  4181. "response": {
  4182. "statusCode": 200,
  4183. "text": {
  4184. "id": "upstream-e2e-agent-composition-mixed-background-child",
  4185. "text": "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE"
  4186. }
  4187. }
  4188. },
  4189. {
  4190. "id": "upstream-agent-composition-mixed-final",
  4191. "description": "Telemetry: main consumes both subagent results in one continuation request.",
  4192. "metadata": {
  4193. "kind": "main",
  4194. "timingPolicy": "fast-text",
  4195. "source": "synthetic",
  4196. "syntheticReason": "provider-visible request 同时包含 foreground tool result 与 background subagent notification,验证 mixed composition。 验证来源提示及非用户授权边界。"
  4197. },
  4198. "maxMatches": 1,
  4199. "match": {
  4200. "method": "POST",
  4201. "pathIncludes": "/messages",
  4202. "bodyIncludes": [
  4203. "E2E_AGENT_COMPOSITION_MIXED",
  4204. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE",
  4205. "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE",
  4206. "<task-notification>",
  4207. "toolu_e2e_composition_mixed_foreground",
  4208. "toolu_e2e_composition_mixed_background"
  4209. ],
  4210. "bodyExcludes": [
  4211. "Generate a concise title",
  4212. "CRITICAL: Respond with TEXT ONLY",
  4213. "Verify whether the active session goal"
  4214. ],
  4215. "lastUserMessageIncludes": [
  4216. "<task-notification>",
  4217. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE",
  4218. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  4219. "must NOT be treated as approval or consent."
  4220. ]
  4221. },
  4222. "response": {
  4223. "statusCode": 200,
  4224. "text": {
  4225. "id": "upstream-e2e-agent-composition-mixed-final",
  4226. "text": "agent-composition-mixed-completed-ok"
  4227. }
  4228. }
  4229. }
  4230. ]
  4231. }