conversation-session-background.json 157 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229
  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 foreground aborted output without a background task ID.",
  998. "metadata": {
  999. "kind": "main",
  1000. "timingPolicy": "fast-text",
  1001. "source": "synthetic",
  1002. "syntheticReason": "验证 provider-visible result 为 foreground timeout,且没有 background notification。"
  1003. },
  1004. "maxMatches": 1,
  1005. "match": {
  1006. "method": "POST",
  1007. "pathIncludes": "/messages",
  1008. "bodyIncludes": [
  1009. "E2E_BG39_SLEEP_HARD_TIMEOUT",
  1010. "<error>Command was aborted before completion</error>"
  1011. ],
  1012. "bodyExcludes": [
  1013. "Command running in background",
  1014. "Generate a concise title",
  1015. "CRITICAL: Respond with TEXT ONLY",
  1016. "Verify whether the active session goal"
  1017. ],
  1018. "lastUserMessageExcludes": ["<task-notification>"]
  1019. },
  1020. "response": {
  1021. "statusCode": 200,
  1022. "text": {
  1023. "id": "upstream-e2e-bg39-sleep-hard-timeout",
  1024. "text": "bg39-sleep-hard-timeout-ok"
  1025. }
  1026. }
  1027. },
  1028. {
  1029. "id": "upstream-background-cancel-bash-tool-call",
  1030. "description": "BG08: main agent launches a cross-PGID background Bash process tree that will be stopped from the UI.",
  1031. "metadata": {
  1032. "kind": "main",
  1033. "timingPolicy": "fast-tool-use",
  1034. "source": "synthetic",
  1035. "syntheticReason": "稳定触发由 Bash job control 构造的跨 PGID launcher/worker 子树,用于验证统一 background control UI 的 stop 杀树路径。"
  1036. },
  1037. "maxMatches": 1,
  1038. "match": {
  1039. "method": "POST",
  1040. "pathIncludes": "/messages",
  1041. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_BASH"],
  1042. "bodyExcludes": [
  1043. "Command running in background",
  1044. "Generate a concise title",
  1045. "CRITICAL: Respond with TEXT ONLY",
  1046. "Verify whether the active session goal"
  1047. ],
  1048. "lastUserMessageIncludes": ["E2E_BACKGROUND_CANCEL_BASH"]
  1049. },
  1050. "response": {
  1051. "statusCode": 200,
  1052. "toolUse": {
  1053. "id": "toolu_e2e_background_cancel_bash",
  1054. "name": "Bash",
  1055. "input": {
  1056. "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'",
  1057. "description": "background cancel bash process tree",
  1058. "run_in_background": true
  1059. }
  1060. }
  1061. }
  1062. },
  1063. {
  1064. "id": "upstream-background-cancel-bash-launch-ack",
  1065. "description": "BG08: parent finishes launch turn after backgrounded Bash result.",
  1066. "metadata": {
  1067. "kind": "main",
  1068. "timingPolicy": "fast-text",
  1069. "source": "synthetic",
  1070. "syntheticReason": "让 UI 在 idle 状态展示 running background Bash control,随后由测试点击 stop。"
  1071. },
  1072. "maxMatches": 1,
  1073. "match": {
  1074. "method": "POST",
  1075. "pathIncludes": "/messages",
  1076. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_BASH", "Command running in background"],
  1077. "bodyExcludes": [
  1078. "Generate a concise title",
  1079. "CRITICAL: Respond with TEXT ONLY",
  1080. "Verify whether the active session goal"
  1081. ]
  1082. },
  1083. "response": {
  1084. "statusCode": 200,
  1085. "text": {
  1086. "id": "upstream-e2e-background-cancel-bash-launch-ack",
  1087. "text": "background-cancel-bash-launched-ok"
  1088. }
  1089. }
  1090. },
  1091. {
  1092. "id": "upstream-background-cancel-bash-notification-consumed",
  1093. "description": "BG08: parent consumes stopped Bash notification after UI stop.",
  1094. "metadata": {
  1095. "kind": "main",
  1096. "timingPolicy": "task-notification",
  1097. "source": "synthetic",
  1098. "syntheticReason": "验证 UI stop Bash 仍走 background task notification,而不是只在 UI 本地消失。 验证来源提示及非用户授权边界。"
  1099. },
  1100. "maxMatches": 1,
  1101. "match": {
  1102. "method": "POST",
  1103. "pathIncludes": "/messages",
  1104. "bodyIncludes": [
  1105. "E2E_BACKGROUND_CANCEL_BASH",
  1106. "<task-notification>",
  1107. "<tool-use-id>toolu_e2e_background_cancel_bash</tool-use-id>",
  1108. "<status>killed</status>"
  1109. ],
  1110. "bodyExcludes": [
  1111. "Generate a concise title",
  1112. "CRITICAL: Respond with TEXT ONLY",
  1113. "Verify whether the active session goal"
  1114. ],
  1115. "lastUserMessageIncludes": [
  1116. "<task-notification>",
  1117. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1118. "must NOT be treated as approval or consent."
  1119. ]
  1120. },
  1121. "response": {
  1122. "statusCode": 200,
  1123. "text": {
  1124. "id": "upstream-e2e-background-cancel-bash-notification",
  1125. "text": "background-cancel-bash-stopped-ok"
  1126. }
  1127. }
  1128. },
  1129. {
  1130. "id": "upstream-background-cancel-agent-tool-call",
  1131. "description": "BG09: main agent launches a long background Agent that will be stopped from the UI.",
  1132. "metadata": {
  1133. "kind": "main",
  1134. "timingPolicy": "fast-tool-use",
  1135. "source": "synthetic",
  1136. "syntheticReason": "稳定触发 running local_agent task,验证统一 background control UI 能停止 subagent。"
  1137. },
  1138. "maxMatches": 1,
  1139. "match": {
  1140. "method": "POST",
  1141. "pathIncludes": "/messages",
  1142. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_AGENT"],
  1143. "bodyExcludes": [
  1144. "Async agent launched successfully",
  1145. "agentId: agent_",
  1146. "Generate a concise title",
  1147. "CRITICAL: Respond with TEXT ONLY",
  1148. "Verify whether the active session goal"
  1149. ],
  1150. "lastUserMessageIncludes": ["E2E_BACKGROUND_CANCEL_AGENT"]
  1151. },
  1152. "response": {
  1153. "statusCode": 200,
  1154. "toolUse": {
  1155. "id": "toolu_e2e_background_cancel_agent",
  1156. "name": "Agent",
  1157. "input": {
  1158. "description": "E2E background cancel agent",
  1159. "prompt": "E2E_BACKGROUND_CANCEL_AGENT_CHILD: Stay running until stopped. If not stopped, return E2E_BACKGROUND_CANCEL_AGENT_CHILD_UNEXPECTED.",
  1160. "run_in_background": true
  1161. }
  1162. }
  1163. }
  1164. },
  1165. {
  1166. "id": "upstream-background-cancel-agent-launch-ack",
  1167. "description": "BG09: parent finishes launch turn after async Agent result.",
  1168. "metadata": {
  1169. "kind": "main",
  1170. "timingPolicy": "fast-text",
  1171. "source": "synthetic",
  1172. "syntheticReason": "让 UI 在 idle 状态展示 running background Agent control,随后由测试点击 stop。"
  1173. },
  1174. "maxMatches": 1,
  1175. "match": {
  1176. "method": "POST",
  1177. "pathIncludes": "/messages",
  1178. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_AGENT", "Async agent launched successfully"],
  1179. "bodyExcludes": [
  1180. "Generate a concise title",
  1181. "CRITICAL: Respond with TEXT ONLY",
  1182. "Verify whether the active session goal"
  1183. ]
  1184. },
  1185. "response": {
  1186. "statusCode": 200,
  1187. "text": {
  1188. "id": "upstream-e2e-background-cancel-agent-launch-ack",
  1189. "text": "background-cancel-agent-launched-ok"
  1190. }
  1191. }
  1192. },
  1193. {
  1194. "id": "upstream-background-cancel-agent-child-delayed-result",
  1195. "description": "BG09: delayed child Agent response that should be aborted by UI stop.",
  1196. "metadata": {
  1197. "kind": "subagent",
  1198. "timingPolicy": "delayed-text",
  1199. "source": "synthetic",
  1200. "syntheticReason": "保持 child provider request 运行,验证 stop 会 abort running background Agent。"
  1201. },
  1202. "maxMatches": 1,
  1203. "match": {
  1204. "method": "POST",
  1205. "pathIncludes": "/messages",
  1206. "bodyIncludes": ["E2E_BACKGROUND_CANCEL_AGENT_CHILD"],
  1207. "lastUserMessageIncludes": ["E2E_BACKGROUND_CANCEL_AGENT_CHILD"]
  1208. },
  1209. "response": {
  1210. "statusCode": 200,
  1211. "delayMs": 60000,
  1212. "text": {
  1213. "id": "upstream-e2e-background-cancel-agent-child-unexpected",
  1214. "text": "E2E_BACKGROUND_CANCEL_AGENT_CHILD_UNEXPECTED"
  1215. }
  1216. }
  1217. },
  1218. {
  1219. "id": "upstream-background-cancel-agent-notification-consumed",
  1220. "description": "BG09: parent consumes stopped Agent notification after UI stop.",
  1221. "metadata": {
  1222. "kind": "main",
  1223. "timingPolicy": "task-notification",
  1224. "source": "synthetic",
  1225. "syntheticReason": "验证 UI stop subagent 复用 local_agent task notification 链路。 验证来源提示及非用户授权边界。"
  1226. },
  1227. "maxMatches": 1,
  1228. "match": {
  1229. "method": "POST",
  1230. "pathIncludes": "/messages",
  1231. "bodyIncludes": [
  1232. "E2E_BACKGROUND_CANCEL_AGENT",
  1233. "<task-notification>",
  1234. "<tool-use-id>toolu_e2e_background_cancel_agent</tool-use-id>",
  1235. "<status>killed</status>"
  1236. ],
  1237. "bodyExcludes": [
  1238. "Generate a concise title",
  1239. "CRITICAL: Respond with TEXT ONLY",
  1240. "Verify whether the active session goal"
  1241. ],
  1242. "lastUserMessageIncludes": [
  1243. "<task-notification>",
  1244. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1245. "must NOT be treated as approval or consent."
  1246. ]
  1247. },
  1248. "response": {
  1249. "statusCode": 200,
  1250. "text": {
  1251. "id": "upstream-e2e-background-cancel-agent-notification",
  1252. "text": "background-cancel-agent-stopped-ok"
  1253. }
  1254. }
  1255. },
  1256. {
  1257. "id": "upstream-background-taskstop-agent-tool-call",
  1258. "description": "BG10: main agent launches a background Agent that the model will stop with TaskStop.",
  1259. "metadata": {
  1260. "kind": "main",
  1261. "timingPolicy": "fast-tool-use",
  1262. "source": "synthetic",
  1263. "syntheticReason": "稳定触发 running local_agent task,后续 provider replay 用 TaskStop 停止它。"
  1264. },
  1265. "maxMatches": 1,
  1266. "match": {
  1267. "method": "POST",
  1268. "pathIncludes": "/messages",
  1269. "bodyIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT"],
  1270. "bodyExcludes": [
  1271. "Async agent launched successfully",
  1272. "agentId: agent_",
  1273. "Generate a concise title",
  1274. "CRITICAL: Respond with TEXT ONLY",
  1275. "Verify whether the active session goal"
  1276. ],
  1277. "lastUserMessageIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT"]
  1278. },
  1279. "response": {
  1280. "statusCode": 200,
  1281. "toolUse": {
  1282. "id": "toolu_e2e_background_taskstop_agent",
  1283. "name": "Agent",
  1284. "input": {
  1285. "description": "E2E background TaskStop agent",
  1286. "prompt": "E2E_BACKGROUND_TASKSTOP_AGENT_CHILD: Stay running until stopped. If not stopped, return E2E_BACKGROUND_TASKSTOP_AGENT_CHILD_UNEXPECTED.",
  1287. "run_in_background": true
  1288. }
  1289. }
  1290. }
  1291. },
  1292. {
  1293. "id": "upstream-background-taskstop-agent-tool-stop",
  1294. "description": "BG10: parent uses TaskStop with the launched Agent task id.",
  1295. "metadata": {
  1296. "kind": "main",
  1297. "timingPolicy": "fast-tool-use",
  1298. "source": "synthetic",
  1299. "syntheticReason": "验证 provider-visible TaskStop tool 会复用 runtime background stop dispatcher。"
  1300. },
  1301. "maxMatches": 1,
  1302. "match": {
  1303. "method": "POST",
  1304. "pathIncludes": "/messages",
  1305. "bodyIncludes": [
  1306. "E2E_BACKGROUND_TASKSTOP_AGENT",
  1307. "Async agent launched successfully",
  1308. "agentId: agent_"
  1309. ],
  1310. "bodyExcludes": [
  1311. "Generate a concise title",
  1312. "CRITICAL: Respond with TEXT ONLY",
  1313. "Verify whether the active session goal"
  1314. ]
  1315. },
  1316. "response": {
  1317. "statusCode": 200,
  1318. "toolUse": {
  1319. "id": "toolu_e2e_background_taskstop_stop",
  1320. "name": "TaskStop",
  1321. "input": {
  1322. "task_id": "{{latestAgentId}}"
  1323. }
  1324. }
  1325. }
  1326. },
  1327. {
  1328. "id": "upstream-background-taskstop-agent-child-delayed-result",
  1329. "description": "BG10: delayed child Agent response that should be aborted by TaskStop.",
  1330. "metadata": {
  1331. "kind": "subagent",
  1332. "timingPolicy": "delayed-text",
  1333. "source": "synthetic",
  1334. "syntheticReason": "保持 child provider request 运行,验证 TaskStop 会 abort running background Agent。"
  1335. },
  1336. "maxMatches": 1,
  1337. "match": {
  1338. "method": "POST",
  1339. "pathIncludes": "/messages",
  1340. "bodyIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT_CHILD"],
  1341. "lastUserMessageIncludes": ["E2E_BACKGROUND_TASKSTOP_AGENT_CHILD"]
  1342. },
  1343. "response": {
  1344. "statusCode": 200,
  1345. "delayMs": 60000,
  1346. "text": {
  1347. "id": "upstream-e2e-background-taskstop-agent-child-unexpected",
  1348. "text": "E2E_BACKGROUND_TASKSTOP_AGENT_CHILD_UNEXPECTED"
  1349. }
  1350. }
  1351. },
  1352. {
  1353. "id": "upstream-background-taskstop-agent-notification-consumed",
  1354. "description": "BG10: parent consumes stopped Agent notification after TaskStop result.",
  1355. "metadata": {
  1356. "kind": "main",
  1357. "timingPolicy": "task-notification",
  1358. "source": "synthetic",
  1359. "syntheticReason": "验证 TaskStop tool result 和 stopped notification 在同一 runtime queue/active-loop 链路中收口。 验证来源提示及非用户授权边界。"
  1360. },
  1361. "maxMatches": 1,
  1362. "match": {
  1363. "method": "POST",
  1364. "pathIncludes": "/messages",
  1365. "bodyIncludes": [
  1366. "E2E_BACKGROUND_TASKSTOP_AGENT",
  1367. "Successfully stopped task:",
  1368. "<task-notification>",
  1369. "<tool-use-id>toolu_e2e_background_taskstop_agent</tool-use-id>",
  1370. "<status>killed</status>"
  1371. ],
  1372. "bodyExcludes": [
  1373. "Generate a concise title",
  1374. "CRITICAL: Respond with TEXT ONLY",
  1375. "Verify whether the active session goal"
  1376. ],
  1377. "lastUserMessageIncludes": [
  1378. "<task-notification>",
  1379. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1380. "must NOT be treated as approval or consent."
  1381. ]
  1382. },
  1383. "response": {
  1384. "statusCode": 200,
  1385. "text": {
  1386. "id": "upstream-e2e-background-taskstop-agent-notification",
  1387. "text": "background-taskstop-agent-stopped-ok"
  1388. }
  1389. }
  1390. },
  1391. {
  1392. "id": "upstream-background-active-loop-bash-tool-calls",
  1393. "description": "BG04: main agent starts a short Bash command that auto-backgrounds and completes before the active tool-loop follow-up request.",
  1394. "metadata": {
  1395. "kind": "main",
  1396. "timingPolicy": "fast-tool-use",
  1397. "source": "synthetic",
  1398. "syntheticReason": "稳定触发 active-loop background notification intake:Bash 先因短 timeout 转后台,命令随即完成并在后续 provider request 前入队 notification。"
  1399. },
  1400. "maxMatches": 1,
  1401. "match": {
  1402. "method": "POST",
  1403. "pathIncludes": "/messages",
  1404. "bodyIncludes": ["E2E_BACKGROUND_ACTIVE_LOOP_BASH"],
  1405. "lastUserMessageIncludes": ["E2E_BACKGROUND_ACTIVE_LOOP_BASH"]
  1406. },
  1407. "response": {
  1408. "statusCode": 200,
  1409. "toolUses": [
  1410. {
  1411. "id": "toolu_e2e_background_active_loop_bash_bg",
  1412. "name": "Bash",
  1413. "input": {
  1414. "command": "sh -c 'sleep 0.05; printf \"E2E_BACKGROUND_ACTIVE_LOOP_BASH_DONE\\n\"'",
  1415. "description": "Active-loop background marker",
  1416. "timeout": 1
  1417. }
  1418. },
  1419. {
  1420. "id": "toolu_e2e_background_active_loop_bash_wait",
  1421. "name": "Bash",
  1422. "input": {
  1423. "command": "sh -c 'sleep 0.2; printf \"E2E_BACKGROUND_ACTIVE_LOOP_WAIT_DONE\\n\"'",
  1424. "description": "Hold active tool loop for background completion"
  1425. }
  1426. }
  1427. ]
  1428. }
  1429. },
  1430. {
  1431. "id": "upstream-background-active-loop-notification-consumed",
  1432. "description": "BG04: parent consumes completed background Bash notification in the active tool-loop follow-up request.",
  1433. "metadata": {
  1434. "kind": "main",
  1435. "timingPolicy": "task-notification",
  1436. "source": "synthetic",
  1437. "syntheticReason": "验证同一次 provider request 同时包含上一轮 Bash tool result 与 <task-notification>,而不是等 idle wake 单独开一轮。 验证来源提示及非用户授权边界。"
  1438. },
  1439. "maxMatches": 1,
  1440. "match": {
  1441. "method": "POST",
  1442. "pathIncludes": "/messages",
  1443. "bodyIncludes": [
  1444. "E2E_BACKGROUND_ACTIVE_LOOP_BASH",
  1445. "E2E_BACKGROUND_ACTIVE_LOOP_WAIT_DONE",
  1446. "<task-notification>",
  1447. "<tool-use-id>toolu_e2e_background_active_loop_bash_bg</tool-use-id>",
  1448. "<status>completed</status>"
  1449. ],
  1450. "lastUserMessageIncludes": [
  1451. "<task-notification>",
  1452. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1453. "must NOT be treated as approval or consent."
  1454. ]
  1455. },
  1456. "response": {
  1457. "statusCode": 200,
  1458. "text": {
  1459. "id": "upstream-e2e-background-active-loop-notification",
  1460. "text": "background-active-loop-notification-consumed-ok"
  1461. }
  1462. }
  1463. },
  1464. {
  1465. "id": "upstream-background-goal-seed",
  1466. "description": "BG34: create the v4 session before setting the background goal.",
  1467. "metadata": {
  1468. "kind": "main",
  1469. "timingPolicy": "fast-text",
  1470. "source": "synthetic",
  1471. "syntheticReason": "V4 /goal 需要已有 session;首轮仅建立 BG34 的稳定会话边界。"
  1472. },
  1473. "maxMatches": 1,
  1474. "match": {
  1475. "method": "POST",
  1476. "pathIncludes": "/messages",
  1477. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_SEED"],
  1478. "bodyExcludes": [
  1479. "Generate a concise title",
  1480. "CRITICAL: Respond with TEXT ONLY",
  1481. "Continue working toward the active session goal"
  1482. ]
  1483. },
  1484. "response": {
  1485. "statusCode": 200,
  1486. "text": {
  1487. "id": "upstream-e2e-background-goal-seed",
  1488. "text": "background-goal-seed-ok"
  1489. }
  1490. }
  1491. },
  1492. {
  1493. "id": "upstream-background-goal-agent-tool-call",
  1494. "description": "BG03: goal continuation launches a background Agent.",
  1495. "metadata": {
  1496. "kind": "main",
  1497. "timingPolicy": "fast-tool-use",
  1498. "source": "synthetic",
  1499. "syntheticReason": "goal continuation 中启动 background Agent。"
  1500. },
  1501. "maxMatches": 1,
  1502. "match": {
  1503. "method": "POST",
  1504. "pathIncludes": "/messages",
  1505. "bodyIncludes": ["E2E_BACKGROUND_GOAL", "Continue working toward the active session goal"],
  1506. "bodyExcludes": [
  1507. "Generate a concise title",
  1508. "CRITICAL: Respond with TEXT ONLY",
  1509. "Verify whether the active session goal"
  1510. ]
  1511. },
  1512. "response": {
  1513. "statusCode": 200,
  1514. "toolUse": {
  1515. "id": "toolu_e2e_background_goal_agent",
  1516. "name": "Agent",
  1517. "input": {
  1518. "description": "Goal background",
  1519. "prompt": "E2E_BACKGROUND_GOAL_CHILD: Return exactly E2E_BACKGROUND_GOAL_CHILD_RESULT.",
  1520. "run_in_background": true
  1521. }
  1522. }
  1523. }
  1524. },
  1525. {
  1526. "id": "upstream-background-goal-agent-launch-ack",
  1527. "description": "BG03: goal continuation finishes before child Agent result.",
  1528. "metadata": {
  1529. "kind": "main",
  1530. "timingPolicy": "fast-text",
  1531. "source": "synthetic",
  1532. "syntheticReason": "goal continuation 的当前 turn 在子任务完成前先结束。"
  1533. },
  1534. "maxMatches": 1,
  1535. "match": {
  1536. "method": "POST",
  1537. "pathIncludes": "/messages",
  1538. "bodyIncludes": ["E2E_BACKGROUND_GOAL", "Async agent launched successfully"],
  1539. "bodyExcludes": [
  1540. "Generate a concise title",
  1541. "CRITICAL: Respond with TEXT ONLY",
  1542. "Verify whether the active session goal"
  1543. ]
  1544. },
  1545. "response": {
  1546. "statusCode": 200,
  1547. "text": {
  1548. "id": "upstream-e2e-background-goal-launch-ack",
  1549. "text": "background-goal-agent-launched-ok"
  1550. }
  1551. }
  1552. },
  1553. {
  1554. "id": "upstream-background-goal-direct-prompt",
  1555. "description": "BG34: a real user prompt starts immediately while only the goal background Agent is running.",
  1556. "metadata": {
  1557. "kind": "main",
  1558. "timingPolicy": "fast-text",
  1559. "source": "synthetic",
  1560. "syntheticReason": "稳定证明 active goal 的 background-only 状态不等于 main busy,用户输入不经过 future queue。"
  1561. },
  1562. "maxMatches": 1,
  1563. "match": {
  1564. "method": "POST",
  1565. "pathIncludes": "/messages",
  1566. "bodyIncludes": ["E2E_BACKGROUND_GOAL_DIRECT_PROMPT"],
  1567. "bodyExcludes": [
  1568. "Generate a concise title",
  1569. "CRITICAL: Respond with TEXT ONLY",
  1570. "Verify whether the active session goal"
  1571. ],
  1572. "lastUserMessageExcludes": ["<task-notification>"],
  1573. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_DIRECT_PROMPT"]
  1574. },
  1575. "response": {
  1576. "statusCode": 200,
  1577. "text": {
  1578. "id": "upstream-e2e-background-goal-direct-prompt",
  1579. "text": "background-goal-direct-prompt-ok"
  1580. }
  1581. }
  1582. },
  1583. {
  1584. "id": "upstream-background-goal-child-delayed-result",
  1585. "description": "BG03: delayed child Agent result for goal.",
  1586. "metadata": {
  1587. "kind": "subagent",
  1588. "timingPolicy": "delayed-text",
  1589. "source": "synthetic",
  1590. "syntheticReason": "延迟子 agent 完成,证明 verifier 会等 notification。"
  1591. },
  1592. "maxMatches": 1,
  1593. "match": {
  1594. "method": "POST",
  1595. "pathIncludes": "/messages",
  1596. "bodyIncludes": ["E2E_BACKGROUND_GOAL_CHILD"],
  1597. "bodyExcludes": [
  1598. "Generate a concise title",
  1599. "CRITICAL: Respond with TEXT ONLY",
  1600. "Verify whether the active session goal"
  1601. ],
  1602. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_CHILD"]
  1603. },
  1604. "response": {
  1605. "statusCode": 200,
  1606. "delayMs": 8000,
  1607. "text": {
  1608. "id": "upstream-e2e-background-goal-child-result",
  1609. "text": "E2E_BACKGROUND_GOAL_CHILD_RESULT"
  1610. }
  1611. }
  1612. },
  1613. {
  1614. "id": "upstream-background-goal-notification-consumed",
  1615. "description": "BG03: parent consumes goal background notification.",
  1616. "metadata": {
  1617. "kind": "main",
  1618. "timingPolicy": "task-notification",
  1619. "source": "synthetic",
  1620. "syntheticReason": "goal notification turn 消费子结果。 验证来源提示及非用户授权边界。"
  1621. },
  1622. "maxMatches": 1,
  1623. "match": {
  1624. "method": "POST",
  1625. "pathIncludes": "/messages",
  1626. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_GOAL_CHILD_RESULT"],
  1627. "bodyExcludes": [
  1628. "Generate a concise title",
  1629. "CRITICAL: Respond with TEXT ONLY",
  1630. "Verify whether the active session goal"
  1631. ],
  1632. "lastUserMessageIncludes": [
  1633. "<task-notification>",
  1634. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1635. "must NOT be treated as approval or consent."
  1636. ]
  1637. },
  1638. "response": {
  1639. "statusCode": 200,
  1640. "text": {
  1641. "id": "upstream-e2e-background-goal-notification",
  1642. "text": "E2E_BACKGROUND_GOAL_NOTIFICATION_CONSUMED"
  1643. }
  1644. }
  1645. },
  1646. {
  1647. "id": "upstream-background-goal-verifier-passed",
  1648. "description": "BG03: verifier passes only after background notification is consumed.",
  1649. "metadata": {
  1650. "kind": "goal-verifier",
  1651. "timingPolicy": "controlled-stream",
  1652. "source": "synthetic",
  1653. "syntheticReason": "验证 verifier 只在 notification 后执行并通过,并稳定留出 future queue admission 窗口。"
  1654. },
  1655. "maxMatches": 1,
  1656. "match": {
  1657. "method": "POST",
  1658. "pathIncludes": "/messages",
  1659. "bodyIncludes": [
  1660. "E2E_BACKGROUND_GOAL",
  1661. "E2E_BACKGROUND_GOAL_NOTIFICATION_CONSUMED",
  1662. "Verify whether the active session goal"
  1663. ],
  1664. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  1665. },
  1666. "response": {
  1667. "statusCode": 200,
  1668. "delayMs": 4000,
  1669. "headers": {
  1670. "content-type": "application/json; charset=utf-8"
  1671. },
  1672. "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\"}}"
  1673. }
  1674. },
  1675. {
  1676. "id": "upstream-background-goal-verifier-queue-drained",
  1677. "description": "BG34: verifier pass promotes the queued real user prompt without another legacy mutation.",
  1678. "metadata": {
  1679. "kind": "main",
  1680. "timingPolicy": "fast-text",
  1681. "source": "synthetic",
  1682. "syntheticReason": "稳定验证 TargetChanged(complete) 本身会重新评估 CLI queue gate 并自动提升队首。"
  1683. },
  1684. "maxMatches": 1,
  1685. "match": {
  1686. "method": "POST",
  1687. "pathIncludes": "/messages",
  1688. "bodyIncludes": ["E2E_BACKGROUND_GOAL_VERIFIER_QUEUE"],
  1689. "bodyExcludes": [
  1690. "Generate a concise title",
  1691. "CRITICAL: Respond with TEXT ONLY",
  1692. "Verify whether the active session goal"
  1693. ],
  1694. "lastUserMessageIncludes": ["E2E_BACKGROUND_GOAL_VERIFIER_QUEUE"]
  1695. },
  1696. "response": {
  1697. "statusCode": 200,
  1698. "text": {
  1699. "id": "upstream-e2e-background-goal-verifier-queue-drained",
  1700. "text": "background-goal-verifier-queue-drained-ok"
  1701. }
  1702. }
  1703. },
  1704. {
  1705. "id": "upstream-background-send-agent-tool-call",
  1706. "description": "BG07: main agent launches a background Agent before sending it a coordinator message.",
  1707. "metadata": {
  1708. "kind": "main",
  1709. "timingPolicy": "fast-tool-use",
  1710. "source": "synthetic",
  1711. "syntheticReason": "稳定触发 Agent(run_in_background=true),后续用 SendMessage 验证 running child steer。"
  1712. },
  1713. "maxMatches": 1,
  1714. "match": {
  1715. "method": "POST",
  1716. "pathIncludes": "/messages",
  1717. "bodyIncludes": ["E2E_BACKGROUND_SEND_MESSAGE"],
  1718. "bodyExcludes": [
  1719. "Async agent launched successfully",
  1720. "agentId: agent_",
  1721. "Generate a concise title",
  1722. "CRITICAL: Respond with TEXT ONLY",
  1723. "Verify whether the active session goal"
  1724. ],
  1725. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_MESSAGE"]
  1726. },
  1727. "response": {
  1728. "statusCode": 200,
  1729. "toolUse": {
  1730. "id": "toolu_e2e_background_send_agent",
  1731. "name": "Agent",
  1732. "input": {
  1733. "description": "Wait for coordinator message",
  1734. "prompt": "E2E_BACKGROUND_SEND_MESSAGE_CHILD: Start working. When the coordinator message arrives, reply exactly E2E_BACKGROUND_SEND_MESSAGE_CHILD_RECEIVED.",
  1735. "run_in_background": true
  1736. }
  1737. }
  1738. }
  1739. },
  1740. {
  1741. "id": "upstream-background-send-message-tool-call",
  1742. "description": "BG07: parent sends a message to the running background Agent after the launch tool result.",
  1743. "metadata": {
  1744. "kind": "main",
  1745. "timingPolicy": "fast-tool-use",
  1746. "source": "synthetic",
  1747. "syntheticReason": "根据 Agent tool result 中的 agentId 调用 SendMessage,验证父 agent 能 steer running child。"
  1748. },
  1749. "maxMatches": 1,
  1750. "match": {
  1751. "method": "POST",
  1752. "pathIncludes": "/messages",
  1753. "bodyIncludes": [
  1754. "E2E_BACKGROUND_SEND_MESSAGE",
  1755. "Async agent launched successfully",
  1756. "agentId: agent_"
  1757. ],
  1758. "bodyExcludes": [
  1759. "sent to its active turn",
  1760. "Generate a concise title",
  1761. "CRITICAL: Respond with TEXT ONLY",
  1762. "Verify whether the active session goal"
  1763. ],
  1764. "lastUserMessageExcludes": ["<task-notification>"]
  1765. },
  1766. "response": {
  1767. "statusCode": 200,
  1768. "toolUse": {
  1769. "id": "toolu_e2e_background_send_message",
  1770. "name": "SendMessage",
  1771. "input": {
  1772. "to": "{{latestAgentId}}",
  1773. "summary": "E2E_BACKGROUND_SEND_MESSAGE_STEER",
  1774. "message": "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD"
  1775. }
  1776. }
  1777. }
  1778. },
  1779. {
  1780. "id": "upstream-background-send-message-ack",
  1781. "description": "BG07: parent finishes the SendMessage turn after delivery status.",
  1782. "metadata": {
  1783. "kind": "main",
  1784. "timingPolicy": "fast-text",
  1785. "source": "synthetic",
  1786. "syntheticReason": "父模型收到 SendMessage tool result 后结束当前 turn,等待 background notification。"
  1787. },
  1788. "maxMatches": 1,
  1789. "match": {
  1790. "method": "POST",
  1791. "pathIncludes": "/messages",
  1792. "bodyIncludes": [
  1793. "E2E_BACKGROUND_SEND_MESSAGE",
  1794. "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD",
  1795. "sent to its active turn"
  1796. ],
  1797. "bodyExcludes": [
  1798. "Generate a concise title",
  1799. "CRITICAL: Respond with TEXT ONLY",
  1800. "Verify whether the active session goal"
  1801. ],
  1802. "lastUserMessageExcludes": ["<task-notification>"]
  1803. },
  1804. "response": {
  1805. "statusCode": 200,
  1806. "text": {
  1807. "id": "upstream-e2e-background-send-message-ack",
  1808. "text": "background-send-message-sent-ok"
  1809. }
  1810. }
  1811. },
  1812. {
  1813. "id": "upstream-background-send-child-bash-tool-call",
  1814. "description": "BG07: child Agent starts a long local Bash tool so it can receive SendMessage during an active turn.",
  1815. "metadata": {
  1816. "kind": "subagent",
  1817. "timingPolicy": "fast-tool-use",
  1818. "source": "synthetic",
  1819. "syntheticReason": "子 agent 首轮立即释放 provider 连接,但通过 build mode 可直接允许且不会自动后台化的 sleep foreground Bash 保持 active turn,稳定覆盖 running child steer。"
  1820. },
  1821. "maxMatches": 1,
  1822. "match": {
  1823. "method": "POST",
  1824. "pathIncludes": "/messages",
  1825. "bodyIncludes": ["E2E_BACKGROUND_SEND_MESSAGE_CHILD"],
  1826. "bodyExcludes": [
  1827. "Generate a concise title",
  1828. "CRITICAL: Respond with TEXT ONLY",
  1829. "Verify whether the active session goal"
  1830. ],
  1831. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_MESSAGE_CHILD"]
  1832. },
  1833. "response": {
  1834. "statusCode": 200,
  1835. "toolUse": {
  1836. "id": "toolu_e2e_background_send_child_bash",
  1837. "name": "Bash",
  1838. "input": {
  1839. "command": "sleep 8; printf 'E2E_BACKGROUND_SEND_MESSAGE_CHILD_BASH_DONE\\n'",
  1840. "description": "Keep child turn active"
  1841. }
  1842. }
  1843. }
  1844. },
  1845. {
  1846. "id": "upstream-background-send-child-steered-result",
  1847. "description": "BG07: child Agent receives SendMessage as coordinator input.",
  1848. "metadata": {
  1849. "kind": "subagent",
  1850. "timingPolicy": "fast-text",
  1851. "source": "synthetic",
  1852. "syntheticReason": "验证子 agent 的 provider-visible request 收到完整 coordinator 中途提示。 验证来源提示及非用户授权边界。"
  1853. },
  1854. "maxMatches": 1,
  1855. "match": {
  1856. "method": "POST",
  1857. "pathIncludes": "/messages",
  1858. "bodyIncludes": [
  1859. "E2E_BACKGROUND_SEND_MESSAGE_CHILD",
  1860. "E2E_BACKGROUND_SEND_MESSAGE_CHILD_BASH_DONE",
  1861. "The coordinator sent a message while you were working:\nE2E_BACKGROUND_SEND_MESSAGE_PAYLOAD",
  1862. "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD"
  1863. ],
  1864. "bodyExcludes": [
  1865. "Generate a concise title",
  1866. "CRITICAL: Respond with TEXT ONLY",
  1867. "Verify whether the active session goal"
  1868. ],
  1869. "lastUserMessageIncludes": [
  1870. "The coordinator sent a message while you were working:\nE2E_BACKGROUND_SEND_MESSAGE_PAYLOAD",
  1871. "E2E_BACKGROUND_SEND_MESSAGE_PAYLOAD"
  1872. ]
  1873. },
  1874. "response": {
  1875. "statusCode": 200,
  1876. "text": {
  1877. "id": "upstream-e2e-background-send-child-received",
  1878. "text": "E2E_BACKGROUND_SEND_MESSAGE_CHILD_RECEIVED"
  1879. }
  1880. }
  1881. },
  1882. {
  1883. "id": "upstream-background-send-notification-consumed",
  1884. "description": "BG07: parent consumes completion notification after SendMessage-steered child result.",
  1885. "metadata": {
  1886. "kind": "main",
  1887. "timingPolicy": "task-notification",
  1888. "source": "synthetic",
  1889. "syntheticReason": "验证 SendMessage steer 后的子 agent completion 仍走 background notification。 验证来源提示及非用户授权边界。"
  1890. },
  1891. "maxMatches": 1,
  1892. "match": {
  1893. "method": "POST",
  1894. "pathIncludes": "/messages",
  1895. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_SEND_MESSAGE_CHILD_RECEIVED"],
  1896. "bodyExcludes": [
  1897. "Generate a concise title",
  1898. "CRITICAL: Respond with TEXT ONLY",
  1899. "Verify whether the active session goal"
  1900. ],
  1901. "lastUserMessageIncludes": [
  1902. "<task-notification>",
  1903. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  1904. "must NOT be treated as approval or consent."
  1905. ]
  1906. },
  1907. "response": {
  1908. "statusCode": 200,
  1909. "text": {
  1910. "id": "upstream-e2e-background-send-notification",
  1911. "text": "background-send-message-notification-consumed-ok"
  1912. }
  1913. }
  1914. },
  1915. {
  1916. "id": "upstream-foreground-long-bash-loading-tool-call",
  1917. "description": "BG14: main agent starts a normal foreground Bash command that should keep the parent loading while running.",
  1918. "metadata": {
  1919. "kind": "main",
  1920. "timingPolicy": "fast-tool-use",
  1921. "source": "synthetic",
  1922. "syntheticReason": "稳定制造普通 foreground Bash running 窗口,验证 background event 豁免没有误伤前台 loading。"
  1923. },
  1924. "maxMatches": 1,
  1925. "match": {
  1926. "method": "POST",
  1927. "pathIncludes": "/messages",
  1928. "bodyIncludes": ["E2E_FOREGROUND_LONG_BASH_LOADING"],
  1929. "bodyExcludes": [
  1930. "E2E_FOREGROUND_LONG_BASH_DONE",
  1931. "Command running in background",
  1932. "Generate a concise title",
  1933. "CRITICAL: Respond with TEXT ONLY",
  1934. "Verify whether the active session goal"
  1935. ],
  1936. "lastUserMessageIncludes": ["E2E_FOREGROUND_LONG_BASH_LOADING"]
  1937. },
  1938. "response": {
  1939. "statusCode": 200,
  1940. "toolUse": {
  1941. "id": "toolu_e2e_foreground_long_bash_loading",
  1942. "name": "Bash",
  1943. "input": {
  1944. "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\"'",
  1945. "description": "foreground long bash loading sleep"
  1946. }
  1947. }
  1948. }
  1949. },
  1950. {
  1951. "id": "upstream-foreground-long-bash-loading-completed",
  1952. "description": "BG14: parent continues after the normal foreground Bash command completes.",
  1953. "metadata": {
  1954. "kind": "main",
  1955. "timingPolicy": "fast-text",
  1956. "source": "synthetic",
  1957. "syntheticReason": "验证 foreground Bash 完成后仍正常进入 provider continuation 并回到 idle。"
  1958. },
  1959. "maxMatches": 1,
  1960. "match": {
  1961. "method": "POST",
  1962. "pathIncludes": "/messages",
  1963. "bodyIncludes": ["E2E_FOREGROUND_LONG_BASH_LOADING", "<persisted-output>"],
  1964. "bodyExcludes": [
  1965. "Command running in background",
  1966. "Generate a concise title",
  1967. "CRITICAL: Respond with TEXT ONLY",
  1968. "Verify whether the active session goal"
  1969. ],
  1970. "lastUserMessageExcludes": ["<task-notification>"]
  1971. },
  1972. "response": {
  1973. "statusCode": 200,
  1974. "text": {
  1975. "id": "upstream-e2e-foreground-long-bash-loading-completed",
  1976. "text": "foreground-long-bash-loading-completed-ok"
  1977. }
  1978. }
  1979. },
  1980. {
  1981. "id": "upstream-foreground-child-tool-streaming-agent-tool-call",
  1982. "description": "BG13: main agent launches a foreground Agent whose child tool updates should keep the parent streaming.",
  1983. "metadata": {
  1984. "kind": "main",
  1985. "timingPolicy": "fast-tool-use",
  1986. "source": "synthetic",
  1987. "syntheticReason": "稳定触发 foreground Agent,让 child Bash 运行期间验证 parent loading 仍按原语义显示。"
  1988. },
  1989. "maxMatches": 1,
  1990. "match": {
  1991. "method": "POST",
  1992. "pathIncludes": "/messages",
  1993. "bodyIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING_STATUS"],
  1994. "bodyExcludes": [
  1995. "E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE",
  1996. "Generate a concise title",
  1997. "CRITICAL: Respond with TEXT ONLY",
  1998. "Verify whether the active session goal"
  1999. ],
  2000. "lastUserMessageIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING_STATUS"]
  2001. },
  2002. "response": {
  2003. "statusCode": 200,
  2004. "toolUse": {
  2005. "id": "toolu_e2e_foreground_child_tool_agent",
  2006. "name": "Agent",
  2007. "input": {
  2008. "description": "E2E foreground child tool streaming",
  2009. "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."
  2010. }
  2011. }
  2012. }
  2013. },
  2014. {
  2015. "id": "upstream-foreground-child-tool-streaming-child-bash-tool-call",
  2016. "description": "BG13: foreground child Agent starts a visible foreground Bash tool while parent remains running.",
  2017. "metadata": {
  2018. "kind": "subagent",
  2019. "timingPolicy": "fast-tool-use",
  2020. "source": "synthetic",
  2021. "syntheticReason": "用真实 child Bash tool update 覆盖 foreground mirrored subagent event 的 streaming 保留分支。"
  2022. },
  2023. "maxMatches": 1,
  2024. "match": {
  2025. "method": "POST",
  2026. "pathIncludes": "/messages",
  2027. "bodyIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING"],
  2028. "bodyExcludes": [
  2029. "E2E_FOREGROUND_AGENT_CHILD_TOOL_BASH_DONE",
  2030. "Generate a concise title",
  2031. "CRITICAL: Respond with TEXT ONLY",
  2032. "Verify whether the active session goal"
  2033. ],
  2034. "lastUserMessageExcludes": ["<task-notification>"],
  2035. "lastUserMessageIncludes": ["E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING"]
  2036. },
  2037. "response": {
  2038. "statusCode": 200,
  2039. "toolUse": {
  2040. "id": "toolu_e2e_foreground_child_tool_bash",
  2041. "name": "Bash",
  2042. "input": {
  2043. "command": "sh -c 'sleep 4; printf \"E2E_FOREGROUND_AGENT_CHILD_TOOL_BASH_DONE\\n\"'",
  2044. "description": "foreground child visible bash sleep"
  2045. }
  2046. }
  2047. }
  2048. },
  2049. {
  2050. "id": "upstream-foreground-child-tool-streaming-child-done",
  2051. "description": "BG13: foreground child Agent completes after the visible Bash tool finishes.",
  2052. "metadata": {
  2053. "kind": "subagent",
  2054. "timingPolicy": "fast-text",
  2055. "source": "synthetic",
  2056. "syntheticReason": "让 foreground Agent 正常完成并把结果回传父 turn。"
  2057. },
  2058. "maxMatches": 1,
  2059. "match": {
  2060. "method": "POST",
  2061. "pathIncludes": "/messages",
  2062. "bodyIncludes": [
  2063. "E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING",
  2064. "E2E_FOREGROUND_AGENT_CHILD_TOOL_BASH_DONE"
  2065. ],
  2066. "bodyExcludes": [
  2067. "Generate a concise title",
  2068. "CRITICAL: Respond with TEXT ONLY",
  2069. "Verify whether the active session goal"
  2070. ],
  2071. "lastUserMessageExcludes": ["<task-notification>"]
  2072. },
  2073. "response": {
  2074. "statusCode": 200,
  2075. "text": {
  2076. "id": "upstream-e2e-foreground-child-tool-streaming-child-done",
  2077. "text": "E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE"
  2078. }
  2079. }
  2080. },
  2081. {
  2082. "id": "upstream-foreground-child-tool-streaming-completed",
  2083. "description": "BG13: parent consumes the foreground Agent result and completes.",
  2084. "metadata": {
  2085. "kind": "main",
  2086. "timingPolicy": "fast-text",
  2087. "source": "synthetic",
  2088. "syntheticReason": "验证 foreground subagent child tool running 窗口后,父 turn 正常收口。"
  2089. },
  2090. "maxMatches": 1,
  2091. "match": {
  2092. "method": "POST",
  2093. "pathIncludes": "/messages",
  2094. "bodyIncludes": [
  2095. "E2E_FOREGROUND_AGENT_CHILD_TOOL_STREAMING_STATUS",
  2096. "E2E_FOREGROUND_AGENT_CHILD_TOOL_DONE"
  2097. ],
  2098. "bodyExcludes": [
  2099. "Generate a concise title",
  2100. "CRITICAL: Respond with TEXT ONLY",
  2101. "Verify whether the active session goal"
  2102. ],
  2103. "lastUserMessageExcludes": ["<task-notification>"]
  2104. },
  2105. "response": {
  2106. "statusCode": 200,
  2107. "text": {
  2108. "id": "upstream-e2e-foreground-child-tool-streaming-completed",
  2109. "text": "foreground-agent-child-tool-streaming-completed-ok"
  2110. }
  2111. }
  2112. },
  2113. {
  2114. "id": "upstream-background-child-tool-idle-agent-tool-call",
  2115. "description": "BG13: main agent launches a background Agent whose child tool updates should not mark the parent idle turn as streaming.",
  2116. "metadata": {
  2117. "kind": "main",
  2118. "timingPolicy": "fast-tool-use",
  2119. "source": "synthetic",
  2120. "syntheticReason": "稳定触发 background Agent,让 child Bash 运行期间验证 parent idle UI 不显示 fake loading。"
  2121. },
  2122. "maxMatches": 1,
  2123. "match": {
  2124. "method": "POST",
  2125. "pathIncludes": "/messages",
  2126. "bodyIncludes": [
  2127. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_STATUS: Launch a background agent that runs a visible child Bash tool while the parent conversation is idle."
  2128. ],
  2129. "bodyExcludes": [
  2130. "Async agent launched successfully",
  2131. "agentId: agent_",
  2132. "Generate a concise title",
  2133. "CRITICAL: Respond with TEXT ONLY",
  2134. "Verify whether the active session goal"
  2135. ],
  2136. "lastUserMessageIncludes": [
  2137. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_STATUS: Launch a background agent that runs a visible child Bash tool while the parent conversation is idle."
  2138. ]
  2139. },
  2140. "response": {
  2141. "statusCode": 200,
  2142. "toolUse": {
  2143. "id": "toolu_e2e_background_idle_child_tool_agent",
  2144. "name": "Agent",
  2145. "input": {
  2146. "description": "E2E background child tool idle",
  2147. "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.",
  2148. "run_in_background": true
  2149. }
  2150. }
  2151. }
  2152. },
  2153. {
  2154. "id": "upstream-background-child-tool-idle-agent-launch-ack",
  2155. "description": "BG13: parent finishes launch turn while child Agent continues running a local tool.",
  2156. "metadata": {
  2157. "kind": "main",
  2158. "timingPolicy": "fast-text",
  2159. "source": "synthetic",
  2160. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn,制造 parent idle + child tool running 窗口。"
  2161. },
  2162. "maxMatches": 1,
  2163. "match": {
  2164. "method": "POST",
  2165. "pathIncludes": "/messages",
  2166. "bodyIncludes": [
  2167. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_STATUS",
  2168. "Async agent launched successfully"
  2169. ],
  2170. "bodyExcludes": [
  2171. "Generate a concise title",
  2172. "CRITICAL: Respond with TEXT ONLY",
  2173. "Verify whether the active session goal"
  2174. ]
  2175. },
  2176. "response": {
  2177. "statusCode": 200,
  2178. "text": {
  2179. "id": "upstream-e2e-background-child-tool-idle-launch-ack",
  2180. "text": "background-agent-child-tool-idle-launched-ok"
  2181. }
  2182. }
  2183. },
  2184. {
  2185. "id": "upstream-background-child-tool-idle-child-bash-tool-call",
  2186. "description": "BG13: child Agent starts a visible foreground Bash tool while parent remains idle.",
  2187. "metadata": {
  2188. "kind": "subagent",
  2189. "timingPolicy": "fast-tool-use",
  2190. "source": "synthetic",
  2191. "syntheticReason": "用真实 child Bash tool update 覆盖 mirrored background subagent event 的 UI streaming 保护。"
  2192. },
  2193. "maxMatches": 1,
  2194. "match": {
  2195. "method": "POST",
  2196. "pathIncludes": "/messages",
  2197. "bodyIncludes": ["E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE"],
  2198. "bodyExcludes": [
  2199. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_BASH_DONE",
  2200. "Generate a concise title",
  2201. "CRITICAL: Respond with TEXT ONLY",
  2202. "Verify whether the active session goal"
  2203. ],
  2204. "lastUserMessageExcludes": ["<task-notification>"],
  2205. "lastUserMessageIncludes": ["E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE"]
  2206. },
  2207. "response": {
  2208. "statusCode": 200,
  2209. "toolUse": {
  2210. "id": "toolu_e2e_background_idle_child_tool_bash",
  2211. "name": "Bash",
  2212. "input": {
  2213. "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\"'",
  2214. "description": "background idle child visible bash sleep"
  2215. }
  2216. }
  2217. }
  2218. },
  2219. {
  2220. "id": "upstream-background-child-tool-idle-child-done",
  2221. "description": "BG13: child Agent completes after the visible Bash tool finishes.",
  2222. "metadata": {
  2223. "kind": "subagent",
  2224. "timingPolicy": "fast-text",
  2225. "source": "synthetic",
  2226. "syntheticReason": "让 background Agent 正常完成并产生 parent notification。"
  2227. },
  2228. "maxMatches": 1,
  2229. "match": {
  2230. "method": "POST",
  2231. "pathIncludes": "/messages",
  2232. "bodyIncludes": [
  2233. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE",
  2234. "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_BASH_DONE"
  2235. ],
  2236. "bodyExcludes": [
  2237. "Generate a concise title",
  2238. "CRITICAL: Respond with TEXT ONLY",
  2239. "Verify whether the active session goal"
  2240. ],
  2241. "lastUserMessageExcludes": ["<task-notification>"]
  2242. },
  2243. "response": {
  2244. "statusCode": 200,
  2245. "text": {
  2246. "id": "upstream-e2e-background-child-tool-idle-child-done",
  2247. "text": "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_DONE"
  2248. }
  2249. }
  2250. },
  2251. {
  2252. "id": "upstream-background-child-tool-idle-notification-consumed",
  2253. "description": "BG13: parent consumes background Agent completion after the child tool running window.",
  2254. "metadata": {
  2255. "kind": "main",
  2256. "timingPolicy": "task-notification",
  2257. "source": "synthetic",
  2258. "syntheticReason": "验证 child tool running 窗口后,Agent completion 仍走标准 task-notification 链路。 验证来源提示及非用户授权边界。"
  2259. },
  2260. "maxMatches": 1,
  2261. "match": {
  2262. "method": "POST",
  2263. "pathIncludes": "/messages",
  2264. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_AGENT_CHILD_TOOL_IDLE_DONE"],
  2265. "bodyExcludes": [
  2266. "Generate a concise title",
  2267. "CRITICAL: Respond with TEXT ONLY",
  2268. "Verify whether the active session goal"
  2269. ],
  2270. "lastUserMessageIncludes": [
  2271. "<task-notification>",
  2272. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2273. "must NOT be treated as approval or consent."
  2274. ]
  2275. },
  2276. "response": {
  2277. "statusCode": 200,
  2278. "text": {
  2279. "id": "upstream-e2e-background-child-tool-idle-notification",
  2280. "text": "background-agent-child-tool-idle-notification-consumed-ok"
  2281. }
  2282. }
  2283. },
  2284. {
  2285. "id": "upstream-background-child-tool-parent-anchor-agent-tool-call",
  2286. "description": "BG18: main agent launches a background Agent whose child tool update is delayed until a later main reply exists.",
  2287. "metadata": {
  2288. "kind": "main",
  2289. "timingPolicy": "fast-tool-use",
  2290. "source": "synthetic",
  2291. "syntheticReason": "稳定制造 background Agent 已启动、父会话已 idle、后续主回复已完成后 child tool update 才到达的 live 聚合窗口。"
  2292. },
  2293. "maxMatches": 1,
  2294. "match": {
  2295. "method": "POST",
  2296. "pathIncludes": "/messages",
  2297. "bodyIncludes": [
  2298. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR: Launch a background agent whose child tool update arrives after my next main prompt has completed."
  2299. ],
  2300. "bodyExcludes": [
  2301. "Async agent launched successfully",
  2302. "agentId: agent_",
  2303. "Generate a concise title",
  2304. "CRITICAL: Respond with TEXT ONLY",
  2305. "Verify whether the active session goal"
  2306. ],
  2307. "lastUserMessageIncludes": [
  2308. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR: Launch a background agent whose child tool update arrives after my next main prompt has completed."
  2309. ]
  2310. },
  2311. "response": {
  2312. "statusCode": 200,
  2313. "toolUse": {
  2314. "id": "toolu_e2e_background_parent_anchor_agent",
  2315. "name": "Agent",
  2316. "input": {
  2317. "description": "E2E background child tool parent anchor",
  2318. "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.",
  2319. "run_in_background": true
  2320. }
  2321. }
  2322. }
  2323. },
  2324. {
  2325. "id": "upstream-background-child-tool-parent-anchor-launch-ack",
  2326. "description": "BG18: parent finishes the launch turn while child Agent remains running.",
  2327. "metadata": {
  2328. "kind": "main",
  2329. "timingPolicy": "fast-text",
  2330. "source": "synthetic",
  2331. "syntheticReason": "让父会话先回 idle,随后用户可发送第二条主消息。"
  2332. },
  2333. "maxMatches": 1,
  2334. "match": {
  2335. "method": "POST",
  2336. "pathIncludes": "/messages",
  2337. "bodyIncludes": [
  2338. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR",
  2339. "Async agent launched successfully"
  2340. ],
  2341. "bodyExcludes": [
  2342. "Generate a concise title",
  2343. "CRITICAL: Respond with TEXT ONLY",
  2344. "Verify whether the active session goal"
  2345. ]
  2346. },
  2347. "response": {
  2348. "statusCode": 200,
  2349. "text": {
  2350. "id": "upstream-e2e-background-child-tool-parent-anchor-launch-ack",
  2351. "text": "background-child-tool-parent-anchor-launched-ok"
  2352. }
  2353. }
  2354. },
  2355. {
  2356. "id": "upstream-background-child-tool-parent-anchor-follow-up",
  2357. "description": "BG18: a later main prompt completes while the background child tool response is still delayed.",
  2358. "metadata": {
  2359. "kind": "main",
  2360. "timingPolicy": "fast-text",
  2361. "source": "synthetic",
  2362. "syntheticReason": "在 child tool update 到达前创建新的主 assistant 回复,用来复现 live child tool 被错误挂到最新回复下的问题。"
  2363. },
  2364. "maxMatches": 1,
  2365. "match": {
  2366. "method": "POST",
  2367. "pathIncludes": "/messages",
  2368. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_FOLLOWUP"],
  2369. "bodyExcludes": [
  2370. "Generate a concise title",
  2371. "CRITICAL: Respond with TEXT ONLY",
  2372. "Verify whether the active session goal"
  2373. ],
  2374. "lastUserMessageExcludes": ["<task-notification>"],
  2375. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_FOLLOWUP"]
  2376. },
  2377. "response": {
  2378. "statusCode": 200,
  2379. "text": {
  2380. "id": "upstream-e2e-background-child-tool-parent-anchor-follow-up",
  2381. "text": "background-child-tool-parent-anchor-main-followup-ok"
  2382. }
  2383. }
  2384. },
  2385. {
  2386. "id": "upstream-background-child-tool-parent-anchor-child-bash-tool-call",
  2387. "description": "BG18: child Agent starts a visible Bash tool after the later main reply already exists.",
  2388. "metadata": {
  2389. "kind": "subagent",
  2390. "timingPolicy": "delayed-tool-use",
  2391. "source": "synthetic",
  2392. "syntheticReason": "延迟 child Bash tool_use,稳定验证 mirrored child tool update 必须按 parentToolUseId 回挂原 Agent message。"
  2393. },
  2394. "maxMatches": 1,
  2395. "match": {
  2396. "method": "POST",
  2397. "pathIncludes": "/messages",
  2398. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD"],
  2399. "bodyExcludes": [
  2400. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_BASH_DONE",
  2401. "Generate a concise title",
  2402. "CRITICAL: Respond with TEXT ONLY",
  2403. "Verify whether the active session goal"
  2404. ],
  2405. "lastUserMessageExcludes": ["<task-notification>"],
  2406. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD"]
  2407. },
  2408. "response": {
  2409. "statusCode": 200,
  2410. "delayMs": 6000,
  2411. "toolUse": {
  2412. "id": "toolu_e2e_background_parent_anchor_child_bash",
  2413. "name": "Bash",
  2414. "input": {
  2415. "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\"'",
  2416. "description": "background parent anchor child visible bash sleep"
  2417. }
  2418. }
  2419. }
  2420. },
  2421. {
  2422. "id": "upstream-background-child-tool-parent-anchor-child-done",
  2423. "description": "BG18: child Agent completes after its visible Bash tool finishes.",
  2424. "metadata": {
  2425. "kind": "subagent",
  2426. "timingPolicy": "fast-text",
  2427. "source": "synthetic",
  2428. "syntheticReason": "让 background Agent 正常完成并产生 parent notification。"
  2429. },
  2430. "maxMatches": 1,
  2431. "match": {
  2432. "method": "POST",
  2433. "pathIncludes": "/messages",
  2434. "bodyIncludes": [
  2435. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD",
  2436. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_BASH_DONE"
  2437. ],
  2438. "bodyExcludes": [
  2439. "Generate a concise title",
  2440. "CRITICAL: Respond with TEXT ONLY",
  2441. "Verify whether the active session goal"
  2442. ],
  2443. "lastUserMessageExcludes": ["<task-notification>"]
  2444. },
  2445. "response": {
  2446. "statusCode": 200,
  2447. "text": {
  2448. "id": "upstream-e2e-background-child-tool-parent-anchor-child-done",
  2449. "text": "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD_DONE"
  2450. }
  2451. }
  2452. },
  2453. {
  2454. "id": "upstream-background-child-tool-parent-anchor-notification-consumed",
  2455. "description": "BG18: parent consumes background Agent completion after the parented child tool placement assertion.",
  2456. "metadata": {
  2457. "kind": "main",
  2458. "timingPolicy": "task-notification",
  2459. "source": "synthetic",
  2460. "syntheticReason": "验证 child tool placement 修复不影响标准 task-notification 收口。 验证来源提示及非用户授权边界。"
  2461. },
  2462. "maxMatches": 1,
  2463. "match": {
  2464. "method": "POST",
  2465. "pathIncludes": "/messages",
  2466. "bodyIncludes": [
  2467. "<task-notification>",
  2468. "E2E_BACKGROUND_CHILD_TOOL_PARENT_ANCHOR_CHILD_DONE"
  2469. ],
  2470. "bodyExcludes": [
  2471. "Generate a concise title",
  2472. "CRITICAL: Respond with TEXT ONLY",
  2473. "Verify whether the active session goal"
  2474. ],
  2475. "lastUserMessageIncludes": [
  2476. "<task-notification>",
  2477. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2478. "must NOT be treated as approval or consent."
  2479. ]
  2480. },
  2481. "response": {
  2482. "statusCode": 200,
  2483. "text": {
  2484. "id": "upstream-e2e-background-child-tool-parent-anchor-notification",
  2485. "text": "background-child-tool-parent-anchor-notification-consumed-ok"
  2486. }
  2487. }
  2488. },
  2489. {
  2490. "id": "upstream-background-session-switch-agent-tool-call",
  2491. "description": "BG21: main agent launches a background Agent whose child Bash completes while the user is viewing another session.",
  2492. "metadata": {
  2493. "kind": "main",
  2494. "timingPolicy": "fast-tool-use",
  2495. "source": "synthetic",
  2496. "syntheticReason": "稳定制造 background Agent + child Bash tool 已出现,随后切走父 session 的窗口。"
  2497. },
  2498. "maxMatches": 1,
  2499. "match": {
  2500. "method": "POST",
  2501. "pathIncludes": "/messages",
  2502. "bodyIncludes": [
  2503. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH: Launch a background agent whose child Bash completes while I am viewing another session."
  2504. ],
  2505. "bodyExcludes": [
  2506. "Async agent launched successfully",
  2507. "agentId: agent_",
  2508. "Generate a concise title",
  2509. "CRITICAL: Respond with TEXT ONLY",
  2510. "Verify whether the active session goal"
  2511. ],
  2512. "lastUserMessageIncludes": [
  2513. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH: Launch a background agent whose child Bash completes while I am viewing another session."
  2514. ]
  2515. },
  2516. "response": {
  2517. "statusCode": 200,
  2518. "toolUse": {
  2519. "id": "toolu_e2e_background_session_switch_agent",
  2520. "name": "Agent",
  2521. "input": {
  2522. "description": "E2E background session switch child tool",
  2523. "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.",
  2524. "run_in_background": true
  2525. }
  2526. }
  2527. }
  2528. },
  2529. {
  2530. "id": "upstream-background-session-switch-launch-ack",
  2531. "description": "BG21: parent finishes launch turn while child Agent remains running.",
  2532. "metadata": {
  2533. "kind": "main",
  2534. "timingPolicy": "fast-text",
  2535. "source": "synthetic",
  2536. "syntheticReason": "让父会话先回 idle,随后测试切到其他 session/draft。"
  2537. },
  2538. "maxMatches": 1,
  2539. "match": {
  2540. "method": "POST",
  2541. "pathIncludes": "/messages",
  2542. "bodyIncludes": [
  2543. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH",
  2544. "Async agent launched successfully"
  2545. ],
  2546. "bodyExcludes": [
  2547. "Generate a concise title",
  2548. "CRITICAL: Respond with TEXT ONLY",
  2549. "Verify whether the active session goal"
  2550. ]
  2551. },
  2552. "response": {
  2553. "statusCode": 200,
  2554. "text": {
  2555. "id": "upstream-e2e-background-session-switch-launch-ack",
  2556. "text": "background-session-switch-launched-ok"
  2557. }
  2558. }
  2559. },
  2560. {
  2561. "id": "upstream-background-session-switch-child-bash-tool-call",
  2562. "description": "BG21: child Agent starts a visible Bash tool before the parent session is hidden.",
  2563. "metadata": {
  2564. "kind": "subagent",
  2565. "timingPolicy": "delayed-tool-use",
  2566. "source": "synthetic",
  2567. "syntheticReason": "先让 child Bash running card 进入父 renderer store;命令等待文件 barrier,由测试在父 session 隐藏后释放。"
  2568. },
  2569. "maxMatches": 1,
  2570. "match": {
  2571. "method": "POST",
  2572. "pathIncludes": "/messages",
  2573. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD"],
  2574. "bodyExcludes": [
  2575. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_BASH_DONE",
  2576. "Generate a concise title",
  2577. "CRITICAL: Respond with TEXT ONLY",
  2578. "Verify whether the active session goal"
  2579. ],
  2580. "lastUserMessageExcludes": ["<task-notification>"],
  2581. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD"]
  2582. },
  2583. "response": {
  2584. "statusCode": 200,
  2585. "delayMs": 500,
  2586. "toolUse": {
  2587. "id": "toolu_e2e_background_session_switch_child_bash",
  2588. "name": "Bash",
  2589. "input": {
  2590. "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\"'",
  2591. "description": "background session switch child visible bash"
  2592. }
  2593. }
  2594. }
  2595. },
  2596. {
  2597. "id": "upstream-background-session-switch-child-done",
  2598. "description": "BG21: child Agent completes after Bash finishes while the parent session is hidden.",
  2599. "metadata": {
  2600. "kind": "subagent",
  2601. "timingPolicy": "fast-text",
  2602. "source": "synthetic",
  2603. "syntheticReason": "让 hidden/tombstoned terminal tool update 和 Agent completion notification 都完成。"
  2604. },
  2605. "maxMatches": 1,
  2606. "match": {
  2607. "method": "POST",
  2608. "pathIncludes": "/messages",
  2609. "bodyIncludes": [
  2610. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD",
  2611. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_BASH_DONE"
  2612. ],
  2613. "bodyExcludes": [
  2614. "Generate a concise title",
  2615. "CRITICAL: Respond with TEXT ONLY",
  2616. "Verify whether the active session goal"
  2617. ],
  2618. "lastUserMessageExcludes": ["<task-notification>"]
  2619. },
  2620. "response": {
  2621. "statusCode": 200,
  2622. "text": {
  2623. "id": "upstream-e2e-background-session-switch-child-done",
  2624. "text": "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD_DONE"
  2625. }
  2626. }
  2627. },
  2628. {
  2629. "id": "upstream-background-session-switch-notification-consumed",
  2630. "description": "BG21: parent consumes completion notification while the task is not active.",
  2631. "metadata": {
  2632. "kind": "main",
  2633. "timingPolicy": "task-notification",
  2634. "source": "synthetic",
  2635. "syntheticReason": "验证切回后 UI 从 store/snapshot 恢复 terminal child tool 投影。 验证来源提示及非用户授权边界。"
  2636. },
  2637. "maxMatches": 1,
  2638. "match": {
  2639. "method": "POST",
  2640. "pathIncludes": "/messages",
  2641. "bodyIncludes": [
  2642. "<task-notification>",
  2643. "E2E_BACKGROUND_CHILD_TOOL_SESSION_SWITCH_CHILD_DONE"
  2644. ],
  2645. "bodyExcludes": [
  2646. "Generate a concise title",
  2647. "CRITICAL: Respond with TEXT ONLY",
  2648. "Verify whether the active session goal"
  2649. ],
  2650. "lastUserMessageIncludes": [
  2651. "<task-notification>",
  2652. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2653. "must NOT be treated as approval or consent."
  2654. ]
  2655. },
  2656. "response": {
  2657. "statusCode": 200,
  2658. "text": {
  2659. "id": "upstream-e2e-background-session-switch-notification",
  2660. "text": "background-session-switch-notification-consumed-ok"
  2661. }
  2662. }
  2663. },
  2664. {
  2665. "id": "upstream-background-switch-back-running-agent-tool-call",
  2666. "description": "BG22: main agent launches a background Agent whose child Bash is still running when the user switches back.",
  2667. "metadata": {
  2668. "kind": "main",
  2669. "timingPolicy": "fast-tool-use",
  2670. "source": "synthetic",
  2671. "syntheticReason": "稳定制造 background Agent + child Bash tool 已出现且切回时仍 running 的窗口。"
  2672. },
  2673. "maxMatches": 1,
  2674. "match": {
  2675. "method": "POST",
  2676. "pathIncludes": "/messages",
  2677. "bodyIncludes": [
  2678. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING: Launch a background agent whose child Bash is still running when I switch back."
  2679. ],
  2680. "bodyExcludes": [
  2681. "Async agent launched successfully",
  2682. "agentId: agent_",
  2683. "Generate a concise title",
  2684. "CRITICAL: Respond with TEXT ONLY",
  2685. "Verify whether the active session goal"
  2686. ],
  2687. "lastUserMessageIncludes": [
  2688. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING: Launch a background agent whose child Bash is still running when I switch back."
  2689. ]
  2690. },
  2691. "response": {
  2692. "statusCode": 200,
  2693. "toolUse": {
  2694. "id": "toolu_e2e_background_switch_back_running_agent",
  2695. "name": "Agent",
  2696. "input": {
  2697. "description": "E2E background switch back running child tool",
  2698. "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.",
  2699. "run_in_background": true
  2700. }
  2701. }
  2702. }
  2703. },
  2704. {
  2705. "id": "upstream-background-switch-back-running-launch-ack",
  2706. "description": "BG22: parent finishes launch turn while child Agent remains running.",
  2707. "metadata": {
  2708. "kind": "main",
  2709. "timingPolicy": "fast-text",
  2710. "source": "synthetic",
  2711. "syntheticReason": "让父会话先回 idle,随后测试切到其他 session/draft 后立即切回。"
  2712. },
  2713. "maxMatches": 1,
  2714. "match": {
  2715. "method": "POST",
  2716. "pathIncludes": "/messages",
  2717. "bodyIncludes": [
  2718. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING",
  2719. "Async agent launched successfully"
  2720. ],
  2721. "bodyExcludes": [
  2722. "Generate a concise title",
  2723. "CRITICAL: Respond with TEXT ONLY",
  2724. "Verify whether the active session goal"
  2725. ]
  2726. },
  2727. "response": {
  2728. "statusCode": 200,
  2729. "text": {
  2730. "id": "upstream-e2e-background-switch-back-running-launch-ack",
  2731. "text": "background-switch-back-running-launched-ok"
  2732. }
  2733. }
  2734. },
  2735. {
  2736. "id": "upstream-background-switch-back-running-child-bash-tool-call",
  2737. "description": "BG22: child Agent starts a visible Bash tool that is still running when the parent session is selected again.",
  2738. "metadata": {
  2739. "kind": "subagent",
  2740. "timingPolicy": "delayed-tool-use",
  2741. "source": "synthetic",
  2742. "syntheticReason": "先让 child Bash running card 进入父 renderer store,并保持足够长时间覆盖切回时仍 running 的窗口。"
  2743. },
  2744. "maxMatches": 1,
  2745. "match": {
  2746. "method": "POST",
  2747. "pathIncludes": "/messages",
  2748. "bodyIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD"],
  2749. "bodyExcludes": [
  2750. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_BASH_DONE",
  2751. "Generate a concise title",
  2752. "CRITICAL: Respond with TEXT ONLY",
  2753. "Verify whether the active session goal"
  2754. ],
  2755. "lastUserMessageExcludes": ["<task-notification>"],
  2756. "lastUserMessageIncludes": ["E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD"]
  2757. },
  2758. "response": {
  2759. "statusCode": 200,
  2760. "delayMs": 500,
  2761. "toolUse": {
  2762. "id": "toolu_e2e_background_switch_back_running_child_bash",
  2763. "name": "Bash",
  2764. "input": {
  2765. "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\"'",
  2766. "description": "background switch back running child visible bash"
  2767. }
  2768. }
  2769. }
  2770. },
  2771. {
  2772. "id": "upstream-background-switch-back-running-child-done",
  2773. "description": "BG22: child Agent completes after Bash finishes while the parent session is visible again.",
  2774. "metadata": {
  2775. "kind": "subagent",
  2776. "timingPolicy": "fast-text",
  2777. "source": "synthetic",
  2778. "syntheticReason": "验证切回可见状态后 child Bash terminal update 仍会 patch 同一 tool card。"
  2779. },
  2780. "maxMatches": 1,
  2781. "match": {
  2782. "method": "POST",
  2783. "pathIncludes": "/messages",
  2784. "bodyIncludes": [
  2785. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD",
  2786. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_BASH_DONE"
  2787. ],
  2788. "bodyExcludes": [
  2789. "Generate a concise title",
  2790. "CRITICAL: Respond with TEXT ONLY",
  2791. "Verify whether the active session goal"
  2792. ],
  2793. "lastUserMessageExcludes": ["<task-notification>"]
  2794. },
  2795. "response": {
  2796. "statusCode": 200,
  2797. "text": {
  2798. "id": "upstream-e2e-background-switch-back-running-child-done",
  2799. "text": "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD_DONE"
  2800. }
  2801. }
  2802. },
  2803. {
  2804. "id": "upstream-background-switch-back-running-notification-consumed",
  2805. "description": "BG22: parent consumes completion notification after the user has switched back.",
  2806. "metadata": {
  2807. "kind": "main",
  2808. "timingPolicy": "task-notification",
  2809. "source": "synthetic",
  2810. "syntheticReason": "验证切回后后续 Agent completion notification 仍按标准链路消费。 验证来源提示及非用户授权边界。"
  2811. },
  2812. "maxMatches": 1,
  2813. "match": {
  2814. "method": "POST",
  2815. "pathIncludes": "/messages",
  2816. "bodyIncludes": [
  2817. "<task-notification>",
  2818. "E2E_BACKGROUND_CHILD_TOOL_SWITCH_BACK_RUNNING_CHILD_DONE"
  2819. ],
  2820. "bodyExcludes": [
  2821. "Generate a concise title",
  2822. "CRITICAL: Respond with TEXT ONLY",
  2823. "Verify whether the active session goal"
  2824. ],
  2825. "lastUserMessageIncludes": [
  2826. "<task-notification>",
  2827. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  2828. "must NOT be treated as approval or consent."
  2829. ]
  2830. },
  2831. "response": {
  2832. "statusCode": 200,
  2833. "text": {
  2834. "id": "upstream-e2e-background-switch-back-running-notification",
  2835. "text": "background-switch-back-running-notification-consumed-ok"
  2836. }
  2837. }
  2838. },
  2839. {
  2840. "id": "upstream-background-send-now-queue-agent-tool-call",
  2841. "description": "BG16: main agent launches a background Agent whose child tool keeps raw runtime streaming while main is idle.",
  2842. "metadata": {
  2843. "kind": "main",
  2844. "timingPolicy": "fast-tool-use",
  2845. "source": "synthetic",
  2846. "syntheticReason": "稳定制造 main idle + background-only child tool running + held queue 的窗口,复现 queued prompt Send now 不应 stop background task。"
  2847. },
  2848. "maxMatches": 1,
  2849. "match": {
  2850. "method": "POST",
  2851. "pathIncludes": "/messages",
  2852. "bodyIncludes": [
  2853. "E2E_BACKGROUND_SEND_NOW_QUEUE: Launch a background agent with a visible child Bash tool, then wait."
  2854. ],
  2855. "bodyExcludes": [
  2856. "Async agent launched successfully",
  2857. "agentId: agent_",
  2858. "Generate a concise title",
  2859. "CRITICAL: Respond with TEXT ONLY",
  2860. "Verify whether the active session goal"
  2861. ],
  2862. "lastUserMessageIncludes": [
  2863. "E2E_BACKGROUND_SEND_NOW_QUEUE: Launch a background agent with a visible child Bash tool, then wait."
  2864. ]
  2865. },
  2866. "response": {
  2867. "statusCode": 200,
  2868. "toolUse": {
  2869. "id": "toolu_e2e_background_send_now_queue_agent",
  2870. "name": "Agent",
  2871. "input": {
  2872. "description": "E2E background send now queue",
  2873. "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.",
  2874. "run_in_background": true
  2875. }
  2876. }
  2877. }
  2878. },
  2879. {
  2880. "id": "upstream-background-send-now-queue-agent-launch-ack",
  2881. "description": "BG16: parent finishes launch turn while background Agent continues running.",
  2882. "metadata": {
  2883. "kind": "main",
  2884. "timingPolicy": "fast-text",
  2885. "source": "synthetic",
  2886. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn,制造 parent idle + child tool running 窗口。"
  2887. },
  2888. "maxMatches": 1,
  2889. "match": {
  2890. "method": "POST",
  2891. "pathIncludes": "/messages",
  2892. "bodyIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE", "Async agent launched successfully"],
  2893. "bodyExcludes": [
  2894. "Generate a concise title",
  2895. "CRITICAL: Respond with TEXT ONLY",
  2896. "Verify whether the active session goal"
  2897. ]
  2898. },
  2899. "response": {
  2900. "statusCode": 200,
  2901. "text": {
  2902. "id": "upstream-e2e-background-send-now-queue-launch-ack",
  2903. "text": "background-send-now-queue-launched-ok"
  2904. }
  2905. }
  2906. },
  2907. {
  2908. "id": "upstream-background-send-now-queue-child-bash-tool-call",
  2909. "description": "BG16: child Agent starts a visible foreground Bash tool while parent remains idle.",
  2910. "metadata": {
  2911. "kind": "subagent",
  2912. "timingPolicy": "fast-tool-use",
  2913. "source": "synthetic",
  2914. "syntheticReason": "用文件 barrier 控制真实 child Bash 生命周期,让父侧 raw runtime streaming 但 mainActive=false;点击 Send now 后再释放,避免固定 sleep 受全量负载影响。"
  2915. },
  2916. "maxMatches": 1,
  2917. "match": {
  2918. "method": "POST",
  2919. "pathIncludes": "/messages",
  2920. "bodyIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD"],
  2921. "bodyExcludes": [
  2922. "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_BASH_DONE",
  2923. "Generate a concise title",
  2924. "CRITICAL: Respond with TEXT ONLY",
  2925. "Verify whether the active session goal"
  2926. ],
  2927. "lastUserMessageExcludes": ["<task-notification>"],
  2928. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD"]
  2929. },
  2930. "response": {
  2931. "statusCode": 200,
  2932. "toolUse": {
  2933. "id": "toolu_e2e_background_send_now_queue_child_bash",
  2934. "name": "Bash",
  2935. "input": {
  2936. "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\"'",
  2937. "description": "background send now queue child bash sleep"
  2938. }
  2939. }
  2940. }
  2941. },
  2942. {
  2943. "id": "upstream-background-send-now-queue-hold",
  2944. "description": "BG16: foreground hold turn creates a real typed queue before stop transitions to background-only idle.",
  2945. "metadata": {
  2946. "kind": "main",
  2947. "timingPolicy": "controlled-stream",
  2948. "source": "synthetic",
  2949. "syntheticReason": "使用真实主 turn 与 composer queue 替代已删除的 renderer store 注入,稳定构造 stop 后 background-only + paused queue。"
  2950. },
  2951. "maxMatches": 1,
  2952. "match": {
  2953. "method": "POST",
  2954. "pathIncludes": "/messages",
  2955. "bodyIncludes": ["E2E_HOLD_STREAM", "E2E_BACKGROUND_SEND_NOW_QUEUE_HOLD"],
  2956. "bodyExcludes": [
  2957. "Generate a concise title",
  2958. "CRITICAL: Respond with TEXT ONLY",
  2959. "Verify whether the active session goal"
  2960. ],
  2961. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_HOLD"]
  2962. },
  2963. "response": {
  2964. "statusCode": 200,
  2965. "delayMs": 60000,
  2966. "text": {
  2967. "id": "upstream-e2e-background-send-now-queue-hold",
  2968. "inputTokens": 120,
  2969. "outputTokens": 12,
  2970. "text": "upstream-e2e-ok"
  2971. }
  2972. }
  2973. },
  2974. {
  2975. "id": "upstream-background-send-now-queue-prompt-received",
  2976. "description": "BG16: clicked queued prompt is sent as a normal provider request without stopping background task.",
  2977. "metadata": {
  2978. "kind": "main",
  2979. "timingPolicy": "fast-text",
  2980. "source": "synthetic",
  2981. "syntheticReason": "验证 background-only running 下 queued prompt Send now 直接触发 provider request,而不是先 stop background task。"
  2982. },
  2983. "maxMatches": 1,
  2984. "match": {
  2985. "method": "POST",
  2986. "pathIncludes": "/messages",
  2987. "bodyIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_PAYLOAD"],
  2988. "bodyExcludes": [
  2989. "Generate a concise title",
  2990. "CRITICAL: Respond with TEXT ONLY",
  2991. "Verify whether the active session goal"
  2992. ],
  2993. "lastUserMessageExcludes": ["<task-notification>"],
  2994. "lastUserMessageIncludes": ["E2E_BACKGROUND_SEND_NOW_QUEUE_PAYLOAD"]
  2995. },
  2996. "response": {
  2997. "statusCode": 200,
  2998. "text": {
  2999. "id": "upstream-e2e-background-send-now-queue-received",
  3000. "text": "background-send-now-queue-received-ok"
  3001. }
  3002. }
  3003. },
  3004. {
  3005. "id": "upstream-background-send-now-queue-child-done",
  3006. "description": "BG16: child Agent completes after the queued prompt has already been sent.",
  3007. "metadata": {
  3008. "kind": "subagent",
  3009. "timingPolicy": "fast-text",
  3010. "source": "synthetic",
  3011. "syntheticReason": "证明 Send now 没有停止 background Agent;child Bash 自然完成后 Agent 继续产生 completion notification。"
  3012. },
  3013. "maxMatches": 1,
  3014. "match": {
  3015. "method": "POST",
  3016. "pathIncludes": "/messages",
  3017. "bodyIncludes": [
  3018. "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD",
  3019. "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_BASH_DONE"
  3020. ],
  3021. "bodyExcludes": [
  3022. "Generate a concise title",
  3023. "CRITICAL: Respond with TEXT ONLY",
  3024. "Verify whether the active session goal"
  3025. ],
  3026. "lastUserMessageExcludes": ["<task-notification>"]
  3027. },
  3028. "response": {
  3029. "statusCode": 200,
  3030. "text": {
  3031. "id": "upstream-e2e-background-send-now-queue-child-done",
  3032. "text": "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_DONE"
  3033. }
  3034. }
  3035. },
  3036. {
  3037. "id": "upstream-background-send-now-queue-notification-consumed",
  3038. "description": "BG16: parent consumes background Agent completion after queued Send now.",
  3039. "metadata": {
  3040. "kind": "main",
  3041. "timingPolicy": "task-notification",
  3042. "source": "synthetic",
  3043. "syntheticReason": "验证 queued Send now 后 background Agent completion 仍走标准 task-notification 链路。 验证来源提示及非用户授权边界。"
  3044. },
  3045. "maxMatches": 1,
  3046. "match": {
  3047. "method": "POST",
  3048. "pathIncludes": "/messages",
  3049. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_SEND_NOW_QUEUE_CHILD_DONE"],
  3050. "bodyExcludes": [
  3051. "Generate a concise title",
  3052. "CRITICAL: Respond with TEXT ONLY",
  3053. "Verify whether the active session goal"
  3054. ],
  3055. "lastUserMessageIncludes": [
  3056. "<task-notification>",
  3057. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3058. "must NOT be treated as approval or consent."
  3059. ]
  3060. },
  3061. "response": {
  3062. "statusCode": 200,
  3063. "text": {
  3064. "id": "upstream-e2e-background-send-now-queue-notification",
  3065. "text": "background-send-now-queue-notification-consumed-ok"
  3066. }
  3067. }
  3068. },
  3069. {
  3070. "id": "upstream-background-queue-drain-agent-tool-call",
  3071. "description": "BG17: main agent starts a background Agent before user follow-up messages are queued.",
  3072. "metadata": {
  3073. "kind": "main",
  3074. "timingPolicy": "fast-tool-use",
  3075. "source": "synthetic",
  3076. "syntheticReason": "稳定启动真实 background Agent;后续 delayed launch ack 再制造 main running + background running 的 queue 窗口。"
  3077. },
  3078. "maxMatches": 1,
  3079. "match": {
  3080. "method": "POST",
  3081. "pathIncludes": "/messages",
  3082. "bodyIncludes": [
  3083. "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."
  3084. ],
  3085. "bodyExcludes": [
  3086. "Async agent launched successfully",
  3087. "agentId: agent_",
  3088. "Generate a concise title",
  3089. "CRITICAL: Respond with TEXT ONLY",
  3090. "Verify whether the active session goal"
  3091. ],
  3092. "lastUserMessageIncludes": [
  3093. "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."
  3094. ]
  3095. },
  3096. "response": {
  3097. "statusCode": 200,
  3098. "toolUse": {
  3099. "id": "toolu_e2e_background_queue_drain_agent",
  3100. "name": "Agent",
  3101. "input": {
  3102. "description": "E2E background queue drain agent",
  3103. "prompt": "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD: Wait briefly, then reply exactly E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE.",
  3104. "run_in_background": true
  3105. }
  3106. }
  3107. }
  3108. },
  3109. {
  3110. "id": "upstream-background-queue-drain-agent-launch-ack",
  3111. "description": "BG17: parent keeps the launch turn active after starting the background Agent.",
  3112. "metadata": {
  3113. "kind": "main",
  3114. "timingPolicy": "controlled-stream",
  3115. "source": "synthetic",
  3116. "syntheticReason": "延迟父模型 launch ack,稳定制造 background Agent 已 running、main turn 仍 active 时用户消息进入 renderer queue。"
  3117. },
  3118. "maxMatches": 1,
  3119. "match": {
  3120. "method": "POST",
  3121. "pathIncludes": "/messages",
  3122. "bodyIncludes": [
  3123. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END",
  3124. "Async agent launched successfully"
  3125. ],
  3126. "bodyExcludes": [
  3127. "Generate a concise title",
  3128. "CRITICAL: Respond with TEXT ONLY",
  3129. "Verify whether the active session goal"
  3130. ]
  3131. },
  3132. "response": {
  3133. "statusCode": 200,
  3134. "delayMs": 8000,
  3135. "text": {
  3136. "id": "upstream-e2e-background-queue-drain-launch-ack",
  3137. "text": "background-queue-drain-launched-ok"
  3138. }
  3139. }
  3140. },
  3141. {
  3142. "id": "upstream-background-queue-drain-child-delayed-result",
  3143. "description": "BG17: child Agent stays running until the test releases it after Q4 is consumed.",
  3144. "metadata": {
  3145. "kind": "subagent",
  3146. "timingPolicy": "controlled-stream",
  3147. "source": "synthetic",
  3148. "syntheticReason": "受控挂起 background Agent completion,测试在 Q4 回复完成后再放行,notification 才不会抢在 queued prompt drain 验证前进入父会话。固定延迟会被慢机器上的 drain 间隔追上。"
  3149. },
  3150. "maxMatches": 1,
  3151. "match": {
  3152. "method": "POST",
  3153. "pathIncludes": "/messages",
  3154. "bodyIncludes": [
  3155. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD: Wait briefly, then reply exactly E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE."
  3156. ],
  3157. "bodyExcludes": [
  3158. "Generate a concise title",
  3159. "CRITICAL: Respond with TEXT ONLY",
  3160. "Verify whether the active session goal"
  3161. ],
  3162. "lastUserMessageExcludes": ["<task-notification>"],
  3163. "lastUserMessageIncludes": [
  3164. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD: Wait briefly, then reply exactly E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE."
  3165. ]
  3166. },
  3167. "response": {
  3168. "statusCode": 200,
  3169. "statusMessage": "OK",
  3170. "headers": {
  3171. "cache-control": "no-cache",
  3172. "content-type": "text/event-stream; charset=utf-8"
  3173. },
  3174. "releaseAfterChunks": 1,
  3175. "chunks": [
  3176. {
  3177. "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",
  3178. "delayMs": 0
  3179. },
  3180. {
  3181. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  3182. "delayMs": 0
  3183. },
  3184. {
  3185. "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",
  3186. "delayMs": 0
  3187. },
  3188. {
  3189. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  3190. "delayMs": 0
  3191. },
  3192. {
  3193. "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",
  3194. "delayMs": 0
  3195. },
  3196. { "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "delayMs": 0 }
  3197. ]
  3198. }
  3199. },
  3200. {
  3201. "id": "upstream-background-queue-drain-first-queued-prompt",
  3202. "description": "BG17: first follow-up prompt after the background launch stays active long enough to queue another prompt.",
  3203. "metadata": {
  3204. "kind": "main",
  3205. "timingPolicy": "controlled-stream",
  3206. "source": "synthetic",
  3207. "syntheticReason": "延迟 Q2 响应,稳定验证 launch ack 前已入队的 Q3/Q4 不会在 Q2 drain 后丢失。"
  3208. },
  3209. "maxMatches": 1,
  3210. "match": {
  3211. "method": "POST",
  3212. "pathIncludes": "/messages",
  3213. "bodyIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q2"],
  3214. "bodyExcludes": [
  3215. "Generate a concise title",
  3216. "CRITICAL: Respond with TEXT ONLY",
  3217. "Verify whether the active session goal"
  3218. ],
  3219. "lastUserMessageExcludes": ["<task-notification>"],
  3220. "lastUserMessageIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q2"]
  3221. },
  3222. "response": {
  3223. "statusCode": 200,
  3224. "delayMs": 8000,
  3225. "text": {
  3226. "id": "upstream-e2e-background-queue-drain-first",
  3227. "text": "background-queue-drain-first-ok"
  3228. }
  3229. }
  3230. },
  3231. {
  3232. "id": "upstream-background-queue-drain-second-queued-prompt",
  3233. "description": "BG17: second follow-up prompt drains after Q2 completes.",
  3234. "metadata": {
  3235. "kind": "main",
  3236. "timingPolicy": "controlled-stream",
  3237. "source": "synthetic",
  3238. "syntheticReason": "延迟 Q3 响应,稳定观察 Q3 已渲染为 user message 且 Q4 仍留在 queue 的 UI 窗口。"
  3239. },
  3240. "maxMatches": 1,
  3241. "match": {
  3242. "method": "POST",
  3243. "pathIncludes": "/messages",
  3244. "bodyIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q3"],
  3245. "bodyExcludes": [
  3246. "Generate a concise title",
  3247. "CRITICAL: Respond with TEXT ONLY",
  3248. "Verify whether the active session goal"
  3249. ],
  3250. "lastUserMessageExcludes": ["<task-notification>"],
  3251. "lastUserMessageIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q3"]
  3252. },
  3253. "response": {
  3254. "statusCode": 200,
  3255. "delayMs": 8000,
  3256. "text": {
  3257. "id": "upstream-e2e-background-queue-drain-second",
  3258. "text": "background-queue-drain-second-ok"
  3259. }
  3260. }
  3261. },
  3262. {
  3263. "id": "upstream-background-queue-drain-third-queued-prompt",
  3264. "description": "BG17: Q4 queued before launch ack drains after Q3.",
  3265. "metadata": {
  3266. "kind": "main",
  3267. "timingPolicy": "controlled-stream",
  3268. "source": "synthetic",
  3269. "syntheticReason": "延迟 Q4 响应,稳定观察 Q4 drain 后已渲染为 user message。"
  3270. },
  3271. "maxMatches": 1,
  3272. "match": {
  3273. "method": "POST",
  3274. "pathIncludes": "/messages",
  3275. "bodyIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q4"],
  3276. "bodyExcludes": [
  3277. "Generate a concise title",
  3278. "CRITICAL: Respond with TEXT ONLY",
  3279. "Verify whether the active session goal"
  3280. ],
  3281. "lastUserMessageExcludes": ["<task-notification>"],
  3282. "lastUserMessageIncludes": ["E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_Q4"]
  3283. },
  3284. "response": {
  3285. "statusCode": 200,
  3286. "delayMs": 2000,
  3287. "text": {
  3288. "id": "upstream-e2e-background-queue-drain-third",
  3289. "text": "background-queue-drain-third-ok"
  3290. }
  3291. }
  3292. },
  3293. {
  3294. "id": "upstream-background-queue-drain-notification-consumed",
  3295. "description": "BG17: parent consumes background Agent completion after queued prompt drain.",
  3296. "metadata": {
  3297. "kind": "main",
  3298. "timingPolicy": "task-notification",
  3299. "source": "synthetic",
  3300. "syntheticReason": "验证 queued prompt drain 不会丢失后续 background Agent completion notification。 验证来源提示及非用户授权边界。"
  3301. },
  3302. "maxMatches": 1,
  3303. "match": {
  3304. "method": "POST",
  3305. "pathIncludes": "/messages",
  3306. "bodyIncludes": [
  3307. "<task-notification>",
  3308. "E2E_BACKGROUND_QUEUE_DRAIN_AFTER_MAIN_END_CHILD_DONE"
  3309. ],
  3310. "bodyExcludes": [
  3311. "Generate a concise title",
  3312. "CRITICAL: Respond with TEXT ONLY",
  3313. "Verify whether the active session goal"
  3314. ],
  3315. "lastUserMessageIncludes": [
  3316. "<task-notification>",
  3317. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3318. "must NOT be treated as approval or consent."
  3319. ]
  3320. },
  3321. "response": {
  3322. "statusCode": 200,
  3323. "text": {
  3324. "id": "upstream-e2e-background-queue-drain-notification",
  3325. "text": "background-queue-drain-notification-consumed-ok"
  3326. }
  3327. }
  3328. },
  3329. {
  3330. "id": "upstream-background-nested-agent-tool-call",
  3331. "description": "BG06: main agent launches a background Agent that starts a nested background Bash.",
  3332. "metadata": {
  3333. "kind": "main",
  3334. "timingPolicy": "fast-tool-use",
  3335. "source": "synthetic",
  3336. "syntheticReason": "稳定触发 background Agent 内部启动 background Bash,验证 parent surface 只消费 Agent completion。"
  3337. },
  3338. "maxMatches": 1,
  3339. "match": {
  3340. "method": "POST",
  3341. "pathIncludes": "/messages",
  3342. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH"],
  3343. "bodyExcludes": [
  3344. "Async agent launched successfully",
  3345. "agentId: agent_",
  3346. "Generate a concise title",
  3347. "CRITICAL: Respond with TEXT ONLY",
  3348. "Verify whether the active session goal"
  3349. ],
  3350. "lastUserMessageIncludes": ["E2E_BACKGROUND_NESTED_BASH"]
  3351. },
  3352. "response": {
  3353. "statusCode": 200,
  3354. "toolUse": {
  3355. "id": "toolu_e2e_background_nested_agent",
  3356. "name": "Agent",
  3357. "input": {
  3358. "description": "Nested background Bash",
  3359. "prompt": "E2E_BACKGROUND_NESTED_BASH_CHILD: Start Bash(run_in_background=true), then finish with exactly E2E_BACKGROUND_NESTED_BASH_CHILD_DONE.",
  3360. "run_in_background": true
  3361. }
  3362. }
  3363. }
  3364. },
  3365. {
  3366. "id": "upstream-background-nested-agent-launch-ack",
  3367. "description": "BG06: parent finishes launch turn after nested Agent starts asynchronously.",
  3368. "metadata": {
  3369. "kind": "main",
  3370. "timingPolicy": "fast-text",
  3371. "source": "synthetic",
  3372. "syntheticReason": "父模型在 async Agent launch tool result 后结束当前 turn。"
  3373. },
  3374. "maxMatches": 1,
  3375. "match": {
  3376. "method": "POST",
  3377. "pathIncludes": "/messages",
  3378. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH", "Async agent launched successfully"],
  3379. "bodyExcludes": [
  3380. "Generate a concise title",
  3381. "CRITICAL: Respond with TEXT ONLY",
  3382. "Verify whether the active session goal"
  3383. ]
  3384. },
  3385. "response": {
  3386. "statusCode": 200,
  3387. "text": {
  3388. "id": "upstream-e2e-background-nested-launch-ack",
  3389. "text": "background-nested-bash-launched-ok"
  3390. }
  3391. }
  3392. },
  3393. {
  3394. "id": "upstream-background-nested-child-bash-tool-call",
  3395. "description": "BG06: child Agent starts a background Bash command and then should be allowed to complete before Bash exits.",
  3396. "metadata": {
  3397. "kind": "subagent",
  3398. "timingPolicy": "fast-tool-use",
  3399. "source": "synthetic",
  3400. "syntheticReason": "稳定触发 child runtime 内部 Bash(run_in_background=true)。"
  3401. },
  3402. "maxMatches": 1,
  3403. "match": {
  3404. "method": "POST",
  3405. "pathIncludes": "/messages",
  3406. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH_CHILD"],
  3407. "bodyExcludes": [
  3408. "Command running in background",
  3409. "Generate a concise title",
  3410. "CRITICAL: Respond with TEXT ONLY",
  3411. "Verify whether the active session goal"
  3412. ],
  3413. "lastUserMessageExcludes": ["<task-notification>"],
  3414. "lastUserMessageIncludes": ["E2E_BACKGROUND_NESTED_BASH_CHILD"]
  3415. },
  3416. "response": {
  3417. "statusCode": 200,
  3418. "toolUse": {
  3419. "id": "toolu_e2e_background_nested_child_bash",
  3420. "name": "Bash",
  3421. "input": {
  3422. "command": "sleep 1; printf 'nested bash done\\n'",
  3423. "description": "Nested child background Bash",
  3424. "run_in_background": true
  3425. }
  3426. }
  3427. }
  3428. },
  3429. {
  3430. "id": "upstream-background-nested-child-stops-after-bash-launch",
  3431. "description": "BG06: child Agent stops after receiving the backgrounded Bash launch result.",
  3432. "metadata": {
  3433. "kind": "subagent",
  3434. "timingPolicy": "fast-text",
  3435. "source": "synthetic",
  3436. "syntheticReason": "证明 parent Agent completion 不等待 nested Bash terminal。"
  3437. },
  3438. "maxMatches": 1,
  3439. "match": {
  3440. "method": "POST",
  3441. "pathIncludes": "/messages",
  3442. "bodyIncludes": ["E2E_BACKGROUND_NESTED_BASH_CHILD", "Command running in background"],
  3443. "bodyExcludes": [
  3444. "Generate a concise title",
  3445. "CRITICAL: Respond with TEXT ONLY",
  3446. "Verify whether the active session goal"
  3447. ],
  3448. "lastUserMessageExcludes": ["<task-notification>"]
  3449. },
  3450. "response": {
  3451. "statusCode": 200,
  3452. "text": {
  3453. "id": "upstream-e2e-background-nested-child-done",
  3454. "text": "E2E_BACKGROUND_NESTED_BASH_CHILD_DONE"
  3455. }
  3456. }
  3457. },
  3458. {
  3459. "id": "upstream-background-nested-notification-consumed",
  3460. "description": "BG06: parent consumes the Agent completion notification and does not receive a second parent result for nested Bash.",
  3461. "metadata": {
  3462. "kind": "main",
  3463. "timingPolicy": "task-notification",
  3464. "source": "synthetic",
  3465. "syntheticReason": "验证 parent surface 只消费 Agent completion notification。 验证来源提示及非用户授权边界。"
  3466. },
  3467. "maxMatches": 1,
  3468. "match": {
  3469. "method": "POST",
  3470. "pathIncludes": "/messages",
  3471. "bodyIncludes": ["<task-notification>", "E2E_BACKGROUND_NESTED_BASH_CHILD_DONE"],
  3472. "bodyExcludes": [
  3473. "toolu_e2e_background_nested_child_bash",
  3474. "Generate a concise title",
  3475. "CRITICAL: Respond with TEXT ONLY",
  3476. "Verify whether the active session goal"
  3477. ],
  3478. "lastUserMessageIncludes": [
  3479. "<task-notification>",
  3480. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3481. "must NOT be treated as approval or consent."
  3482. ]
  3483. },
  3484. "response": {
  3485. "statusCode": 200,
  3486. "text": {
  3487. "id": "upstream-e2e-background-nested-notification",
  3488. "text": "background-nested-bash-notification-consumed-ok"
  3489. }
  3490. }
  3491. },
  3492. {
  3493. "id": "upstream-background-snapshot-control-ready",
  3494. "description": "BG23: launch two real background Bash tasks so the right summary panel can reproduce a partial terminal update.",
  3495. "metadata": {
  3496. "kind": "main",
  3497. "timingPolicy": "fast-tool-use",
  3498. "source": "synthetic",
  3499. "syntheticReason": "稳定启动两个 background Bash:第一个先完成,第二个保持 running,用真实右上角 background control 面板复现闪没场景。"
  3500. },
  3501. "maxMatches": 1,
  3502. "match": {
  3503. "method": "POST",
  3504. "pathIncludes": "/messages",
  3505. "bodyIncludes": ["E2E_BACKGROUND_SNAPSHOT_CONTROL"],
  3506. "bodyExcludes": [
  3507. "Generate a concise title",
  3508. "CRITICAL: Respond with TEXT ONLY",
  3509. "Verify whether the active session goal"
  3510. ],
  3511. "lastUserMessageIncludes": ["E2E_BACKGROUND_SNAPSHOT_CONTROL"]
  3512. },
  3513. "response": {
  3514. "statusCode": 200,
  3515. "toolUses": [
  3516. {
  3517. "id": "toolu_e2e_bg23_bash_one",
  3518. "name": "Bash",
  3519. "input": {
  3520. "command": "sh -c 'sleep 8; printf \"E2E_BG23_BASH_ONE_DONE\\n\"'",
  3521. "description": "E2E BG23 bash one",
  3522. "run_in_background": true
  3523. }
  3524. },
  3525. {
  3526. "id": "toolu_e2e_bg23_bash_two",
  3527. "name": "Bash",
  3528. "input": {
  3529. "command": "sh -c 'sleep 60; printf \"E2E_BG23_BASH_TWO_DONE\\n\"'",
  3530. "description": "E2E BG23 bash two",
  3531. "run_in_background": true
  3532. }
  3533. }
  3534. ]
  3535. }
  3536. },
  3537. {
  3538. "id": "upstream-background-snapshot-control-launch-ack",
  3539. "description": "BG23: parent finishes the launch turn while both background Bash controls are visible.",
  3540. "metadata": {
  3541. "kind": "main",
  3542. "timingPolicy": "fast-text",
  3543. "source": "synthetic",
  3544. "syntheticReason": "让 main 回到 idle,同时右上角 background control 面板仍有两个 running Bash row。"
  3545. },
  3546. "maxMatches": 1,
  3547. "match": {
  3548. "method": "POST",
  3549. "pathIncludes": "/messages",
  3550. "bodyIncludes": [
  3551. "E2E_BACKGROUND_SNAPSHOT_CONTROL",
  3552. "toolu_e2e_bg23_bash_one",
  3553. "toolu_e2e_bg23_bash_two",
  3554. "Command running in background"
  3555. ],
  3556. "bodyExcludes": [
  3557. "Generate a concise title",
  3558. "CRITICAL: Respond with TEXT ONLY",
  3559. "Verify whether the active session goal"
  3560. ]
  3561. },
  3562. "response": {
  3563. "statusCode": 200,
  3564. "text": {
  3565. "id": "upstream-e2e-background-snapshot-control-ready",
  3566. "text": "background-snapshot-control-ready-ok"
  3567. }
  3568. }
  3569. },
  3570. {
  3571. "id": "upstream-background-snapshot-control-first-notification",
  3572. "description": "BG23: first background Bash completes while the second stays running.",
  3573. "metadata": {
  3574. "kind": "main",
  3575. "timingPolicy": "task-notification",
  3576. "source": "synthetic",
  3577. "syntheticReason": "消费第一个 background Bash completion notification,并保持第二个 running row 可见。 验证来源提示及非用户授权边界。"
  3578. },
  3579. "maxMatches": 1,
  3580. "match": {
  3581. "method": "POST",
  3582. "pathIncludes": "/messages",
  3583. "bodyIncludes": [
  3584. "E2E_BACKGROUND_SNAPSHOT_CONTROL",
  3585. "<task-notification>",
  3586. "<tool-use-id>toolu_e2e_bg23_bash_one</tool-use-id>",
  3587. "<status>completed</status>"
  3588. ],
  3589. "bodyExcludes": [
  3590. "Generate a concise title",
  3591. "CRITICAL: Respond with TEXT ONLY",
  3592. "Verify whether the active session goal"
  3593. ],
  3594. "lastUserMessageIncludes": [
  3595. "<task-notification>",
  3596. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3597. "must NOT be treated as approval or consent."
  3598. ]
  3599. },
  3600. "response": {
  3601. "statusCode": 200,
  3602. "text": {
  3603. "id": "upstream-e2e-background-snapshot-control-first-notification",
  3604. "text": "background-snapshot-control-first-notification-ok"
  3605. }
  3606. }
  3607. },
  3608. {
  3609. "id": "upstream-background-snapshot-control-second-stopped",
  3610. "description": "BG23: stop the second background Bash for deterministic cleanup.",
  3611. "metadata": {
  3612. "kind": "main",
  3613. "timingPolicy": "task-notification",
  3614. "source": "synthetic",
  3615. "syntheticReason": "消费第二个 background Bash stop notification,避免长 running task 泄漏到后续测试。 验证来源提示及非用户授权边界。"
  3616. },
  3617. "maxMatches": 1,
  3618. "match": {
  3619. "method": "POST",
  3620. "pathIncludes": "/messages",
  3621. "bodyIncludes": [
  3622. "E2E_BACKGROUND_SNAPSHOT_CONTROL",
  3623. "<task-notification>",
  3624. "<tool-use-id>toolu_e2e_bg23_bash_two</tool-use-id>",
  3625. "<status>killed</status>"
  3626. ],
  3627. "bodyExcludes": [
  3628. "Generate a concise title",
  3629. "CRITICAL: Respond with TEXT ONLY",
  3630. "Verify whether the active session goal"
  3631. ],
  3632. "lastUserMessageIncludes": [
  3633. "<task-notification>",
  3634. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3635. "must NOT be treated as approval or consent."
  3636. ]
  3637. },
  3638. "response": {
  3639. "statusCode": 200,
  3640. "text": {
  3641. "id": "upstream-e2e-background-snapshot-control-second-stopped",
  3642. "text": "background-snapshot-control-second-stopped-ok"
  3643. }
  3644. }
  3645. },
  3646. {
  3647. "id": "upstream-background-agent-control-preserve-ready",
  3648. "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.",
  3649. "metadata": {
  3650. "kind": "main",
  3651. "timingPolicy": "fast-tool-use",
  3652. "source": "synthetic",
  3653. "syntheticReason": "稳定启动四个 background Agent:三个 short-lived Agent 依次完成,long-running Agent 保持 running,用真实右上角 background control 面板复现 Agent row 闪没场景。"
  3654. },
  3655. "maxMatches": 1,
  3656. "match": {
  3657. "method": "POST",
  3658. "pathIncludes": "/messages",
  3659. "bodyIncludes": ["E2E_BACKGROUND_AGENT_CONTROL_PRESERVE"],
  3660. "bodyExcludes": [
  3661. "Async agent launched successfully",
  3662. "agentId: agent_",
  3663. "Generate a concise title",
  3664. "CRITICAL: Respond with TEXT ONLY",
  3665. "Verify whether the active session goal"
  3666. ],
  3667. "lastUserMessageIncludes": ["E2E_BACKGROUND_AGENT_CONTROL_PRESERVE"]
  3668. },
  3669. "response": {
  3670. "statusCode": 200,
  3671. "toolUses": [
  3672. {
  3673. "id": "toolu_e2e_bg24_long_running_agent",
  3674. "name": "Agent",
  3675. "input": {
  3676. "description": "E2E BG24 long-running keepalive agent",
  3677. "prompt": "E2E_BG24_LONG_RUNNING_CHILD: Stay running until stopped. If not stopped, return E2E_BG24_LONG_RUNNING_CHILD_UNEXPECTED.",
  3678. "run_in_background": true
  3679. }
  3680. },
  3681. {
  3682. "id": "toolu_e2e_bg24_short_lived_one_agent",
  3683. "name": "Agent",
  3684. "input": {
  3685. "description": "E2E BG24 short-lived one agent",
  3686. "prompt": "E2E_BG24_SHORT_LIVED_ONE_CHILD: Finish after a short delay and return exactly E2E_BG24_SHORT_LIVED_ONE_CHILD_DONE.",
  3687. "run_in_background": true
  3688. }
  3689. },
  3690. {
  3691. "id": "toolu_e2e_bg24_short_lived_two_agent",
  3692. "name": "Agent",
  3693. "input": {
  3694. "description": "E2E BG24 short-lived two agent",
  3695. "prompt": "E2E_BG24_SHORT_LIVED_TWO_CHILD: Finish after a short delay and return exactly E2E_BG24_SHORT_LIVED_TWO_CHILD_DONE.",
  3696. "run_in_background": true
  3697. }
  3698. },
  3699. {
  3700. "id": "toolu_e2e_bg24_short_lived_three_agent",
  3701. "name": "Agent",
  3702. "input": {
  3703. "description": "E2E BG24 short-lived three agent",
  3704. "prompt": "E2E_BG24_SHORT_LIVED_THREE_CHILD: Finish after a short delay and return exactly E2E_BG24_SHORT_LIVED_THREE_CHILD_DONE.",
  3705. "run_in_background": true
  3706. }
  3707. }
  3708. ]
  3709. }
  3710. },
  3711. {
  3712. "id": "upstream-background-agent-control-preserve-long-running-child-keepalive-tool",
  3713. "description": "BG24: long-running peer Agent stays running while short-lived Agent completes.",
  3714. "metadata": {
  3715. "kind": "subagent",
  3716. "timingPolicy": "fast-tool-use",
  3717. "source": "synthetic",
  3718. "syntheticReason": "让 long-running Agent 进入不会自行完成的 child Bash,保持 running,证明另一个 Agent completion notification 不会清掉它的 control row。"
  3719. },
  3720. "maxMatches": 1,
  3721. "match": {
  3722. "method": "POST",
  3723. "pathIncludes": "/messages",
  3724. "bodyIncludes": ["E2E_BG24_LONG_RUNNING_CHILD"],
  3725. "lastUserMessageIncludes": ["E2E_BG24_LONG_RUNNING_CHILD"]
  3726. },
  3727. "response": {
  3728. "statusCode": 200,
  3729. "toolUse": {
  3730. "id": "toolu_e2e_bg24_long_running_keepalive_bash",
  3731. "name": "Bash",
  3732. "input": {
  3733. "command": "while true; do sleep 1; done",
  3734. "description": "E2E BG24 long-running keepalive bash"
  3735. }
  3736. }
  3737. }
  3738. },
  3739. {
  3740. "id": "upstream-background-agent-control-preserve-short-lived-one-child-result",
  3741. "description": "BG24: first short-lived peer Agent completes first.",
  3742. "metadata": {
  3743. "kind": "subagent",
  3744. "timingPolicy": "delayed-text",
  3745. "source": "synthetic",
  3746. "syntheticReason": "短延迟完成第一个 short-lived background Agent,稳定触发 parent task-notification。"
  3747. },
  3748. "maxMatches": 1,
  3749. "match": {
  3750. "method": "POST",
  3751. "pathIncludes": "/messages",
  3752. "bodyIncludes": ["E2E_BG24_SHORT_LIVED_ONE_CHILD"],
  3753. "lastUserMessageIncludes": ["E2E_BG24_SHORT_LIVED_ONE_CHILD"]
  3754. },
  3755. "response": {
  3756. "statusCode": 200,
  3757. "delayMs": 4000,
  3758. "text": {
  3759. "id": "upstream-e2e-bg24-zcode-one-child-done",
  3760. "text": "E2E_BG24_SHORT_LIVED_ONE_CHILD_DONE"
  3761. }
  3762. }
  3763. },
  3764. {
  3765. "id": "upstream-background-agent-control-preserve-short-lived-two-child-result",
  3766. "description": "BG24: second short-lived peer Agent completes second.",
  3767. "metadata": {
  3768. "kind": "subagent",
  3769. "timingPolicy": "delayed-text",
  3770. "source": "synthetic",
  3771. "syntheticReason": "短延迟完成第二个 short-lived background Agent,稳定触发 parent task-notification。"
  3772. },
  3773. "maxMatches": 1,
  3774. "match": {
  3775. "method": "POST",
  3776. "pathIncludes": "/messages",
  3777. "bodyIncludes": ["E2E_BG24_SHORT_LIVED_TWO_CHILD"],
  3778. "lastUserMessageIncludes": ["E2E_BG24_SHORT_LIVED_TWO_CHILD"]
  3779. },
  3780. "response": {
  3781. "statusCode": 200,
  3782. "delayMs": 14000,
  3783. "text": {
  3784. "id": "upstream-e2e-bg24-zcode-two-child-done",
  3785. "text": "E2E_BG24_SHORT_LIVED_TWO_CHILD_DONE"
  3786. }
  3787. }
  3788. },
  3789. {
  3790. "id": "upstream-background-agent-control-preserve-short-lived-three-child-result",
  3791. "description": "BG24: third short-lived peer Agent completes third.",
  3792. "metadata": {
  3793. "kind": "subagent",
  3794. "timingPolicy": "delayed-text",
  3795. "source": "synthetic",
  3796. "syntheticReason": "短延迟完成第三个 short-lived background Agent,复现真实场景中第三个 completion notification 触发 UI 闪没。"
  3797. },
  3798. "maxMatches": 1,
  3799. "match": {
  3800. "method": "POST",
  3801. "pathIncludes": "/messages",
  3802. "bodyIncludes": ["E2E_BG24_SHORT_LIVED_THREE_CHILD"],
  3803. "lastUserMessageIncludes": ["E2E_BG24_SHORT_LIVED_THREE_CHILD"]
  3804. },
  3805. "response": {
  3806. "statusCode": 200,
  3807. "delayMs": 24000,
  3808. "text": {
  3809. "id": "upstream-e2e-bg24-zcode-three-child-done",
  3810. "text": "E2E_BG24_SHORT_LIVED_THREE_CHILD_DONE"
  3811. }
  3812. }
  3813. },
  3814. {
  3815. "id": "upstream-background-agent-control-preserve-launch-ack",
  3816. "description": "BG24: parent finishes launch turn while all background Agent controls are visible.",
  3817. "metadata": {
  3818. "kind": "main",
  3819. "timingPolicy": "fast-text",
  3820. "source": "synthetic",
  3821. "syntheticReason": "让 main 回到 idle,同时右上角 background control 面板仍有多个 running Agent row。"
  3822. },
  3823. "maxMatches": 1,
  3824. "match": {
  3825. "method": "POST",
  3826. "pathIncludes": "/messages",
  3827. "bodyIncludes": [
  3828. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3829. "toolu_e2e_bg24_long_running_agent",
  3830. "toolu_e2e_bg24_short_lived_one_agent",
  3831. "toolu_e2e_bg24_short_lived_two_agent",
  3832. "toolu_e2e_bg24_short_lived_three_agent",
  3833. "Async agent launched successfully"
  3834. ],
  3835. "bodyExcludes": [
  3836. "Generate a concise title",
  3837. "CRITICAL: Respond with TEXT ONLY",
  3838. "Verify whether the active session goal"
  3839. ]
  3840. },
  3841. "response": {
  3842. "statusCode": 200,
  3843. "text": {
  3844. "id": "upstream-e2e-background-agent-control-preserve-ready",
  3845. "text": "background-agent-control-preserve-ready-ok"
  3846. }
  3847. }
  3848. },
  3849. {
  3850. "id": "upstream-background-agent-control-preserve-short-lived-one-notification",
  3851. "description": "BG24: first short-lived background Agent completion notification is consumed before the third completion reproducer.",
  3852. "metadata": {
  3853. "kind": "main",
  3854. "timingPolicy": "task-notification",
  3855. "source": "synthetic",
  3856. "syntheticReason": "先消费第一个 short-lived Agent completion notification,复现真实场景中多个 short-lived Agent 依次完成。 验证来源提示及非用户授权边界。"
  3857. },
  3858. "maxMatches": 1,
  3859. "match": {
  3860. "method": "POST",
  3861. "pathIncludes": "/messages",
  3862. "bodyIncludes": [
  3863. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3864. "<task-notification>",
  3865. "<tool-use-id>toolu_e2e_bg24_short_lived_one_agent</tool-use-id>",
  3866. "<status>completed</status>",
  3867. "E2E_BG24_SHORT_LIVED_ONE_CHILD_DONE"
  3868. ],
  3869. "bodyExcludes": [
  3870. "Generate a concise title",
  3871. "CRITICAL: Respond with TEXT ONLY",
  3872. "Verify whether the active session goal"
  3873. ],
  3874. "lastUserMessageIncludes": [
  3875. "<task-notification>",
  3876. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3877. "must NOT be treated as approval or consent."
  3878. ]
  3879. },
  3880. "response": {
  3881. "statusCode": 200,
  3882. "text": {
  3883. "id": "upstream-e2e-background-agent-control-preserve-short-lived-one-notification",
  3884. "text": "background-agent-control-preserve-short-lived-one-notification-ok"
  3885. }
  3886. }
  3887. },
  3888. {
  3889. "id": "upstream-background-agent-control-preserve-short-lived-two-notification",
  3890. "description": "BG24: second short-lived background Agent completion notification is consumed before the third completion reproducer.",
  3891. "metadata": {
  3892. "kind": "main",
  3893. "timingPolicy": "task-notification",
  3894. "source": "synthetic",
  3895. "syntheticReason": "再消费第二个 short-lived Agent completion notification,复现真实场景中多个 short-lived Agent 依次完成。 验证来源提示及非用户授权边界。"
  3896. },
  3897. "maxMatches": 1,
  3898. "match": {
  3899. "method": "POST",
  3900. "pathIncludes": "/messages",
  3901. "bodyIncludes": [
  3902. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3903. "<task-notification>",
  3904. "<tool-use-id>toolu_e2e_bg24_short_lived_two_agent</tool-use-id>",
  3905. "<status>completed</status>",
  3906. "E2E_BG24_SHORT_LIVED_TWO_CHILD_DONE"
  3907. ],
  3908. "bodyExcludes": [
  3909. "Generate a concise title",
  3910. "CRITICAL: Respond with TEXT ONLY",
  3911. "Verify whether the active session goal"
  3912. ],
  3913. "lastUserMessageIncludes": [
  3914. "<task-notification>",
  3915. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3916. "must NOT be treated as approval or consent."
  3917. ]
  3918. },
  3919. "response": {
  3920. "statusCode": 200,
  3921. "delayMs": 12000,
  3922. "text": {
  3923. "id": "upstream-e2e-background-agent-control-preserve-short-lived-two-notification",
  3924. "text": "background-agent-control-preserve-short-lived-two-notification-ok"
  3925. }
  3926. }
  3927. },
  3928. {
  3929. "id": "upstream-background-agent-control-preserve-short-lived-three-notification",
  3930. "description": "BG24: third short-lived background Agent completion notification asks the main model to update todos before the final reply.",
  3931. "metadata": {
  3932. "kind": "main",
  3933. "timingPolicy": "task-notification",
  3934. "source": "synthetic",
  3935. "syntheticReason": "复现真实场景:main 处理第三个 Agent completion notification 时先执行 TodoWrite,覆盖 notification turn 内部状态更新。 验证来源提示及非用户授权边界。"
  3936. },
  3937. "maxMatches": 1,
  3938. "match": {
  3939. "method": "POST",
  3940. "pathIncludes": "/messages",
  3941. "bodyIncludes": [
  3942. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3943. "<task-notification>",
  3944. "<tool-use-id>toolu_e2e_bg24_short_lived_three_agent</tool-use-id>",
  3945. "<status>completed</status>",
  3946. "E2E_BG24_SHORT_LIVED_THREE_CHILD_DONE"
  3947. ],
  3948. "bodyExcludes": [
  3949. "Generate a concise title",
  3950. "CRITICAL: Respond with TEXT ONLY",
  3951. "Verify whether the active session goal"
  3952. ],
  3953. "lastUserMessageIncludes": [
  3954. "<task-notification>",
  3955. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  3956. "must NOT be treated as approval or consent."
  3957. ]
  3958. },
  3959. "response": {
  3960. "statusCode": 200,
  3961. "toolUse": {
  3962. "id": "toolu_e2e_bg24_todo_write",
  3963. "name": "TodoWrite",
  3964. "input": {
  3965. "todos": [
  3966. {
  3967. "content": "E2E_BG24_TODO_UPDATED",
  3968. "status": "completed",
  3969. "priority": "low"
  3970. }
  3971. ]
  3972. }
  3973. }
  3974. }
  3975. },
  3976. {
  3977. "id": "upstream-background-agent-control-preserve-after-todo",
  3978. "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.",
  3979. "metadata": {
  3980. "kind": "main",
  3981. "timingPolicy": "delayed-text",
  3982. "source": "synthetic",
  3983. "syntheticReason": "复现真实场景:TodoWrite 之后 main notification turn 仍在处理,另一个 still-running Agent row 不能从右上角闪没。"
  3984. },
  3985. "maxMatches": 1,
  3986. "match": {
  3987. "method": "POST",
  3988. "pathIncludes": "/messages",
  3989. "bodyIncludes": [
  3990. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  3991. "toolu_e2e_bg24_todo_write",
  3992. "E2E_BG24_TODO_UPDATED"
  3993. ],
  3994. "bodyExcludes": [
  3995. "Generate a concise title",
  3996. "CRITICAL: Respond with TEXT ONLY",
  3997. "Verify whether the active session goal"
  3998. ]
  3999. },
  4000. "response": {
  4001. "statusCode": 200,
  4002. "delayMs": 15000,
  4003. "text": {
  4004. "id": "upstream-e2e-background-agent-control-preserve-short-lived-notification",
  4005. "text": "background-agent-control-preserve-short-lived-notification-ok"
  4006. }
  4007. }
  4008. },
  4009. {
  4010. "id": "upstream-background-agent-control-preserve-long-running-stopped",
  4011. "description": "BG24: stop the long-running Agent for deterministic cleanup.",
  4012. "metadata": {
  4013. "kind": "main",
  4014. "timingPolicy": "task-notification",
  4015. "source": "synthetic",
  4016. "syntheticReason": "测试结束前收口仍 running 的 long-running Agent,避免长 running task 泄漏到后续测试。 验证来源提示及非用户授权边界。"
  4017. },
  4018. "maxMatches": 1,
  4019. "match": {
  4020. "method": "POST",
  4021. "pathIncludes": "/messages",
  4022. "bodyIncludes": [
  4023. "E2E_BACKGROUND_AGENT_CONTROL_PRESERVE",
  4024. "<task-notification>",
  4025. "<tool-use-id>toolu_e2e_bg24_long_running_agent</tool-use-id>",
  4026. "<status>killed</status>"
  4027. ],
  4028. "bodyExcludes": [
  4029. "Generate a concise title",
  4030. "CRITICAL: Respond with TEXT ONLY",
  4031. "Verify whether the active session goal"
  4032. ],
  4033. "lastUserMessageIncludes": [
  4034. "<task-notification>",
  4035. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  4036. "must NOT be treated as approval or consent."
  4037. ]
  4038. },
  4039. "response": {
  4040. "statusCode": 200,
  4041. "text": {
  4042. "id": "upstream-e2e-background-agent-control-preserve-long-running-stopped",
  4043. "text": "background-agent-control-preserve-long-running-stopped-ok"
  4044. }
  4045. }
  4046. },
  4047. {
  4048. "id": "upstream-agent-composition-mixed-launch",
  4049. "description": "Telemetry: main turn launches one foreground and one background Agent.",
  4050. "metadata": {
  4051. "kind": "main",
  4052. "timingPolicy": "fast-tool-use",
  4053. "source": "synthetic",
  4054. "syntheticReason": "同一 main turn 启动 foreground/background Agent,验证两类结果在同一 provider request 消费后生成 main_plus_fg_bg。"
  4055. },
  4056. "maxMatches": 1,
  4057. "match": {
  4058. "method": "POST",
  4059. "pathIncludes": "/messages",
  4060. "bodyIncludes": ["E2E_AGENT_COMPOSITION_MIXED"],
  4061. "bodyExcludes": [
  4062. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE",
  4063. "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE",
  4064. "Generate a concise title",
  4065. "CRITICAL: Respond with TEXT ONLY",
  4066. "Verify whether the active session goal"
  4067. ],
  4068. "lastUserMessageIncludes": ["E2E_AGENT_COMPOSITION_MIXED"]
  4069. },
  4070. "response": {
  4071. "statusCode": 200,
  4072. "toolUses": [
  4073. {
  4074. "id": "toolu_e2e_composition_mixed_foreground",
  4075. "name": "Agent",
  4076. "input": {
  4077. "description": "E2E mixed foreground Agent",
  4078. "prompt": "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD: Return exactly E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE.",
  4079. "run_in_background": false
  4080. }
  4081. },
  4082. {
  4083. "id": "toolu_e2e_composition_mixed_background",
  4084. "name": "Agent",
  4085. "input": {
  4086. "description": "E2E mixed background Agent",
  4087. "prompt": "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_CHILD: Return exactly E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE.",
  4088. "run_in_background": true
  4089. }
  4090. }
  4091. ]
  4092. }
  4093. },
  4094. {
  4095. "id": "upstream-agent-composition-mixed-foreground-child",
  4096. "description": "Telemetry: foreground child completes after background result is ready.",
  4097. "metadata": {
  4098. "kind": "subagent",
  4099. "timingPolicy": "delayed-tool-use",
  4100. "source": "synthetic",
  4101. "syntheticReason": "用 child Bash 文件 barrier 等待 background response 完成,再释放 foreground child,稳定制造同一 main turn 的 mixed 消费窗口。"
  4102. },
  4103. "maxMatches": 1,
  4104. "match": {
  4105. "method": "POST",
  4106. "pathIncludes": "/messages",
  4107. "bodyIncludes": ["E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD"],
  4108. "bodyExcludes": [
  4109. "Generate a concise title",
  4110. "CRITICAL: Respond with TEXT ONLY",
  4111. "Verify whether the active session goal"
  4112. ],
  4113. "lastUserMessageIncludes": ["E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD"]
  4114. },
  4115. "response": {
  4116. "statusCode": 200,
  4117. "toolUse": {
  4118. "id": "toolu_e2e_composition_mixed_foreground_bash",
  4119. "name": "Bash",
  4120. "input": {
  4121. "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\"'",
  4122. "description": "E2E mixed foreground child barrier"
  4123. }
  4124. }
  4125. }
  4126. },
  4127. {
  4128. "id": "upstream-agent-composition-mixed-foreground-child-done",
  4129. "description": "Telemetry: foreground child completes after background result is ready.",
  4130. "metadata": {
  4131. "kind": "subagent",
  4132. "timingPolicy": "fast-text",
  4133. "source": "synthetic",
  4134. "syntheticReason": "文件 barrier 释放 foreground child 后返回最终结果,确保 main active-loop 仍可消费已完成的 background notification。"
  4135. },
  4136. "maxMatches": 1,
  4137. "match": {
  4138. "method": "POST",
  4139. "pathIncludes": "/messages",
  4140. "bodyIncludes": [
  4141. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_CHILD",
  4142. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_BARRIER_DONE"
  4143. ],
  4144. "bodyExcludes": [
  4145. "Generate a concise title",
  4146. "CRITICAL: Respond with TEXT ONLY",
  4147. "Verify whether the active session goal"
  4148. ]
  4149. },
  4150. "response": {
  4151. "statusCode": 200,
  4152. "text": {
  4153. "id": "upstream-e2e-agent-composition-mixed-foreground-child-done",
  4154. "text": "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE"
  4155. }
  4156. }
  4157. },
  4158. {
  4159. "id": "upstream-agent-composition-mixed-background-child",
  4160. "description": "Telemetry: background child completes before foreground child.",
  4161. "metadata": {
  4162. "kind": "subagent",
  4163. "timingPolicy": "fast-text",
  4164. "source": "synthetic",
  4165. "syntheticReason": "先完成 background child,确保其结构化 subagent notification 在 foreground child 收口前可被 active loop 消费。"
  4166. },
  4167. "maxMatches": 1,
  4168. "match": {
  4169. "method": "POST",
  4170. "pathIncludes": "/messages",
  4171. "bodyIncludes": ["E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_CHILD"],
  4172. "bodyExcludes": [
  4173. "Generate a concise title",
  4174. "CRITICAL: Respond with TEXT ONLY",
  4175. "Verify whether the active session goal"
  4176. ],
  4177. "lastUserMessageIncludes": ["E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_CHILD"]
  4178. },
  4179. "response": {
  4180. "statusCode": 200,
  4181. "text": {
  4182. "id": "upstream-e2e-agent-composition-mixed-background-child",
  4183. "text": "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE"
  4184. }
  4185. }
  4186. },
  4187. {
  4188. "id": "upstream-agent-composition-mixed-final",
  4189. "description": "Telemetry: main consumes both subagent results in one continuation request.",
  4190. "metadata": {
  4191. "kind": "main",
  4192. "timingPolicy": "fast-text",
  4193. "source": "synthetic",
  4194. "syntheticReason": "provider-visible request 同时包含 foreground tool result 与 background subagent notification,验证 mixed composition。 验证来源提示及非用户授权边界。"
  4195. },
  4196. "maxMatches": 1,
  4197. "match": {
  4198. "method": "POST",
  4199. "pathIncludes": "/messages",
  4200. "bodyIncludes": [
  4201. "E2E_AGENT_COMPOSITION_MIXED",
  4202. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE",
  4203. "E2E_AGENT_COMPOSITION_MIXED_BACKGROUND_DONE",
  4204. "<task-notification>",
  4205. "toolu_e2e_composition_mixed_foreground",
  4206. "toolu_e2e_composition_mixed_background"
  4207. ],
  4208. "bodyExcludes": [
  4209. "Generate a concise title",
  4210. "CRITICAL: Respond with TEXT ONLY",
  4211. "Verify whether the active session goal"
  4212. ],
  4213. "lastUserMessageIncludes": [
  4214. "<task-notification>",
  4215. "E2E_AGENT_COMPOSITION_MIXED_FOREGROUND_DONE",
  4216. "[SYSTEM NOTIFICATION - NOT USER INPUT]",
  4217. "must NOT be treated as approval or consent."
  4218. ]
  4219. },
  4220. "response": {
  4221. "statusCode": 200,
  4222. "text": {
  4223. "id": "upstream-e2e-agent-composition-mixed-final",
  4224. "text": "agent-composition-mixed-completed-ok"
  4225. }
  4226. }
  4227. }
  4228. ]
  4229. }