| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- {
- "version": 1,
- "caseName": "conversation-session-model-switch-auto-compact",
- "spec": "./test/e2e/conversation-session/models/conversation-session-model-switch-auto-compact.test.ts",
- "fixtures": [
- {
- "id": "title-e2e_auto_actions_",
- "description": "Upstream e2e title generation 的固定辅助响应,避免标题生成请求误命中业务 case fixture。",
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_AUTO_ACTIONS_"]
- },
- "response": {
- "statusCode": 200,
- "statusMessage": "OK",
- "headers": {
- "content-type": "application/json; charset=utf-8"
- },
- "body": "{\"id\":\"upstream-e2e-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream 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\"}}"
- },
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
- }
- },
- {
- "id": "model-switch-guard-seed",
- "description": "普通历史用于验证选择模型不立即触发压缩。",
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_AUTO_ACTIONS_MODEL_SWITCH_"],
- "bodyIncludes": ["E2E_AUTO_ACTIONS_MODEL_SWITCH_"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "model-intent-history",
- "inputTokens": 40,
- "outputTokens": 8,
- "text": "upstream-e2e-ok"
- }
- },
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
- }
- },
- {
- "id": "upstream-auto-actions-context-seed",
- "description": "Auto compact actions e2e 第一轮普通响应:返回较高 input usage,让下一轮发送前触发自动 compact。",
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_AUTO_ACTIONS_CONTEXT_SEED"],
- "bodyIncludes": ["E2E_AUTO_ACTIONS_CONTEXT_SEED"],
- "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"
- },
- "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-auto-actions-seed\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":190,\"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\":\"upstream-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\":190,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- },
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
- }
- },
- {
- "id": "upstream-auto-actions-compact-slow",
- "description": "真实摘要响应以门闩挂起,切换待发送模型后显式释放。",
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["CRITICAL: Respond with TEXT ONLY", "E2E_AUTO_ACTIONS", "\"stream\":true"]
- },
- "response": {
- "statusCode": 200,
- "headers": {
- "content-type": "text/event-stream; charset=utf-8"
- },
- "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"e2e-compact-actions-summary\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\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\":\"<analysis>Auto compact actions e2e replay summarized the previous session without tools.</analysis>\\n\\n<summary>Auto compact preserved E2E_AUTO_ACTIONS context and pending text while the user added future queue entries.</summary>\"}}\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\"},\"usage\":{\"output_tokens\":64}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
- "chunks": [
- {
- "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"e2e-compact-actions-summary\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\n\n",
- "delayMs": 0
- },
- {
- "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
- "delayMs": 0
- },
- {
- "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"<analysis>Auto compact actions e2e replay summarized the previous session without tools.</analysis>\\n\\n<summary>Auto compact preserved E2E_AUTO_ACTIONS context and pending text while the user added future queue entries.</summary>\"}}\n\n",
- "delayMs": 0
- },
- {
- "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
- "delayMs": 0
- },
- {
- "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":64}}\n\n",
- "delayMs": 0
- },
- {
- "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
- "delayMs": 0
- }
- ],
- "releaseAfterChunks": 2
- },
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "controlled-stream",
- "syntheticReason": "确定性覆盖压缩中的菜单操作,不依赖固定响应延时。"
- }
- },
- {
- "id": "upstream-auto-actions-pending-text",
- "description": "Auto compact actions e2e compact 成功后继续执行原普通文本 pending action。",
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_AUTO_ACTIONS_PENDING_TEXT"],
- "bodyIncludes": ["E2E_AUTO_ACTIONS_PENDING_TEXT"],
- "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"
- },
- "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-auto-actions-pending\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":96,\"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\":\"upstream-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\":96,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
- },
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
- }
- }
- ]
- }
|