| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- {
- "version": 1,
- "caseName": "conversation-session-native-search-setting",
- "spec": "./test/e2e/conversation-session/tools/conversation-session-native-search-setting.test.ts",
- "fixtures": [
- {
- "id": "nse-enabled-initial-title",
- "description": "增强搜索默认启用 Session 的标题响应。",
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "用首发 marker 隔离标题请求。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_NSE_ENABLED_INITIAL"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-enabled-initial-title",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "{\"title\":\"Native Search Enabled\"}"
- }
- }
- },
- {
- "id": "nse-enabled-initial-call",
- "description": "默认启用 Session 执行真实 native search 版本检查。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定只读 Bash 命令,验证实际 bfs/ugrep/rg 输出。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_NSE_ENABLED_INITIAL"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_e2e_nse_enabled_initial",
- "name": "Bash",
- "input": {
- "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__"
- }
- }
- }
- },
- {
- "id": "nse-enabled-initial-final",
- "description": "默认启用 Session 在真实版本输出后收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "只有 ugrep 与 rg 的真实版本进入 tool result 后才返回终态。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_NSE_ENABLED_INITIAL",
- "toolu_e2e_nse_enabled_initial",
- "ugrep 7.8.4",
- "ripgrep ",
- "__E2E_NSE_DONE__"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_NSE_ENABLED_ACTIVE"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-enabled-initial-final",
- "inputTokens": 96,
- "outputTokens": 8,
- "text": "E2E_NSE_ENABLED_INITIAL_DONE"
- }
- }
- },
- {
- "id": "nse-enabled-active-call",
- "description": "关闭设置后 active Session 再次执行版本检查。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "复用同一只读命令,证明 active runtime 不热更新。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_NSE_ENABLED_ACTIVE"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_e2e_nse_enabled_active",
- "name": "Bash",
- "input": {
- "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__"
- }
- }
- }
- },
- {
- "id": "nse-enabled-active-final",
- "description": "active Session 仍命中 ugrep 后收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "验证设置切换不改写已物化 runtime。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_NSE_ENABLED_ACTIVE",
- "toolu_e2e_nse_enabled_active",
- "ugrep 7.8.4",
- "ripgrep ",
- "__E2E_NSE_DONE__"
- ],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-enabled-active-final",
- "inputTokens": 96,
- "outputTokens": 8,
- "text": "E2E_NSE_ENABLED_ACTIVE_DONE"
- }
- }
- },
- {
- "id": "nse-disabled-new-title",
- "description": "关闭增强搜索后新 Session 的标题响应。",
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "用首发 marker 隔离第二个 Session 的标题请求。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_NSE_DISABLED_NEW"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-disabled-new-title",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "{\"title\":\"Native Search Disabled\"}"
- }
- }
- },
- {
- "id": "nse-disabled-new-call",
- "description": "关闭增强搜索的新 Session 执行 system find/grep 与 rg。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定只读 Bash 命令,验证 find/grep 未被注入且 rg 保持。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_NSE_DISABLED_NEW"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_e2e_nse_disabled_new",
- "name": "Bash",
- "input": {
- "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__"
- }
- }
- }
- },
- {
- "id": "nse-disabled-new-final",
- "description": "system find/grep 与 rg 真实输出后收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "只有非函数 find/grep 和 rg 版本进入 tool result 后才返回终态。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_NSE_DISABLED_NEW",
- "toolu_e2e_nse_disabled_new",
- "find-kind=file",
- "grep-kind=file",
- "__E2E_NSE_FIND_RESULT__",
- "__E2E_NSE_GREP_RESULT__",
- "ripgrep ",
- "__E2E_NSE_DONE__"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_NSE_ENABLED_COLD_RESUME"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-disabled-new-final",
- "inputTokens": 96,
- "outputTokens": 8,
- "text": "E2E_NSE_DISABLED_NEW_DONE"
- }
- }
- },
- {
- "id": "nse-enabled-cold-resume-call",
- "description": "App/Agent 冷重启后恢复旧 Session 并读取最新启用值。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "复用版本检查命令,证明 cold resume 重新物化 runtime。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_NSE_ENABLED_COLD_RESUME"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_e2e_nse_enabled_cold_resume",
- "name": "Bash",
- "input": {
- "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__"
- }
- }
- }
- },
- {
- "id": "nse-enabled-cold-resume-final",
- "description": "cold resume 后重新命中增强搜索并收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "验证 cold resume 使用当前全局设置,不恢复旧 Session 开关快照。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_NSE_ENABLED_COLD_RESUME",
- "toolu_e2e_nse_enabled_cold_resume",
- "ugrep 7.8.4",
- "ripgrep ",
- "__E2E_NSE_DONE__"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_NSE_DISABLED_COLD_RESUME"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-enabled-cold-resume-final",
- "inputTokens": 96,
- "outputTokens": 8,
- "text": "E2E_NSE_ENABLED_COLD_RESUME_DONE"
- }
- }
- },
- {
- "id": "nse-disabled-cold-resume-call",
- "description": "再次冷重启后恢复旧 Session 并读取最新关闭值。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "复用 system find/grep 命令,证明 cold resume 的反向设置切换。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_NSE_DISABLED_COLD_RESUME"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_e2e_nse_disabled_cold_resume",
- "name": "Bash",
- "input": {
- "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__"
- }
- }
- }
- },
- {
- "id": "nse-disabled-cold-resume-final",
- "description": "反向 cold resume 后 system find/grep 与 rg 输出收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "验证 cold resume 使用当前关闭值,不恢复上一轮启用 runtime。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_NSE_DISABLED_COLD_RESUME",
- "toolu_e2e_nse_disabled_cold_resume",
- "find-kind=file",
- "grep-kind=file",
- "__E2E_NSE_FIND_RESULT__",
- "__E2E_NSE_GREP_RESULT__",
- "ripgrep ",
- "__E2E_NSE_DONE__"
- ],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "nse-disabled-cold-resume-final",
- "inputTokens": 96,
- "outputTokens": 8,
- "text": "E2E_NSE_DISABLED_COLD_RESUME_DONE"
- }
- }
- }
- ]
- }
|