{ "version": 1, "caseName": "conversation-session-v4-stop-queue", "spec": "./test/e2e/conversation-session/queue/conversation-session-v4-stop-queue.test.ts", "fixtures": [ { "id": "v4-stop-queue-title", "description": "E2E_V4_HELD_SLOW 首发的 case-local 标题生成响应。", "metadata": { "kind": "common", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "E2E_V4_HELD_SLOW 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。" }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["Generate a concise title", "E2E_V4_HELD_SLOW"] }, "response": { "statusCode": 200, "text": { "id": "v4-stop-queue-title", "inputTokens": 64, "outputTokens": 8, "text": "{\"title\":\"V4 Stop Queue E2E\"}" } } }, { "id": "v4-stop-queue-q1", "description": "held queue 项 1 的消费回复(sendQueuedNow / drain 后可见)。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "held queue 项被显式消费后需要可断言的回复哨兵。" }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_V4_HELD_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-held-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_HELD_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-held-q1", "inputTokens": 90, "outputTokens": 6, "text": "V4_HELD_Q1_REPLY" } } }, { "id": "v4-stop-queue-q2", "description": "暂停队列项 2 在继续自动消费后的 FIFO 回复。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "B14 需要第二个可区分的回复哨兵,证明点击继续后 Q1/Q2 由 CLI 按 FIFO 消费到空。" }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_V4_HELD_Q2"], "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-held-q2\",\"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_HELD_Q2_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-held-q2", "inputTokens": 90, "outputTokens": 6, "text": "V4_HELD_Q2_REPLY" } } }, { "id": "v4-stop-queue-keep-send", "description": "暂停队列 modal 选择保留并发送后的受控慢流回复。", "metadata": { "kind": "main", "timingPolicy": "controlled-stream", "source": "synthetic", "syntheticReason": "B06 需要可断言的 keepQueueAndSend 回复;B15 还需要稳定 running 窗口,在当前流完成前点击继续并证明旧暂停队首不抢占。" }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_V4_HELD_KEEP"], "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-held-keep\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":95,\"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_HELD_KEEP_STREAMING \"}}\n\n" }, { "offsetMs": 3500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_KEEP_REPLY\"}}\n\n" }, { "offsetMs": 3600, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" }, { "offsetMs": 3700, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":95,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n" }, { "offsetMs": 3800, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } ], "text": { "id": "v4-held-keep", "inputTokens": 95, "outputTokens": 6, "text": "V4_HELD_KEEP_STREAMING V4_HELD_KEEP_REPLY" } } }, { "id": "v4-stop-queue-clear-send", "description": "暂停队列 modal 选择“清空队列”后的新一轮回复。", "metadata": { "kind": "main", "timingPolicy": "fast-text", "source": "synthetic", "syntheticReason": "clearQueueAndSend 需要可断言的新回复哨兵,同时 queue 清空。" }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_V4_HELD_CLEAR"], "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-held-clear\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":95,\"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_HELD_CLEAR_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\":95,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n" }, { "offsetMs": 500, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } ], "text": { "id": "v4-held-clear", "inputTokens": 95, "outputTokens": 6, "text": "V4_HELD_CLEAR_REPLY" } } }, { "id": "v4-stop-queue-slow-turn", "description": "B02/B04 held queue 门禁:可控慢流首轮,保持 running 以便入队后 stop。", "metadata": { "kind": "main", "timingPolicy": "controlled-stream", "source": "synthetic", "syntheticReason": "stop 保留 queue 的断言需要稳定 running 窗口(入队两条后 stop)。" }, "match": { "method": "POST", "pathIncludes": "/messages", "lastUserMessageIncludes": ["E2E_V4_HELD_SLOW"], "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"], "lastUserMessageExcludes": [ "E2E_V4_HELD_KEEP", "E2E_V4_HELD_CLEAR", "E2E_V4_HELD_Q1", "E2E_V4_HELD_Q2" ] }, "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-held-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_HELD_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-held-slow", "inputTokens": 80, "outputTokens": 4, "text": "V4_HELD_STREAMING" } } } ] }