conversation-session-native-search-setting.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-native-search-setting",
  4. "spec": "./test/e2e/conversation-session/tools/conversation-session-native-search-setting.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "nse-enabled-initial-title",
  8. "description": "增强搜索默认启用 Session 的标题响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "用首发 marker 隔离标题请求。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_NSE_ENABLED_INITIAL"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "nse-enabled-initial-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"Native Search Enabled\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "nse-enabled-initial-call",
  32. "description": "默认启用 Session 执行真实 native search 版本检查。",
  33. "metadata": {
  34. "kind": "main",
  35. "source": "synthetic",
  36. "timingPolicy": "fast-text",
  37. "syntheticReason": "固定只读 Bash 命令,验证实际 bfs/ugrep/rg 输出。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_NSE_ENABLED_INITIAL"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "toolUse": {
  48. "id": "toolu_e2e_nse_enabled_initial",
  49. "name": "Bash",
  50. "input": {
  51. "command": "if typeset -f find >/dev/null 2>&1; then printf 'find-kind=function\\n'; else printf 'find-kind=file\\n'; fi\nif typeset -f grep >/dev/null 2>&1; then printf 'grep-kind=function\\n'; else printf 'grep-kind=file\\n'; fi\nfind --version\ngrep --version\nrg --version\nprintf '%s\\n' __E2E_NSE_DONE__"
  52. }
  53. }
  54. }
  55. },
  56. {
  57. "id": "nse-enabled-initial-final",
  58. "description": "默认启用 Session 在真实版本输出后收口。",
  59. "metadata": {
  60. "kind": "main",
  61. "source": "synthetic",
  62. "timingPolicy": "fast-text",
  63. "syntheticReason": "只有 ugrep 与 rg 的真实版本进入 tool result 后才返回终态。"
  64. },
  65. "match": {
  66. "method": "POST",
  67. "pathIncludes": "/messages",
  68. "bodyIncludes": [
  69. "E2E_NSE_ENABLED_INITIAL",
  70. "toolu_e2e_nse_enabled_initial",
  71. "ugrep 7.8.4",
  72. "ripgrep ",
  73. "__E2E_NSE_DONE__"
  74. ],
  75. "bodyExcludes": [
  76. "Generate a concise title",
  77. "CRITICAL: Respond with TEXT ONLY",
  78. "E2E_NSE_ENABLED_ACTIVE"
  79. ]
  80. },
  81. "response": {
  82. "statusCode": 200,
  83. "text": {
  84. "id": "nse-enabled-initial-final",
  85. "inputTokens": 96,
  86. "outputTokens": 8,
  87. "text": "E2E_NSE_ENABLED_INITIAL_DONE"
  88. }
  89. }
  90. },
  91. {
  92. "id": "nse-enabled-active-call",
  93. "description": "关闭设置后 active Session 再次执行版本检查。",
  94. "metadata": {
  95. "kind": "main",
  96. "source": "synthetic",
  97. "timingPolicy": "fast-text",
  98. "syntheticReason": "复用同一只读命令,证明 active runtime 不热更新。"
  99. },
  100. "match": {
  101. "method": "POST",
  102. "pathIncludes": "/messages",
  103. "lastUserMessageIncludes": ["E2E_NSE_ENABLED_ACTIVE"],
  104. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  105. },
  106. "response": {
  107. "statusCode": 200,
  108. "toolUse": {
  109. "id": "toolu_e2e_nse_enabled_active",
  110. "name": "Bash",
  111. "input": {
  112. "command": "if typeset -f find >/dev/null 2>&1; then printf 'find-kind=function\\n'; else printf 'find-kind=file\\n'; fi\nif typeset -f grep >/dev/null 2>&1; then printf 'grep-kind=function\\n'; else printf 'grep-kind=file\\n'; fi\nfind --version\ngrep --version\nrg --version\nprintf '%s\\n' __E2E_NSE_DONE__"
  113. }
  114. }
  115. }
  116. },
  117. {
  118. "id": "nse-enabled-active-final",
  119. "description": "active Session 仍命中 ugrep 后收口。",
  120. "metadata": {
  121. "kind": "main",
  122. "source": "synthetic",
  123. "timingPolicy": "fast-text",
  124. "syntheticReason": "验证设置切换不改写已物化 runtime。"
  125. },
  126. "match": {
  127. "method": "POST",
  128. "pathIncludes": "/messages",
  129. "bodyIncludes": [
  130. "E2E_NSE_ENABLED_ACTIVE",
  131. "toolu_e2e_nse_enabled_active",
  132. "ugrep 7.8.4",
  133. "ripgrep ",
  134. "__E2E_NSE_DONE__"
  135. ],
  136. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  137. },
  138. "response": {
  139. "statusCode": 200,
  140. "text": {
  141. "id": "nse-enabled-active-final",
  142. "inputTokens": 96,
  143. "outputTokens": 8,
  144. "text": "E2E_NSE_ENABLED_ACTIVE_DONE"
  145. }
  146. }
  147. },
  148. {
  149. "id": "nse-disabled-new-title",
  150. "description": "关闭增强搜索后新 Session 的标题响应。",
  151. "metadata": {
  152. "kind": "common",
  153. "source": "synthetic",
  154. "timingPolicy": "fast-text",
  155. "syntheticReason": "用首发 marker 隔离第二个 Session 的标题请求。"
  156. },
  157. "match": {
  158. "method": "POST",
  159. "pathIncludes": "/messages",
  160. "bodyIncludes": ["Generate a concise title", "E2E_NSE_DISABLED_NEW"]
  161. },
  162. "response": {
  163. "statusCode": 200,
  164. "text": {
  165. "id": "nse-disabled-new-title",
  166. "inputTokens": 64,
  167. "outputTokens": 8,
  168. "text": "{\"title\":\"Native Search Disabled\"}"
  169. }
  170. }
  171. },
  172. {
  173. "id": "nse-disabled-new-call",
  174. "description": "关闭增强搜索的新 Session 执行 system find/grep 与 rg。",
  175. "metadata": {
  176. "kind": "main",
  177. "source": "synthetic",
  178. "timingPolicy": "fast-text",
  179. "syntheticReason": "固定只读 Bash 命令,验证 find/grep 未被注入且 rg 保持。"
  180. },
  181. "match": {
  182. "method": "POST",
  183. "pathIncludes": "/messages",
  184. "lastUserMessageIncludes": ["E2E_NSE_DISABLED_NEW"],
  185. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  186. },
  187. "response": {
  188. "statusCode": 200,
  189. "toolUse": {
  190. "id": "toolu_e2e_nse_disabled_new",
  191. "name": "Bash",
  192. "input": {
  193. "command": "if typeset -f find >/dev/null 2>&1; then printf 'find-kind=function\\n'; else printf 'find-kind=file\\n'; fi\nif typeset -f grep >/dev/null 2>&1; then printf 'grep-kind=function\\n'; else printf 'grep-kind=file\\n'; fi\nprintf '%s\\n' __E2E_NSE_FIND_RESULT__\nfind . -maxdepth 0 -type d -print\nprintf '%s\\n' __E2E_NSE_GREP_RESULT__\nprintf 'needle\\n' | grep needle\nrg --version\nprintf '%s\\n' __E2E_NSE_DONE__"
  194. }
  195. }
  196. }
  197. },
  198. {
  199. "id": "nse-disabled-new-final",
  200. "description": "system find/grep 与 rg 真实输出后收口。",
  201. "metadata": {
  202. "kind": "main",
  203. "source": "synthetic",
  204. "timingPolicy": "fast-text",
  205. "syntheticReason": "只有非函数 find/grep 和 rg 版本进入 tool result 后才返回终态。"
  206. },
  207. "match": {
  208. "method": "POST",
  209. "pathIncludes": "/messages",
  210. "bodyIncludes": [
  211. "E2E_NSE_DISABLED_NEW",
  212. "toolu_e2e_nse_disabled_new",
  213. "find-kind=file",
  214. "grep-kind=file",
  215. "__E2E_NSE_FIND_RESULT__",
  216. "__E2E_NSE_GREP_RESULT__",
  217. "ripgrep ",
  218. "__E2E_NSE_DONE__"
  219. ],
  220. "bodyExcludes": [
  221. "Generate a concise title",
  222. "CRITICAL: Respond with TEXT ONLY",
  223. "E2E_NSE_ENABLED_COLD_RESUME"
  224. ]
  225. },
  226. "response": {
  227. "statusCode": 200,
  228. "text": {
  229. "id": "nse-disabled-new-final",
  230. "inputTokens": 96,
  231. "outputTokens": 8,
  232. "text": "E2E_NSE_DISABLED_NEW_DONE"
  233. }
  234. }
  235. },
  236. {
  237. "id": "nse-enabled-cold-resume-call",
  238. "description": "App/Agent 冷重启后恢复旧 Session 并读取最新启用值。",
  239. "metadata": {
  240. "kind": "main",
  241. "source": "synthetic",
  242. "timingPolicy": "fast-text",
  243. "syntheticReason": "复用版本检查命令,证明 cold resume 重新物化 runtime。"
  244. },
  245. "match": {
  246. "method": "POST",
  247. "pathIncludes": "/messages",
  248. "lastUserMessageIncludes": ["E2E_NSE_ENABLED_COLD_RESUME"],
  249. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  250. },
  251. "response": {
  252. "statusCode": 200,
  253. "toolUse": {
  254. "id": "toolu_e2e_nse_enabled_cold_resume",
  255. "name": "Bash",
  256. "input": {
  257. "command": "if typeset -f find >/dev/null 2>&1; then printf 'find-kind=function\\n'; else printf 'find-kind=file\\n'; fi\nif typeset -f grep >/dev/null 2>&1; then printf 'grep-kind=function\\n'; else printf 'grep-kind=file\\n'; fi\nfind --version\ngrep --version\nrg --version\nprintf '%s\\n' __E2E_NSE_DONE__"
  258. }
  259. }
  260. }
  261. },
  262. {
  263. "id": "nse-enabled-cold-resume-final",
  264. "description": "cold resume 后重新命中增强搜索并收口。",
  265. "metadata": {
  266. "kind": "main",
  267. "source": "synthetic",
  268. "timingPolicy": "fast-text",
  269. "syntheticReason": "验证 cold resume 使用当前全局设置,不恢复旧 Session 开关快照。"
  270. },
  271. "match": {
  272. "method": "POST",
  273. "pathIncludes": "/messages",
  274. "bodyIncludes": [
  275. "E2E_NSE_ENABLED_COLD_RESUME",
  276. "toolu_e2e_nse_enabled_cold_resume",
  277. "ugrep 7.8.4",
  278. "ripgrep ",
  279. "__E2E_NSE_DONE__"
  280. ],
  281. "bodyExcludes": [
  282. "Generate a concise title",
  283. "CRITICAL: Respond with TEXT ONLY",
  284. "E2E_NSE_DISABLED_COLD_RESUME"
  285. ]
  286. },
  287. "response": {
  288. "statusCode": 200,
  289. "text": {
  290. "id": "nse-enabled-cold-resume-final",
  291. "inputTokens": 96,
  292. "outputTokens": 8,
  293. "text": "E2E_NSE_ENABLED_COLD_RESUME_DONE"
  294. }
  295. }
  296. },
  297. {
  298. "id": "nse-disabled-cold-resume-call",
  299. "description": "再次冷重启后恢复旧 Session 并读取最新关闭值。",
  300. "metadata": {
  301. "kind": "main",
  302. "source": "synthetic",
  303. "timingPolicy": "fast-text",
  304. "syntheticReason": "复用 system find/grep 命令,证明 cold resume 的反向设置切换。"
  305. },
  306. "match": {
  307. "method": "POST",
  308. "pathIncludes": "/messages",
  309. "lastUserMessageIncludes": ["E2E_NSE_DISABLED_COLD_RESUME"],
  310. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  311. },
  312. "response": {
  313. "statusCode": 200,
  314. "toolUse": {
  315. "id": "toolu_e2e_nse_disabled_cold_resume",
  316. "name": "Bash",
  317. "input": {
  318. "command": "if typeset -f find >/dev/null 2>&1; then printf 'find-kind=function\\n'; else printf 'find-kind=file\\n'; fi\nif typeset -f grep >/dev/null 2>&1; then printf 'grep-kind=function\\n'; else printf 'grep-kind=file\\n'; fi\nprintf '%s\\n' __E2E_NSE_FIND_RESULT__\nfind . -maxdepth 0 -type d -print\nprintf '%s\\n' __E2E_NSE_GREP_RESULT__\nprintf 'needle\\n' | grep needle\nrg --version\nprintf '%s\\n' __E2E_NSE_DONE__"
  319. }
  320. }
  321. }
  322. },
  323. {
  324. "id": "nse-disabled-cold-resume-final",
  325. "description": "反向 cold resume 后 system find/grep 与 rg 输出收口。",
  326. "metadata": {
  327. "kind": "main",
  328. "source": "synthetic",
  329. "timingPolicy": "fast-text",
  330. "syntheticReason": "验证 cold resume 使用当前关闭值,不恢复上一轮启用 runtime。"
  331. },
  332. "match": {
  333. "method": "POST",
  334. "pathIncludes": "/messages",
  335. "bodyIncludes": [
  336. "E2E_NSE_DISABLED_COLD_RESUME",
  337. "toolu_e2e_nse_disabled_cold_resume",
  338. "find-kind=file",
  339. "grep-kind=file",
  340. "__E2E_NSE_FIND_RESULT__",
  341. "__E2E_NSE_GREP_RESULT__",
  342. "ripgrep ",
  343. "__E2E_NSE_DONE__"
  344. ],
  345. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  346. },
  347. "response": {
  348. "statusCode": 200,
  349. "text": {
  350. "id": "nse-disabled-cold-resume-final",
  351. "inputTokens": 96,
  352. "outputTokens": 8,
  353. "text": "E2E_NSE_DISABLED_COLD_RESUME_DONE"
  354. }
  355. }
  356. }
  357. ]
  358. }