agent-plugin-discovery.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. {
  2. "version": 1,
  3. "caseName": "agent-plugin-discovery",
  4. "spec": "./test/e2e/plugins/marketplace/agent-plugin-discovery.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "apd-disabled",
  8. "description": "插件推荐关闭时验证模型实际工具列表为空。",
  9. "metadata": {
  10. "kind": "main",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "Validate that the disabled setting removes both plugin tools from actual model requests, including explicit plugin requests."
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "lastUserMessageIncludes": ["E2E_PLUGIN_RECOMMENDATIONS_DISABLED"],
  19. "bodyExcludes": ["Generate a concise title"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "text": "插件推荐已关闭,可在设置页手动安装。\n\nE2E_PLUGIN_RECOMMENDATIONS_DISABLED_DONE"
  24. }
  25. },
  26. {
  27. "id": "apd-title",
  28. "description": "回复标题请求,使自动重载能够观察到真实的后台工作收尾。",
  29. "metadata": {
  30. "kind": "common",
  31. "source": "synthetic",
  32. "timingPolicy": "fast-text",
  33. "syntheticReason": "标题生成属于本 session 的后台工作;缺少回放会产生 HTTP 500 并持续重试,遮住重载验收。"
  34. },
  35. "match": {
  36. "method": "POST",
  37. "pathIncludes": "/messages",
  38. "bodyIncludes": ["Generate a concise title"]
  39. },
  40. "response": {
  41. "statusCode": 200,
  42. "statusMessage": "OK",
  43. "headers": {
  44. "content-type": "application/json; charset=utf-8"
  45. },
  46. "body": "{\"id\": \"upstream-e2e-title-fixture\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"deepseek-v4-flash\", \"content\": [{\"type\": \"text\", \"text\": \"{\\\"title\\\": \\\"ZIP 插件任务\\\"}\"}], \"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\"}}"
  47. }
  48. },
  49. {
  50. "id": "apd-skip-search",
  51. "description": "Agent plugin discovery search",
  52. "metadata": {
  53. "kind": "main",
  54. "timingPolicy": "fast-text",
  55. "source": "synthetic",
  56. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  57. },
  58. "match": {
  59. "method": "POST",
  60. "pathIncludes": "/messages",
  61. "bodyIncludes": ["E2E_AGENT_PLUGIN_SKIP"],
  62. "bodyExcludes": [
  63. "Generate a concise title",
  64. "CRITICAL: Respond with TEXT ONLY",
  65. "toolu_apd_skip_search",
  66. "toolu_apd_skip_suggest"
  67. ]
  68. },
  69. "maxMatches": 1,
  70. "response": {
  71. "statusCode": 200,
  72. "toolUse": {
  73. "id": "toolu_apd_skip_search",
  74. "name": "SearchPlugins",
  75. "input": {
  76. "query": "E2E CDN zip"
  77. }
  78. }
  79. }
  80. },
  81. {
  82. "id": "apd-skip-suggest",
  83. "description": "Agent plugin discovery suggest",
  84. "metadata": {
  85. "kind": "main",
  86. "timingPolicy": "fast-text",
  87. "source": "synthetic",
  88. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  89. },
  90. "match": {
  91. "method": "POST",
  92. "pathIncludes": "/messages",
  93. "bodyIncludes": [
  94. "E2E_AGENT_PLUGIN_SKIP",
  95. "toolu_apd_skip_search",
  96. "e2e-cdn-zip-plugin@zcode-plugins-official"
  97. ],
  98. "bodyExcludes": [
  99. "Generate a concise title",
  100. "CRITICAL: Respond with TEXT ONLY",
  101. "toolu_apd_skip_suggest"
  102. ]
  103. },
  104. "maxMatches": 1,
  105. "response": {
  106. "statusCode": 200,
  107. "toolUse": {
  108. "id": "toolu_apd_skip_suggest",
  109. "name": "SuggestPluginInstall",
  110. "input": {
  111. "pluginId": "e2e-cdn-zip-plugin@zcode-plugins-official",
  112. "reason": "这个官方插件可以协助处理你当前的 ZIP 归档任务。"
  113. }
  114. }
  115. }
  116. },
  117. {
  118. "id": "apd-skip-complete",
  119. "description": "Agent plugin discovery complete",
  120. "metadata": {
  121. "kind": "main",
  122. "timingPolicy": "fast-text",
  123. "source": "synthetic",
  124. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  125. },
  126. "match": {
  127. "method": "POST",
  128. "pathIncludes": "/messages",
  129. "bodyIncludes": ["E2E_AGENT_PLUGIN_SKIP", "toolu_apd_skip_suggest", "skipped"],
  130. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  131. },
  132. "maxMatches": 1,
  133. "response": {
  134. "statusCode": 200,
  135. "text": "已跳过,未安装插件。我会继续使用现有能力处理你的任务。\n\nE2E_AGENT_PLUGIN_SKIPPED"
  136. }
  137. },
  138. {
  139. "id": "apd-install-search",
  140. "description": "Agent plugin discovery search",
  141. "metadata": {
  142. "kind": "main",
  143. "timingPolicy": "fast-text",
  144. "source": "synthetic",
  145. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  146. },
  147. "match": {
  148. "method": "POST",
  149. "pathIncludes": "/messages",
  150. "bodyIncludes": ["E2E_AGENT_PLUGIN_INSTALL"],
  151. "bodyExcludes": [
  152. "Generate a concise title",
  153. "CRITICAL: Respond with TEXT ONLY",
  154. "toolu_apd_install_search",
  155. "toolu_apd_install_suggest"
  156. ]
  157. },
  158. "maxMatches": 1,
  159. "response": {
  160. "statusCode": 200,
  161. "toolUse": {
  162. "id": "toolu_apd_install_search",
  163. "name": "SearchPlugins",
  164. "input": {
  165. "query": "E2E CDN zip"
  166. }
  167. }
  168. }
  169. },
  170. {
  171. "id": "apd-install-suggest",
  172. "description": "Agent plugin discovery suggest",
  173. "metadata": {
  174. "kind": "main",
  175. "timingPolicy": "fast-text",
  176. "source": "synthetic",
  177. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  178. },
  179. "match": {
  180. "method": "POST",
  181. "pathIncludes": "/messages",
  182. "bodyIncludes": [
  183. "E2E_AGENT_PLUGIN_INSTALL",
  184. "toolu_apd_install_search",
  185. "e2e-cdn-zip-plugin@zcode-plugins-official"
  186. ],
  187. "bodyExcludes": [
  188. "Generate a concise title",
  189. "CRITICAL: Respond with TEXT ONLY",
  190. "toolu_apd_install_suggest"
  191. ]
  192. },
  193. "maxMatches": 1,
  194. "response": {
  195. "statusCode": 200,
  196. "toolUse": {
  197. "id": "toolu_apd_install_suggest",
  198. "name": "SuggestPluginInstall",
  199. "input": {
  200. "pluginId": "e2e-cdn-zip-plugin@zcode-plugins-official",
  201. "reason": "这个官方插件可以协助处理你当前的 ZIP 归档任务。"
  202. }
  203. }
  204. }
  205. },
  206. {
  207. "id": "apd-install-complete",
  208. "description": "Agent plugin discovery complete",
  209. "metadata": {
  210. "kind": "main",
  211. "timingPolicy": "fast-text",
  212. "source": "synthetic",
  213. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  214. },
  215. "match": {
  216. "method": "POST",
  217. "pathIncludes": "/messages",
  218. "bodyIncludes": [
  219. "E2E_AGENT_PLUGIN_INSTALL",
  220. "toolu_apd_install_suggest",
  221. "refreshRequired",
  222. "Plugin is installed."
  223. ],
  224. "bodyExcludes": [
  225. "Generate a concise title",
  226. "CRITICAL: Respond with TEXT ONLY",
  227. "Do not use the new capability",
  228. "toolu_apd_same_turn_skill"
  229. ]
  230. },
  231. "maxMatches": 1,
  232. "response": {
  233. "statusCode": 200,
  234. "toolUse": {
  235. "name": "Skill",
  236. "id": "toolu_apd_same_turn_skill",
  237. "input": {
  238. "skill": "zip-skill"
  239. }
  240. }
  241. }
  242. },
  243. {
  244. "id": "apd-install-same-turn-skill-loaded",
  245. "description": "Installed Skill body is loaded in the same turn before reload",
  246. "metadata": {
  247. "kind": "main",
  248. "timingPolicy": "fast-text",
  249. "source": "synthetic",
  250. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  251. },
  252. "match": {
  253. "method": "POST",
  254. "pathIncludes": "/messages",
  255. "bodyIncludes": [
  256. "E2E_AGENT_PLUGIN_INSTALL",
  257. "toolu_apd_same_turn_skill",
  258. "Use this skill to prove CDN zip plugin discovery."
  259. ],
  260. "bodyExcludes": [
  261. "Generate a concise title",
  262. "CRITICAL: Respond with TEXT ONLY",
  263. "E2E_USE_ZIP_SKILL"
  264. ]
  265. },
  266. "maxMatches": 1,
  267. "response": {
  268. "statusCode": 200,
  269. "text": "插件已安装,本轮已直接使用 zip-skill。E2E_AGENT_PLUGIN_INSTALLED_REFRESH_REQUIRED"
  270. }
  271. },
  272. {
  273. "id": "apd-use-installed-skill",
  274. "description": "Use the installed Skill in the reloaded session",
  275. "metadata": {
  276. "kind": "main",
  277. "timingPolicy": "fast-text",
  278. "source": "synthetic",
  279. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  280. },
  281. "match": {
  282. "method": "POST",
  283. "pathIncludes": "/messages",
  284. "bodyIncludes": ["E2E_USE_ZIP_SKILL"],
  285. "bodyExcludes": [
  286. "Generate a concise title",
  287. "CRITICAL: Respond with TEXT ONLY",
  288. "toolu_apd_installed_skill"
  289. ]
  290. },
  291. "maxMatches": 1,
  292. "response": {
  293. "statusCode": 200,
  294. "toolUse": {
  295. "name": "Skill",
  296. "id": "toolu_apd_installed_skill",
  297. "input": {
  298. "skill": "zip-skill"
  299. }
  300. }
  301. }
  302. },
  303. {
  304. "id": "apd-loaded-installed-skill",
  305. "description": "Verify the ZIP Skill body was really loaded",
  306. "metadata": {
  307. "kind": "main",
  308. "timingPolicy": "fast-text",
  309. "source": "synthetic",
  310. "syntheticReason": "Verify real tool, confirmation, and installation plumbing; does not measure model recommendation quality."
  311. },
  312. "match": {
  313. "method": "POST",
  314. "pathIncludes": "/messages",
  315. "bodyIncludes": [
  316. "E2E_USE_ZIP_SKILL",
  317. "toolu_apd_installed_skill",
  318. "Use this skill to prove CDN zip plugin discovery."
  319. ],
  320. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  321. },
  322. "maxMatches": 1,
  323. "response": {
  324. "statusCode": 200,
  325. "text": "E2E_LOADED_INSTALLED_SKILL"
  326. }
  327. }
  328. ]
  329. }