{ "version": 1, "caseName": "conversation-session-r3-task-faults", "spec": "./test/e2e/conversation-session/remote/execution/conversation-session-r3-task-faults.test.ts", "fixtures": [ { "id": "r3-faults-title", "description": "标题", "metadata": { "kind": "common", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "标题不属于断言" }, "maxMatches": 8, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["Generate a concise title", "E2E_R3_TASK_FAULTS"] }, "response": { "statusCode": 200, "text": { "id": "r3-faults-title", "inputTokens": 64, "outputTokens": 8, "text": "{\"title\":\"R3 task faults\"}" } } }, { "id": "r3-faults-http-429-once", "description": "真实HTTP 429限流响应", "metadata": { "kind": "main", "timingPolicy": "fault-stream", "source": "synthetic", "syntheticReason": "固定一次限流,随后恢复;核对HTTP状态与请求次数,支持当前重试策略。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_HTTP_429"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 429, "headers": { "content-type": "application/json", "retry-after": "0" }, "body": "{\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"E2E_429_RATE_LIMIT\"}}" } }, { "id": "r3-faults-http-429-recover", "description": "限流后的自动或显式重试恢复", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "与单次429组成明确的[429,200]恢复序列。" }, "maxMatches": 1, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_HTTP_429"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 200, "text": { "id": "r3-429-recovered", "inputTokens": 64, "outputTokens": 8, "text": "R3_FAULTS_429_RECOVERED" } } }, { "id": "r3-faults-auth-once", "description": "首次请求 401 鉴权错误(不可重试),只消费一次", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "远端模型错误必须以明确错误呈现且保留输入" }, "replay": { "consumeOnce": true }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_RATE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 401, "headers": { "content-type": "application/json" }, "body": "{\"type\": \"error\", \"error\": {\"type\": \"authentication_error\", \"message\": \"E2E_R3_AUTH_REJECTED\"}}" } }, { "id": "r3-faults-rate-limit-recover", "description": "重试后正常回复", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "重试恢复" }, "maxMatches": 4, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_RATE"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 200, "text": { "id": "r3-faults-rate-recover", "inputTokens": 64, "outputTokens": 8, "text": "R3_FAULTS_RATE_RECOVERED" } } }, { "id": "r3-faults-truncated-once", "description": "流中途断开(无 message_stop)", "metadata": { "kind": "main", "timingPolicy": "fault-stream", "source": "synthetic", "syntheticReason": "truncated stream 不能假 completed 或永久 running" }, "replay": { "consumeOnce": true }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_TRUNC"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 200, "headers": { "cache-control": "no-cache", "content-type": "text/event-stream; charset=utf-8" }, "closeMode": "destroy", "chunks": [ { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-trunc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"e2e-ssh-remote-lifecycle-model\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" }, { "offsetMs": 200, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" }, { "offsetMs": 400, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_FAULTS_TRUNC_PARTIAL \"}}\n\n" } ] } }, { "id": "r3-faults-truncated-recover", "description": "重试后正常回复", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "重试恢复" }, "maxMatches": 4, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_TRUNC"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"] }, "response": { "statusCode": 200, "text": { "id": "r3-faults-trunc-recover", "inputTokens": 64, "outputTokens": 8, "text": "R3_FAULTS_TRUNC_RECOVERED" } } }, { "id": "r3-faults-main", "description": "其它", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "首发" }, "maxMatches": 10, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_R3_TASK_FAULTS_"], "bodyExcludes": [ "Generate a concise title", "CRITICAL: Respond with TEXT ONLY", "E2E_R3_TASK_FAULTS_RATE", "E2E_R3_TASK_FAULTS_TRUNC" ] }, "response": { "statusCode": 200, "text": { "id": "r3-faults-main", "inputTokens": 64, "outputTokens": 8, "text": "R3_TASK_FAULTS_REPLY" } } } ] }