| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
- {
- "version": 1,
- "caseName": "conversation-session-goal-queue",
- "spec": "./test/e2e/conversation-session/conversation-session-goal-queue.test.ts",
- "fixtures": [
- {
- "id": "upstream-goal-queue-base-slow-stream",
- "description": "Goal queue 编辑场景的基础慢流,稳定制造 mixed queue 入队窗口。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "goal/text 混合 queue 需要当前轮保持 running;真实 provider 过快完成会让输入不再进入队列。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_SLOW_STREAM",
- "E2E_GOAL_QUEUE_BASE"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_GOAL_QUEUE_BASE"
- ]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "events": [
- {
- "sequence": 0,
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-base-slow-stream\",\"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,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "sequence": 2,
- "offsetMs": 700,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "sequence": 3,
- "offsetMs": 60000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
- },
- {
- "sequence": 4,
- "offsetMs": 60100,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 60200,
- "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": 6,
- "offsetMs": 60300,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-goal-queue-order-base-slow-stream",
- "description": "Goal queue 顺序消费场景的基础慢流。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "queued goal 顺序消费前需要基础轮保持 running;真实 provider 过快完成会跳过 held queue 语义。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_SLOW_STREAM",
- "E2E_GOAL_QUEUE_ORDER_BASE"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ],
- "lastUserMessageIncludes": [
- "E2E_GOAL_QUEUE_ORDER_BASE"
- ]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "events": [
- {
- "sequence": 0,
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-order-base-slow-stream\",\"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,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "sequence": 2,
- "offsetMs": 700,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "sequence": 3,
- "offsetMs": 60000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
- },
- {
- "sequence": 4,
- "offsetMs": 60100,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 60200,
- "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": 6,
- "offsetMs": 60300,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-goal-queue-order-first-continuation-slow",
- "description": "第一条 queued goal 立即发送后的 continuation 慢流。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "测试需要在第一条 queued goal 已成为 active target 且仍 streaming 时验证可 stop。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GOAL_QUEUE_ORDER_FIRST",
- "Continue working toward the active session goal"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "events": [
- {
- "sequence": 0,
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-order-first-continuation-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,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "sequence": 2,
- "offsetMs": 700,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "sequence": 3,
- "offsetMs": 60000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
- },
- {
- "sequence": 4,
- "offsetMs": 60100,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 60200,
- "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": 6,
- "offsetMs": 60300,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-goal-queue-order-second-continuation-slow",
- "description": "第二条 queued goal 立即发送后的 continuation 慢流。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "测试需要在第二条 queued goal 覆盖第一目标且仍 streaming 时验证最终 queue 清空。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GOAL_QUEUE_ORDER_SECOND",
- "Continue working toward the active session goal"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "Verify whether the active session goal"
- ]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "cache-control": "no-cache",
- "content-type": "text/event-stream; charset=utf-8"
- },
- "events": [
- {
- "sequence": 0,
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-order-second-continuation-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,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "sequence": 2,
- "offsetMs": 700,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "sequence": 3,
- "offsetMs": 60000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
- },
- {
- "sequence": 4,
- "offsetMs": 60100,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "sequence": 5,
- "offsetMs": 60200,
- "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": 6,
- "offsetMs": 60300,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-goal-queue-first-contract",
- "description": "第一条 mixed queue goal marker 合同占位;running 中不应立即发 provider。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "running 中 /goal 只进入本地 queue;fixture 只覆盖 marker 合同。"
- },
- "maxMatches": 0,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GOAL_QUEUE_FIRST"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-goal-queue-first-should-not-send",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-goal-queue-text-contract",
- "description": "mixed queue 普通文本 marker 合同占位;running 中不应立即发 provider。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "running 中普通文本只进入本地 queue;fixture 只覆盖 marker 合同。"
- },
- "maxMatches": 0,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GOAL_QUEUE_TEXT"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-goal-queue-text-should-not-send",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-goal-queue-second-contract",
- "description": "第二条 mixed queue goal marker 合同占位;running 中不应立即发 provider。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "running 中第二条 /goal 只进入本地 queue;fixture 只覆盖 marker 合同。"
- },
- "maxMatches": 0,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GOAL_QUEUE_SECOND"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-goal-queue-second-should-not-send",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-goal-queue-second-edited-contract",
- "description": "编辑后的第二条 mixed queue goal marker 合同占位;保存编辑不应发 provider。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "queue edit 只改本地队列项,不应触发 provider;fixture 只覆盖 marker 合同。"
- },
- "maxMatches": 0,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "E2E_GOAL_QUEUE_SECOND_EDITED"
- ],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "upstream-e2e-goal-queue-second-edited-should-not-send",
- "inputTokens": 128,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- }
- ]
- }
|