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

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