{ "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" } } } ] }