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

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