conversation-session-built-in-subagent-model-overrides.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-built-in-subagent-model-overrides",
  4. "spec": "./test/e2e/conversation-session/subagents/conversation-session-built-in-subagent-model-overrides.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "built-in-subagent-model-overrides-title",
  8. "description": "内置 subagent 模型覆盖 case 内的标题生成固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是本 case 的产品语义,只需要稳定返回,防止标题请求误命中业务 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-built-in-subagent-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Built-in Subagent Models\\\"}\"}],\"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": "built-in-subagent-general-parent-tool",
  31. "description": "父 agent 首轮请求返回携带历史 model 字段的 general-purpose Agent tool_use。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "核心验证点是 Agent schema 已不声明 model,历史版本额外参数不能覆盖内置 general-purpose profile;父请求只需要稳定触发 legacy shape 的 Agent tool_use。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_BUILT_IN_SUBAGENT_GENERAL_PARENT"],
  43. "bodyIncludes": ["E2E_BUILT_IN_SUBAGENT_GENERAL_PARENT", "general-purpose"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "toolUse": {
  49. "id": "toolu_e2e_built_in_general_model_override",
  50. "name": "Agent",
  51. "input": {
  52. "description": "Run the built-in general-purpose agent",
  53. "model": "haiku",
  54. "prompt": "E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD: Reply with exactly \"E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD_OK\" and no other text.",
  55. "subagent_type": "general-purpose"
  56. }
  57. }
  58. }
  59. },
  60. {
  61. "id": "built-in-subagent-general-child",
  62. "description": "general-purpose child subagent 固定回复。",
  63. "metadata": {
  64. "kind": "main",
  65. "timingPolicy": "fast-text",
  66. "source": "synthetic",
  67. "syntheticReason": "child 请求本身是本 case 的验证证据;响应只需稳定完成并返回子结果 token。"
  68. },
  69. "maxMatches": 1,
  70. "match": {
  71. "method": "POST",
  72. "pathIncludes": "/messages",
  73. "lastUserMessageIncludes": ["E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD"],
  74. "bodyIncludes": ["E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD"],
  75. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  76. },
  77. "response": {
  78. "statusCode": 200,
  79. "statusMessage": "OK",
  80. "text": {
  81. "id": "upstream-e2e-built-in-general-child",
  82. "inputTokens": 128,
  83. "outputTokens": 16,
  84. "text": "E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD_OK"
  85. }
  86. }
  87. },
  88. {
  89. "id": "built-in-subagent-general-parent-final",
  90. "description": "父 agent 收到 general-purpose child tool_result 后的固定最终回复。",
  91. "metadata": {
  92. "kind": "main",
  93. "timingPolicy": "fast-text",
  94. "source": "synthetic",
  95. "syntheticReason": "最终回复只用于证明 Agent tool_result 被父会话继续消费并回到 idle。"
  96. },
  97. "maxMatches": 1,
  98. "match": {
  99. "method": "POST",
  100. "pathIncludes": "/messages",
  101. "bodyIncludes": [
  102. "E2E_BUILT_IN_SUBAGENT_GENERAL_PARENT",
  103. "E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD_OK"
  104. ],
  105. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  106. },
  107. "response": {
  108. "statusCode": 200,
  109. "statusMessage": "OK",
  110. "text": {
  111. "id": "upstream-e2e-built-in-general-parent-final",
  112. "inputTokens": 160,
  113. "outputTokens": 12,
  114. "text": "built-in-general-subagent-model-override-done"
  115. }
  116. }
  117. },
  118. {
  119. "id": "built-in-subagent-model-overrides-cold-auto-compact",
  120. "description": "真实冷启动恢复父会话后、执行 Explore 场景前的自动 compact sidecar。",
  121. "metadata": {
  122. "kind": "main",
  123. "timingPolicy": "fast-text",
  124. "source": "synthetic",
  125. "syntheticReason": "进程级冷启动会恢复完整父会话,并在下一轮前触发自动 compact;固定摘要避免 sidecar 阻断目标链路。"
  126. },
  127. "maxMatches": 1,
  128. "match": {
  129. "method": "POST",
  130. "pathIncludes": "/messages",
  131. "bodyIncludes": [
  132. "E2E_BUILT_IN_SUBAGENT_GENERAL_PARENT",
  133. "E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD_OK",
  134. "built-in-general-subagent-model-override-done",
  135. "CRITICAL: Respond with TEXT ONLY",
  136. "\"stream\":true"
  137. ],
  138. "bodyExcludes": ["Generate a concise title", "E2E_BUILT_IN_SUBAGENT_EXPLORE_PARENT"]
  139. },
  140. "response": {
  141. "statusCode": 200,
  142. "text": {
  143. "id": "upstream-e2e-built-in-subagent-cold-auto-compact",
  144. "inputTokens": 256,
  145. "outputTokens": 32,
  146. "text": "<summary>The E2E_BUILT_IN_SUBAGENT_GENERAL_PARENT scenario completed after E2E_BUILT_IN_SUBAGENT_GENERAL_CHILD_OK with built-in-general-subagent-model-override-done. Continue with the next user request.</summary>"
  147. }
  148. }
  149. },
  150. {
  151. "id": "built-in-subagent-explore-parent-tool",
  152. "description": "父 agent 首轮请求返回 Explore Agent tool_use。",
  153. "metadata": {
  154. "kind": "main",
  155. "timingPolicy": "fast-text",
  156. "source": "synthetic",
  157. "syntheticReason": "核心验证点是内置 Explore child request 使用覆盖模型且工具面按 effective model 计算;父请求只需要稳定触发 Agent tool_use。"
  158. },
  159. "maxMatches": 1,
  160. "match": {
  161. "method": "POST",
  162. "pathIncludes": "/messages",
  163. "lastUserMessageIncludes": ["E2E_BUILT_IN_SUBAGENT_EXPLORE_PARENT"],
  164. "bodyIncludes": ["E2E_BUILT_IN_SUBAGENT_EXPLORE_PARENT", "Explore"],
  165. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  166. },
  167. "response": {
  168. "statusCode": 200,
  169. "toolUse": {
  170. "id": "toolu_e2e_built_in_explore_model_override",
  171. "name": "Agent",
  172. "input": {
  173. "description": "Run the built-in Explore agent",
  174. "prompt": "E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD: Reply with exactly \"E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD_OK\" and no other text.",
  175. "subagent_type": "Explore"
  176. }
  177. }
  178. }
  179. },
  180. {
  181. "id": "built-in-subagent-explore-child",
  182. "description": "Explore child subagent 固定回复。",
  183. "metadata": {
  184. "kind": "main",
  185. "timingPolicy": "fast-text",
  186. "source": "synthetic",
  187. "syntheticReason": "child 请求本身是本 case 的验证证据;响应只需稳定完成并返回子结果 token。"
  188. },
  189. "maxMatches": 1,
  190. "match": {
  191. "method": "POST",
  192. "pathIncludes": "/messages",
  193. "lastUserMessageIncludes": ["E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD"],
  194. "bodyIncludes": ["E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD"],
  195. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  196. },
  197. "response": {
  198. "statusCode": 200,
  199. "statusMessage": "OK",
  200. "text": {
  201. "id": "upstream-e2e-built-in-explore-child",
  202. "inputTokens": 128,
  203. "outputTokens": 16,
  204. "text": "E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD_OK"
  205. }
  206. }
  207. },
  208. {
  209. "id": "built-in-subagent-model-overrides-explore-auto-compact",
  210. "description": "Explore child 完成后、父 continuation 前的自动 compact sidecar。",
  211. "metadata": {
  212. "kind": "main",
  213. "timingPolicy": "fast-text",
  214. "source": "synthetic",
  215. "syntheticReason": "完整 E2E system prompt 会让 Explore turn 在消费 child tool_result 前再次触发自动 compact;固定摘要以保留当前请求语义。"
  216. },
  217. "maxMatches": 1,
  218. "match": {
  219. "method": "POST",
  220. "pathIncludes": "/messages",
  221. "bodyIncludes": [
  222. "E2E_BUILT_IN_SUBAGENT_EXPLORE_PARENT",
  223. "built-in-explore-subagent-model-override-done",
  224. "CRITICAL: Respond with TEXT ONLY",
  225. "\"stream\":true"
  226. ],
  227. "bodyExcludes": ["Generate a concise title"]
  228. },
  229. "response": {
  230. "statusCode": 200,
  231. "text": {
  232. "id": "upstream-e2e-built-in-subagent-explore-auto-compact",
  233. "inputTokens": 256,
  234. "outputTokens": 32,
  235. "text": "<summary>The current E2E_BUILT_IN_SUBAGENT_EXPLORE_PARENT request must run the Explore agent, consume E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD_OK, and finish with built-in-explore-subagent-model-override-done.</summary>"
  236. }
  237. }
  238. },
  239. {
  240. "id": "built-in-subagent-explore-parent-final",
  241. "description": "父 agent 收到 Explore child tool_result 后的固定最终回复。",
  242. "metadata": {
  243. "kind": "main",
  244. "timingPolicy": "fast-text",
  245. "source": "synthetic",
  246. "syntheticReason": "最终回复只用于证明 Agent tool_result 被父会话继续消费并回到 idle。"
  247. },
  248. "maxMatches": 1,
  249. "match": {
  250. "method": "POST",
  251. "pathIncludes": "/messages",
  252. "bodyIncludes": [
  253. "E2E_BUILT_IN_SUBAGENT_EXPLORE_PARENT",
  254. "E2E_BUILT_IN_SUBAGENT_EXPLORE_CHILD_OK"
  255. ],
  256. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  257. },
  258. "response": {
  259. "statusCode": 200,
  260. "statusMessage": "OK",
  261. "text": {
  262. "id": "upstream-e2e-built-in-explore-parent-final",
  263. "inputTokens": 160,
  264. "outputTokens": 12,
  265. "text": "built-in-explore-subagent-model-override-done"
  266. }
  267. }
  268. },
  269. {
  270. "id": "custom-subagent-reasoning-parent-tool",
  271. "description": "父 agent 首轮请求触发 custom reasoning agent。",
  272. "metadata": {
  273. "kind": "main",
  274. "timingPolicy": "fast-text",
  275. "source": "synthetic",
  276. "syntheticReason": "父请求只需稳定触发 Settings 已保存的 custom agent,核心证据由后续 child provider request 提供。"
  277. },
  278. "maxMatches": 1,
  279. "match": {
  280. "method": "POST",
  281. "pathIncludes": "/messages",
  282. "lastUserMessageIncludes": ["E2E_CUSTOM_SUBAGENT_REASONING_PARENT"],
  283. "bodyIncludes": ["E2E_CUSTOM_SUBAGENT_REASONING_PARENT", "e2e-reasoning-reviewer"],
  284. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  285. },
  286. "response": {
  287. "statusCode": 200,
  288. "toolUse": {
  289. "id": "toolu_e2e_custom_subagent_reasoning",
  290. "name": "Agent",
  291. "input": {
  292. "description": "Run the custom reasoning reviewer",
  293. "prompt": "E2E_CUSTOM_SUBAGENT_REASONING_CHILD: Reply with exactly \"E2E_CUSTOM_SUBAGENT_REASONING_CHILD_OK\" and no other text.",
  294. "subagent_type": "e2e-reasoning-reviewer"
  295. }
  296. }
  297. }
  298. },
  299. {
  300. "id": "custom-subagent-reasoning-child",
  301. "description": "custom reasoning child subagent 固定回复。",
  302. "metadata": {
  303. "kind": "main",
  304. "timingPolicy": "fast-text",
  305. "source": "synthetic",
  306. "syntheticReason": "child 请求用于验证 custom Markdown 中 model 与 thoughtLevel 经冷启动后实际进入 provider request。"
  307. },
  308. "maxMatches": 1,
  309. "match": {
  310. "method": "POST",
  311. "pathIncludes": "/messages",
  312. "lastUserMessageIncludes": ["E2E_CUSTOM_SUBAGENT_REASONING_CHILD"],
  313. "bodyIncludes": ["E2E_CUSTOM_SUBAGENT_REASONING_CHILD"],
  314. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  315. },
  316. "response": {
  317. "statusCode": 200,
  318. "statusMessage": "OK",
  319. "text": {
  320. "id": "upstream-e2e-custom-subagent-reasoning-child",
  321. "inputTokens": 128,
  322. "outputTokens": 16,
  323. "text": "E2E_CUSTOM_SUBAGENT_REASONING_CHILD_OK"
  324. }
  325. }
  326. },
  327. {
  328. "id": "custom-subagent-reasoning-parent-final",
  329. "description": "父 agent 收到 custom child tool_result 后的固定最终回复。",
  330. "metadata": {
  331. "kind": "main",
  332. "timingPolicy": "fast-text",
  333. "source": "synthetic",
  334. "syntheticReason": "最终回复只用于证明 custom Agent tool_result 被父会话继续消费并回到 idle。"
  335. },
  336. "maxMatches": 1,
  337. "match": {
  338. "method": "POST",
  339. "pathIncludes": "/messages",
  340. "bodyIncludes": [
  341. "E2E_CUSTOM_SUBAGENT_REASONING_PARENT",
  342. "E2E_CUSTOM_SUBAGENT_REASONING_CHILD_OK"
  343. ],
  344. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  345. },
  346. "response": {
  347. "statusCode": 200,
  348. "statusMessage": "OK",
  349. "text": {
  350. "id": "upstream-e2e-custom-subagent-reasoning-parent-final",
  351. "inputTokens": 160,
  352. "outputTokens": 12,
  353. "text": "custom-subagent-reasoning-override-done"
  354. }
  355. }
  356. }
  357. ]
  358. }