| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- {
- "version": 1,
- "caseName": "conversation-session-model-switch-queue",
- "spec": "./test/e2e/conversation-session/conversation-session-model-switch-queue.test.ts",
- "fixtures": [
- {
- "id": "upstream-model-switch-held-running-slow",
- "description": "N02 held queue 场景首轮慢流,稳定制造 stop 前 queue。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "模型切换 held queue 需要当前轮保持 streaming,真实模型可能过快完成。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_SLOW_STREAM",
- "E2E_MODEL_SWITCH_HELD_RUNNING"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_MODEL_SWITCH_HELD_RUNNING"
- ]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-held-running-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
- "events": [
- {
- "sequence": 0,
- "offsetMs": 0,
- "byteLength": 333,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-held-running-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
- },
- {
- "sequence": 1,
- "offsetMs": 250,
- "byteLength": 120,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "sequence": 2,
- "offsetMs": 8000,
- "byteLength": 118,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "sequence": 3,
- "offsetMs": 16000,
- "byteLength": 118,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
- },
- {
- "sequence": 4,
- "offsetMs": 24000,
- "byteLength": 122,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 90000,
- "byteLength": 49,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 6,
- "offsetMs": 90100,
- "byteLength": 179,
- "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
- },
- {
- "sequence": 7,
- "offsetMs": 90200,
- "byteLength": 42,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-model-switch-held-send-now-secondary",
- "description": "N02 held queue 点立即发送后的固定回复,用于断言请求使用 secondary 模型配置。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "核心断言在请求 capture 的 model/thought,响应只需稳定完成。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_MODEL_SWITCH_HELD_SEND_NOW"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_MODEL_SWITCH_HELD_SEND_NOW"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-model-switch-held-send-now-secondary",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-model-switch-queue-running-slow",
- "description": "N02 auto drain 场景首轮慢流,给切 secondary 留出窗口。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "queued text 消费前切模型需要当前轮保持 streaming,真实模型可能过快完成。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_SLOW_STREAM",
- "E2E_MODEL_SWITCH_QUEUE_RUNNING"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_MODEL_SWITCH_QUEUE_RUNNING"
- ]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-queue-running-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
- "events": [
- {
- "sequence": 0,
- "offsetMs": 0,
- "byteLength": 333,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-queue-running-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
- },
- {
- "sequence": 1,
- "offsetMs": 250,
- "byteLength": 120,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "sequence": 2,
- "offsetMs": 8000,
- "byteLength": 118,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "sequence": 3,
- "offsetMs": 16000,
- "byteLength": 118,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
- },
- {
- "sequence": 4,
- "offsetMs": 24000,
- "byteLength": 122,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 90000,
- "byteLength": 49,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 6,
- "offsetMs": 90100,
- "byteLength": 179,
- "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
- },
- {
- "sequence": 7,
- "offsetMs": 90200,
- "byteLength": 42,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-model-switch-queue-auto-drain-secondary",
- "description": "N02 queued text auto drain 后固定回复,用于断言消费请求使用 secondary 模型配置。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "核心断言在请求 capture 的 model/thought,响应只需稳定完成。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_MODEL_SWITCH_QUEUE_AUTO_DRAIN"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_MODEL_SWITCH_QUEUE_AUTO_DRAIN"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-model-switch-queue-auto-drain-secondary",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-model-switch-slow-marker-contract",
- "description": "N02 通用 slow stream marker 合同占位,实际由 held/queue running fixture 覆盖。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "用于让 fixture check 明确覆盖 spec 中的通用 E2E_SLOW_STREAM marker。"
- },
- "maxMatches": 0,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_SLOW_STREAM"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_SLOW_STREAM"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-model-switch-slow-marker-contract",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- }
- ]
- }
|