| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- {
- "version": 1,
- "caseName": "conversation-session-v4-queue-drain",
- "spec": "./test/e2e/conversation-session/queue/conversation-session-v4-queue-drain.test.ts",
- "fixtures": [
- {
- "id": "v4-queue-drain-title",
- "description": "E2E_V4_DRAIN_SLOW 首发的 case-local 标题生成响应。",
- "metadata": {
- "kind": "common",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "E2E_V4_DRAIN_SLOW 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_V4_DRAIN_SLOW"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "v4-queue-drain-title",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "{\"title\":\"V4 Queue Drain E2E\"}"
- }
- }
- },
- {
- "id": "v4-queue-drain-q1",
- "description": "C02:队首排队项被 drain 后的第二次 roundtrip 回复。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "drain 消费需要可断言的回复哨兵。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_V4_DRAIN_Q1"],
- "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\":\"v4-drain-q1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":90,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
- },
- {
- "offsetMs": 100,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "offsetMs": 200,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_DRAIN_Q1_REPLY\"}}\n\n"
- },
- {
- "offsetMs": 300,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "offsetMs": 400,
- "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":90,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n"
- },
- {
- "offsetMs": 500,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ],
- "text": {
- "id": "v4-drain-q1",
- "inputTokens": 90,
- "outputTokens": 6,
- "text": "V4_DRAIN_Q1_REPLY"
- }
- }
- },
- {
- "id": "v4-queue-drain-slow-turn",
- "description": "C02:8s 慢流首轮——留出入队窗口,流结束后 runtime 自动 drain 队首。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "自动消费需要 running 窗口入队 + 可预期的流结束时点。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_V4_DRAIN_SLOW"],
- "lastUserMessageExcludes": ["E2E_V4_DRAIN_Q1"],
- "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\":\"v4-drain-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\":\"V4_DRAIN_STREAMING \"}}\n\n"
- },
- {
- "offsetMs": 8000,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "offsetMs": 8100,
- "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": 8200,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ],
- "text": {
- "id": "v4-drain-slow",
- "inputTokens": 80,
- "outputTokens": 4,
- "text": "V4_DRAIN_STREAMING"
- }
- }
- }
- ]
- }
|