| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- {
- "version": 1,
- "caseName": "conversation-session-stop-tool-results",
- "spec": "./test/e2e/conversation-session/execution/conversation-session-stop-tool-results.test.ts",
- "fixtures": [
- {
- "id": "stop-results-title",
- "description": "本例辅助标题",
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定三个真实 Read:首个成功,后两个由隔离 PreToolUse Hook 挂起;在模型流完成后点击 Stop。只改变首个文件为文本或 PNG,不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_STOP_RESULTS_"]
- },
- "response": {
- "statusCode": 200,
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"msg_upstream_e2e_text\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Stop tool results\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}"
- }
- },
- {
- "id": "stop-results-text-tools",
- "description": "text 真实 Read 批次",
- "metadata": {
- "kind": "synthetic",
- "source": "synthetic",
- "timingPolicy": "controlled-stream",
- "syntheticReason": "固定三个真实 Read:首个成功,后两个由隔离 PreToolUse Hook 挂起;在模型流完成后点击 Stop。只改变首个文件为文本或 PNG,不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_STOP_RESULTS_TEXT_START"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_stop_results_text_1"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_stop_results_text_1",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/conversation-session-stop-tool-results/first.txt"
- }
- },
- {
- "id": "toolu_stop_results_text_2",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/conversation-session-stop-tool-results/blocked-2.txt"
- }
- },
- {
- "id": "toolu_stop_results_text_3",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/conversation-session-stop-tool-results/blocked-3.txt"
- }
- }
- ]
- }
- },
- {
- "id": "stop-results-text-followup",
- "description": "text Stop 后正常续聊",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定三个真实 Read:首个成功,后两个由隔离 PreToolUse Hook 挂起;在模型流完成后点击 Stop。只改变首个文件为文本或 PNG,不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_STOP_RESULTS_TEXT_FOLLOWUP"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "text": "STOP_RESULTS_TEXT_OK",
- "inputTokens": 96,
- "outputTokens": 8
- }
- }
- },
- {
- "id": "stop-results-image-tools",
- "description": "image 真实 Read 批次",
- "metadata": {
- "kind": "synthetic",
- "source": "synthetic",
- "timingPolicy": "controlled-stream",
- "syntheticReason": "固定三个真实 Read:首个成功,后两个由隔离 PreToolUse Hook 挂起;在模型流完成后点击 Stop。只改变首个文件为文本或 PNG,不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_STOP_RESULTS_IMAGE_START"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_stop_results_image_1"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_stop_results_image_1",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/conversation-session-stop-tool-results/first.png"
- }
- },
- {
- "id": "toolu_stop_results_image_2",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/conversation-session-stop-tool-results/blocked-2.txt"
- }
- },
- {
- "id": "toolu_stop_results_image_3",
- "name": "Read",
- "input": {
- "file_path": "{{e2eRuntimeRoot}}/conversation-session-stop-tool-results/blocked-3.txt"
- }
- }
- ]
- }
- },
- {
- "id": "stop-results-image-followup",
- "description": "image Stop 后正常续聊",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定三个真实 Read:首个成功,后两个由隔离 PreToolUse Hook 挂起;在模型流完成后点击 Stop。只改变首个文件为文本或 PNG,不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_STOP_RESULTS_IMAGE_FOLLOWUP"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "text": "STOP_RESULTS_IMAGE_OK",
- "inputTokens": 96,
- "outputTokens": 8
- }
- }
- },
- {
- "id": "stop-results-db-tools",
- "description": "纯文本 Bash 工具调用",
- "metadata": {
- "kind": "synthetic",
- "source": "synthetic",
- "timingPolicy": "controlled-stream",
- "syntheticReason": "独立非媒体对照:真实 Bash 仅返回短文本;PostToolUse barrier 后持有隔离 SQLite 写锁,进入失败收尾后放锁再从 UI 续聊。对照组不持锁,均不点 Stop、不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_STOP_RESULTS_DB_START"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_stop_results_db_bash"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUses": [
- {
- "id": "toolu_stop_results_db_bash",
- "name": "Bash",
- "input": {
- "command": "echo E2E_STOP_RESULTS_DB_OUTPUT"
- }
- }
- ]
- }
- },
- {
- "id": "stop-results-db-initial",
- "description": "纯文本 Bash 初始轮正常完成",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "独立非媒体对照:真实 Bash 仅返回短文本;PostToolUse barrier 后持有隔离 SQLite 写锁,进入失败收尾后放锁再从 UI 续聊。对照组不持锁,均不点 Stop、不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_STOP_RESULTS_DB_FOLLOWUP"
- ],
- "bodyIncludes": [
- "E2E_STOP_RESULTS_DB_START",
- "toolu_stop_results_db_bash",
- "E2E_STOP_RESULTS_DB_OUTPUT"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "text": "STOP_RESULTS_DB_INITIAL_OK",
- "inputTokens": 96,
- "outputTokens": 8
- }
- }
- },
- {
- "id": "stop-results-db-followup",
- "description": "数据库恢复后续聊",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "独立非媒体对照:真实 Bash 仅返回短文本;PostToolUse barrier 后持有隔离 SQLite 写锁,进入失败收尾后放锁再从 UI 续聊。对照组不持锁,均不点 Stop、不伪造工具结果或 SDK 错误。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_STOP_RESULTS_DB_FOLLOWUP"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "text": "STOP_RESULTS_DB_OK",
- "inputTokens": 96,
- "outputTokens": 8
- }
- }
- }
- ]
- }
|