| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- {
- "version": 1,
- "caseName": "conversation-session-edit",
- "spec": "./test/e2e/conversation-session/editing/conversation-session-edit.test.ts",
- "fixtures": [
- {
- "id": "upstream-conversation-edit-title-generic",
- "description": "Edit case 内的标题生成固定响应,避免严格 case-local replay 继续依赖 legacy provider-basic。",
- "metadata": {
- "kind": "common",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "标题不属于 edit 产品语义,只需要稳定返回,防止标题请求误命中业务 fixture。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"upstream-e2e-edit-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Edit E2E Fixture\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
- }
- },
- {
- "id": "upstream-conversation-edit-original-final",
- "description": "Edit case 首轮普通 user query 的固定最终回复。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "首轮只用于构造可编辑 completed 历史,真实 provider 回复内容不影响 edit 产品语义。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_EDIT_ORIGINAL"],
- "bodyIncludes": ["E2E_EDIT_ORIGINAL", "upstream-e2e-ok"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "text": {
- "id": "upstream-e2e-edit-original-final",
- "inputTokens": 120,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-conversation-readonly-edit-final",
- "description": "Edit rerun case 的 Read tool_result 后最终回复。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "该响应稳定完成 edit 后的只读工具历史,用于断言旧 user query 被替换。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_EDIT_RERUN", "E2E_READONLY_TOOL_FILE_CONTENT"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "text": {
- "id": "upstream-e2e-conversation-readonly-edit-final",
- "inputTokens": 190,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- }
- }
- },
- {
- "id": "upstream-conversation-edit-held-running-controlled-stream",
- "description": "Held queue 场景中被 stop 的原 active turn,使用 case-local 可控慢流制造 running 窗口。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "真实 provider 可能过快完成;旧 legacy slow stream 90.2s 贴近测试 90s 等待边界,会把时序抖动误报成产品 bug。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_EDIT_HELD_RUNNING"],
- "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_EDIT_HELD_RUNNING"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "text": {
- "id": "upstream-e2e-edit-held-running-controlled-stream",
- "inputTokens": 120,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- },
- "chunks": [
- {
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-edit-held-running-controlled-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"
- },
- {
- "offsetMs": 250,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "offsetMs": 3000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "offsetMs": 6000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
- },
- {
- "offsetMs": 9000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
- },
- {
- "offsetMs": 30000,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "offsetMs": 30100,
- "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"
- },
- {
- "offsetMs": 30200,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-conversation-edit-held-rerun-controlled-stream",
- "description": "Held queue 存在时 edit 重跑的可控慢流,稳定覆盖 running 中继续入队和 compact guard。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "该 case 需要 edit 重跑保持 streaming 以验证 held queue、普通 queue、goal queue 和重复 compact guard;使用 30s case-local 流避免 legacy 90.2s 边界超时。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_EDIT_HELD_RERUN"],
- "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_EDIT_HELD_RERUN"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "text": {
- "id": "upstream-e2e-edit-held-rerun-controlled-stream",
- "inputTokens": 120,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- },
- "chunks": [
- {
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-edit-held-rerun-controlled-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"
- },
- {
- "offsetMs": 250,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "offsetMs": 3000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "offsetMs": 6000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
- },
- {
- "offsetMs": 9000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
- },
- {
- "offsetMs": 30000,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "offsetMs": 30100,
- "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"
- },
- {
- "offsetMs": 30200,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-conversation-edit-manual-compact-success",
- "description": "Held queue 下手动 /compact 成功的 case-local 响应。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "该响应只用于证明 compact marker 完成且 queue 保留,不依赖真实 summary 内容。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": [
- "CRITICAL: Respond with TEXT ONLY",
- "Do NOT call any tools",
- "E2E_EDIT_HELD_RERUN",
- "\"stream\":true"
- ],
- "bodyExcludes": ["E2E_AUTO_COMPACT", "E2E_AUTO_ACTIONS"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "delayMs": 650,
- "text": {
- "id": "upstream-e2e-edit-manual-compact-success",
- "inputTokens": 256,
- "outputTokens": 64,
- "text": "<analysis>Edit held queue replay summarized the rerun turn without tools.</analysis>\n\n<summary>Conversation so far includes E2E_EDIT_HELD_RERUN and queued follow-up inputs; compact should complete while preserving held queue items.</summary>"
- }
- }
- },
- {
- "id": "upstream-conversation-edit-interrupted-source-controlled-stream",
- "description": "Interrupted edit resubmit 的源回答慢流,首个 delta 后由测试 stop。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "controlled-stream",
- "source": "synthetic",
- "syntheticReason": "D10 需要稳定制造已出现首个 assistant delta 但仍可 stop 的窗口;短 source 只保留 interrupted 语义,避免回放尾部拖慢该 case。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_EDIT_INTERRUPTED_RESUBMIT_SOURCE"],
- "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_EDIT_INTERRUPTED_RESUBMIT_SOURCE"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "text": {
- "id": "upstream-e2e-edit-interrupted-source-controlled-stream",
- "inputTokens": 120,
- "outputTokens": 12,
- "text": "upstream-e2e-ok"
- },
- "chunks": [
- {
- "offsetMs": 0,
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-edit-interrupted-source-controlled-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"
- },
- {
- "offsetMs": 250,
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
- },
- {
- "offsetMs": 3000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
- },
- {
- "offsetMs": 5000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
- },
- {
- "offsetMs": 6000,
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
- },
- {
- "offsetMs": 7000,
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
- },
- {
- "offsetMs": 7100,
- "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"
- },
- {
- "offsetMs": 7200,
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- }
- ]
- }
- },
- {
- "id": "upstream-conversation-edit-interrupted-rerun-final",
- "description": "中断首轮回答后 edit user query 的默认回放,返回区别于原始回答的固定 token。",
- "metadata": {
- "kind": "main",
- "timingPolicy": "fast-text",
- "source": "synthetic",
- "syntheticReason": "该响应只用于区分 edit 后 rerun 是否真的执行;source interrupted 窗口仍由 legacy slow-stream fixture 构造。"
- },
- "maxMatches": 1,
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_EDIT_INTERRUPTED_RESUBMIT_RERUN_", "upstream-e2e-edit-rerun-ok"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "text": {
- "id": "upstream-e2e-edit-interrupted-rerun-final",
- "inputTokens": 160,
- "outputTokens": 16,
- "text": "upstream-e2e-edit-rerun-ok"
- }
- }
- }
- ]
- }
|