conversation-session-background-guide-steer.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-background-guide-steer",
  4. "spec": "./test/e2e/conversation-session/conversation-session-background-guide-steer.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-background-guide-steer-agent-tool-call",
  8. "description": "BG20: main agent launches a background Agent before the user sends guide text.",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-tool-use",
  12. "source": "synthetic",
  13. "syntheticReason": "延迟 Agent tool_use 响应,稳定覆盖 background Agent 创建过程中发送 guide 的窗口。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": [
  20. "E2E_BACKGROUND_GUIDE_STEER_LAUNCH"
  21. ],
  22. "bodyExcludes": [
  23. "Async agent launched successfully",
  24. "agentId: agent_",
  25. "Generate a concise title",
  26. "CRITICAL: Respond with TEXT ONLY",
  27. "Verify whether the active session goal"
  28. ],
  29. "lastUserMessageIncludes": [
  30. "E2E_BACKGROUND_GUIDE_STEER_LAUNCH"
  31. ]
  32. },
  33. "response": {
  34. "statusCode": 200,
  35. "delayMs": 5000,
  36. "toolUse": {
  37. "id": "toolu_e2e_background_guide_steer_agent",
  38. "name": "Agent",
  39. "input": {
  40. "description": "E2E background guide steer agent",
  41. "prompt": "E2E_BACKGROUND_GUIDE_STEER_CHILD: Reply exactly E2E_BACKGROUND_GUIDE_STEER_CHILD_DONE.",
  42. "run_in_background": true
  43. }
  44. }
  45. }
  46. },
  47. {
  48. "id": "upstream-background-guide-steer-child-result",
  49. "description": "BG20: child Agent completes after a short delay.",
  50. "metadata": {
  51. "kind": "subagent",
  52. "timingPolicy": "delayed-text",
  53. "source": "synthetic",
  54. "syntheticReason": "延迟 background Agent completion,避免 notification 抢在 launch+guide 合流断言前完成。"
  55. },
  56. "maxMatches": 1,
  57. "match": {
  58. "method": "POST",
  59. "pathIncludes": "/messages",
  60. "bodyIncludes": [
  61. "E2E_BACKGROUND_GUIDE_STEER_CHILD"
  62. ],
  63. "bodyExcludes": [
  64. "Generate a concise title",
  65. "CRITICAL: Respond with TEXT ONLY",
  66. "Verify whether the active session goal"
  67. ],
  68. "lastUserMessageExcludes": ["<task-notification>"],
  69. "lastUserMessageIncludes": [
  70. "E2E_BACKGROUND_GUIDE_STEER_CHILD"
  71. ]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "delayMs": 2500,
  76. "text": {
  77. "id": "upstream-e2e-background-guide-steer-child",
  78. "text": "E2E_BACKGROUND_GUIDE_STEER_CHILD_DONE"
  79. }
  80. }
  81. },
  82. {
  83. "id": "upstream-background-guide-steer-launch-and-guide",
  84. "description": "BG20: parent consumes Agent launch tool result and guide text in the same model request.",
  85. "metadata": {
  86. "kind": "main",
  87. "timingPolicy": "fast-text",
  88. "source": "synthetic",
  89. "syntheticReason": "验证 guide 文本随 background Agent launch tool result 合流,而不是进入普通 future queue。"
  90. },
  91. "maxMatches": 1,
  92. "match": {
  93. "method": "POST",
  94. "pathIncludes": "/messages",
  95. "bodyIncludes": [
  96. "E2E_BACKGROUND_GUIDE_STEER_LAUNCH",
  97. "E2E_BACKGROUND_GUIDE_STEER_MESSAGE",
  98. "Async agent launched successfully"
  99. ],
  100. "bodyExcludes": [
  101. "Generate a concise title",
  102. "CRITICAL: Respond with TEXT ONLY",
  103. "Verify whether the active session goal"
  104. ],
  105. "lastUserMessageExcludes": ["<task-notification>"]
  106. },
  107. "response": {
  108. "statusCode": 200,
  109. "text": {
  110. "id": "upstream-e2e-background-guide-steer-launch-consumed",
  111. "text": "background-guide-steer-launch-consumed-ok"
  112. }
  113. }
  114. },
  115. {
  116. "id": "upstream-background-guide-steer-notification-consumed",
  117. "description": "BG20: parent consumes background Agent completion notification.",
  118. "metadata": {
  119. "kind": "main",
  120. "timingPolicy": "task-notification",
  121. "source": "synthetic",
  122. "syntheticReason": "验证 launch+guide 合流后 background Agent completion notification 仍按标准链路消费。"
  123. },
  124. "maxMatches": 1,
  125. "match": {
  126. "method": "POST",
  127. "pathIncludes": "/messages",
  128. "bodyIncludes": [
  129. "<task-notification>",
  130. "E2E_BACKGROUND_GUIDE_STEER_CHILD_DONE"
  131. ],
  132. "bodyExcludes": [
  133. "Generate a concise title",
  134. "CRITICAL: Respond with TEXT ONLY",
  135. "Verify whether the active session goal"
  136. ],
  137. "lastUserMessageIncludes": [
  138. "<task-notification>"
  139. ]
  140. },
  141. "response": {
  142. "statusCode": 200,
  143. "text": {
  144. "id": "upstream-e2e-background-guide-steer-notification",
  145. "text": "background-guide-steer-notification-consumed-ok"
  146. }
  147. }
  148. }
  149. ]
  150. }