| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- {
- "version": 1,
- "caseName": "conversation-session-r3-server-update",
- "spec": "./test/e2e/conversation-session/remote/installation/conversation-session-r3-server-update.test.ts",
- "fixtures": [
- {
- "id": "r3-update-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_SERVER_UPDATE"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "r3-update-title",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "{\"title\":\"R3 task control\"}"
- }
- }
- },
- {
- "id": "r3-update-slow-turn",
- "description": "保持远端任务运行直到更新守卫出现且用户取消;明确释放后才允许普通更新",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "保持远端任务运行直到更新守卫出现且用户取消;明确释放后才允许普通更新"
- },
- "maxMatches": 4,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_R3_SERVER_UPDATE_SLOW"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "chunks": [
- {
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-update-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"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": 250,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "offsetMs": 500,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_UPDATE_STREAMING \"}}\n\n"
- },
- {
- "offsetMs": 45000,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "offsetMs": 45100,
- "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
- },
- {
- "offsetMs": 45200,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ],
- "text": {
- "id": "v4-queue-slow",
- "inputTokens": 80,
- "outputTokens": 4,
- "text": "V4_QUEUE_STREAMING"
- },
- "releaseAfterChunks": 3
- }
- },
- {
- "id": "r3-update-queued",
- "description": "排队项被消费后的普通回复",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "队列消费按 FIFO"
- },
- "maxMatches": 8,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_R3_SERVER_UPDATE_Q"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "r3-update-queued",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "R3_UPDATE_Q_REPLY"
- }
- }
- },
- {
- "id": "r3-update-permission-write",
- "description": "Write 工具触发远端权限请求",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "权限阻塞必须由真实 blocking request 承载"
- },
- "maxMatches": 4,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_R3_SERVER_UPDATE_PERMISSION"],
- "bodyIncludes": ["E2E_R3_SERVER_UPDATE_PERMISSION"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "toolu_r3_task_permission"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_r3_task_permission",
- "name": "Write",
- "input": {
- "file_path": "/home/dev/r3-workspace-a/.zcode-e2e/r3-server-update/permission-output.txt",
- "content": "R3_UPDATE_PERMISSION_RESULT\n"
- }
- }
- }
- },
- {
- "id": "r3-update-permission-final",
- "description": "工具结果后的终态文本",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "终态"
- },
- "maxMatches": 4,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_R3_SERVER_UPDATE_PERMISSION", "toolu_r3_task_permission"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "r3-update-permission-final",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "R3_UPDATE_PERMISSION_DONE"
- }
- }
- },
- {
- "id": "r3-update-main-fallback",
- "description": "其它本 case 请求(续发历史可含 SLOW/Q/PERMISSION,只按最后一条用户消息排除)",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "首发/续发普通回复"
- },
- "maxMatches": 10,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_R3_SERVER_UPDATE_"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
- "lastUserMessageExcludes": [
- "E2E_R3_SERVER_UPDATE_SLOW",
- "E2E_R3_SERVER_UPDATE_Q",
- "E2E_R3_SERVER_UPDATE_PERMISSION"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "r3-update-main",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "R3_SERVER_UPDATE_REPLY"
- }
- }
- }
- ]
- }
|