conversation-session-model-switch-auto-compact.json 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-switch-auto-compact",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-model-switch-auto-compact.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "title-e2e_auto_actions_",
  8. "description": "Upstream e2e title generation 的固定辅助响应,避免标题生成请求误命中业务 case fixture。",
  9. "match": {
  10. "method": "POST",
  11. "pathIncludes": "/messages",
  12. "bodyIncludes": ["Generate a concise title", "E2E_AUTO_ACTIONS_"]
  13. },
  14. "response": {
  15. "statusCode": 200,
  16. "statusMessage": "OK",
  17. "headers": {
  18. "content-type": "application/json; charset=utf-8"
  19. },
  20. "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\"}}"
  21. },
  22. "metadata": {
  23. "kind": "common",
  24. "source": "synthetic",
  25. "timingPolicy": "fast-text",
  26. "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
  27. }
  28. },
  29. {
  30. "id": "model-switch-guard-seed",
  31. "description": "普通历史用于验证选择模型不立即触发压缩。",
  32. "match": {
  33. "method": "POST",
  34. "pathIncludes": "/messages",
  35. "lastUserMessageIncludes": ["E2E_AUTO_ACTIONS_MODEL_SWITCH_"],
  36. "bodyIncludes": ["E2E_AUTO_ACTIONS_MODEL_SWITCH_"],
  37. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  38. },
  39. "response": {
  40. "statusCode": 200,
  41. "text": {
  42. "id": "model-intent-history",
  43. "inputTokens": 40,
  44. "outputTokens": 8,
  45. "text": "upstream-e2e-ok"
  46. }
  47. },
  48. "metadata": {
  49. "kind": "main",
  50. "source": "synthetic",
  51. "timingPolicy": "fast-text",
  52. "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
  53. }
  54. },
  55. {
  56. "id": "upstream-auto-actions-context-seed",
  57. "description": "Auto compact actions e2e 第一轮普通响应:返回较高 input usage,让下一轮发送前触发自动 compact。",
  58. "match": {
  59. "method": "POST",
  60. "pathIncludes": "/messages",
  61. "lastUserMessageIncludes": ["E2E_AUTO_ACTIONS_CONTEXT_SEED"],
  62. "bodyIncludes": ["E2E_AUTO_ACTIONS_CONTEXT_SEED"],
  63. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  64. },
  65. "response": {
  66. "statusCode": 200,
  67. "statusMessage": "OK",
  68. "headers": {
  69. "cache-control": "no-cache",
  70. "content-type": "text/event-stream; charset=utf-8"
  71. },
  72. "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"
  73. },
  74. "metadata": {
  75. "kind": "main",
  76. "source": "synthetic",
  77. "timingPolicy": "fast-text",
  78. "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
  79. }
  80. },
  81. {
  82. "id": "upstream-auto-actions-compact-slow",
  83. "description": "真实摘要响应以门闩挂起,切换待发送模型后显式释放。",
  84. "match": {
  85. "method": "POST",
  86. "pathIncludes": "/messages",
  87. "bodyIncludes": ["CRITICAL: Respond with TEXT ONLY", "E2E_AUTO_ACTIONS", "\"stream\":true"]
  88. },
  89. "response": {
  90. "statusCode": 200,
  91. "headers": {
  92. "content-type": "text/event-stream; charset=utf-8"
  93. },
  94. "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",
  95. "chunks": [
  96. {
  97. "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",
  98. "delayMs": 0
  99. },
  100. {
  101. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  102. "delayMs": 0
  103. },
  104. {
  105. "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",
  106. "delayMs": 0
  107. },
  108. {
  109. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  110. "delayMs": 0
  111. },
  112. {
  113. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":64}}\n\n",
  114. "delayMs": 0
  115. },
  116. {
  117. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  118. "delayMs": 0
  119. }
  120. ],
  121. "releaseAfterChunks": 2
  122. },
  123. "metadata": {
  124. "kind": "main",
  125. "source": "synthetic",
  126. "timingPolicy": "controlled-stream",
  127. "syntheticReason": "确定性覆盖压缩中的菜单操作,不依赖固定响应延时。"
  128. }
  129. },
  130. {
  131. "id": "upstream-auto-actions-pending-text",
  132. "description": "Auto compact actions e2e compact 成功后继续执行原普通文本 pending action。",
  133. "match": {
  134. "method": "POST",
  135. "pathIncludes": "/messages",
  136. "lastUserMessageIncludes": ["E2E_AUTO_ACTIONS_PENDING_TEXT"],
  137. "bodyIncludes": ["E2E_AUTO_ACTIONS_PENDING_TEXT"],
  138. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  139. },
  140. "response": {
  141. "statusCode": 200,
  142. "statusMessage": "OK",
  143. "headers": {
  144. "cache-control": "no-cache",
  145. "content-type": "text/event-stream; charset=utf-8"
  146. },
  147. "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"
  148. },
  149. "metadata": {
  150. "kind": "main",
  151. "source": "synthetic",
  152. "timingPolicy": "fast-text",
  153. "syntheticReason": "保留旧回放中的工具、队列或压缩窗口;实际命令、会话状态和请求仍由真实 Agent 与 UI 产生。"
  154. }
  155. }
  156. ]
  157. }