conversation-session-compact-timeline-projection.json 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-compact-timeline-projection",
  4. "spec": "./test/e2e/conversation-session/context/conversation-session-compact-timeline-projection.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-compact-timeline-projection-title-sidecar",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "运行时证据显示标题旁路缺少响应;在本例显式登记固定标题,避免依赖 legacy fixture 或触发后台网络重试。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "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\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-compact-timeline-projection-seed",
  31. "description": "两轮已完成历史提供可压缩前缀与高 usage。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "TP 的核心断言是 auto compact marker 的 UI 投影位置,真实模型 token usage 不稳定;DeepSeek v4 可能是 1M context,需要合成足够高的 provider usage。"
  37. },
  38. "maxMatches": 2,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_COMPACT_TIMELINE_PROJECTION_SEED"],
  43. "bodyIncludes": ["E2E_COMPACT_TIMELINE_PROJECTION_SEED"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "text": {
  49. "id": "upstream-e2e-compact-timeline-projection-seed",
  50. "inputTokens": 950000,
  51. "outputTokens": 12,
  52. "text": "upstream-e2e-seed-ok"
  53. }
  54. }
  55. },
  56. {
  57. "id": "upstream-compact-timeline-projection-pending",
  58. "description": "TP auto compact 完成后继续 pending 主请求的固定回复。",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "fast-text",
  62. "source": "synthetic",
  63. "syntheticReason": "该响应只需要稳定产出 pending assistant,核心断言在 compact marker 是否折进同一工作块。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "lastUserMessageIncludes": ["E2E_COMPACT_TIMELINE_PROJECTION_PENDING"],
  70. "bodyIncludes": ["E2E_COMPACT_TIMELINE_PROJECTION_PENDING"],
  71. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "text": {
  76. "id": "upstream-e2e-compact-timeline-projection-pending",
  77. "inputTokens": 96,
  78. "outputTokens": 12,
  79. "text": "upstream-e2e-pending-ok"
  80. }
  81. }
  82. },
  83. {
  84. "id": "upstream-compact-timeline-projection-manual-split-seed",
  85. "description": "TP manual failed 投影样本前置真实 task 的固定回复。",
  86. "metadata": {
  87. "kind": "main",
  88. "timingPolicy": "fast-text",
  89. "source": "synthetic",
  90. "syntheticReason": "创建真实会话后,在进程退出期间写入原生失败 compact part,用正式冷恢复验证投影。"
  91. },
  92. "maxMatches": 1,
  93. "match": {
  94. "method": "POST",
  95. "pathIncludes": "/messages",
  96. "lastUserMessageIncludes": ["E2E_COMPACT_TIMELINE_PROJECTION_MANUAL_SPLIT_SEED"],
  97. "bodyIncludes": ["E2E_COMPACT_TIMELINE_PROJECTION_MANUAL_SPLIT_SEED"],
  98. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  99. },
  100. "response": {
  101. "statusCode": 200,
  102. "text": {
  103. "id": "upstream-e2e-compact-timeline-projection-manual-split-seed",
  104. "inputTokens": 96,
  105. "outputTokens": 12,
  106. "text": "upstream-e2e-seed-ok"
  107. }
  108. }
  109. },
  110. {
  111. "id": "compact-timeline-projection-controlled-compact",
  112. "description": "auto compact 的受控摘要,测试验证重复命令后显式放行。",
  113. "metadata": {
  114. "kind": "main",
  115. "timingPolicy": "controlled-stream",
  116. "source": "synthetic",
  117. "syntheticReason": "固定 auto compact busy 窗口,不以模型耗时决定重复命令是否发生在压缩中。"
  118. },
  119. "maxMatches": 1,
  120. "match": {
  121. "method": "POST",
  122. "pathIncludes": "/messages",
  123. "bodyIncludes": ["CRITICAL: Respond with TEXT ONLY", "E2E_COMPACT_TIMELINE_PROJECTION"]
  124. },
  125. "response": {
  126. "statusCode": 200,
  127. "statusMessage": "OK",
  128. "headers": {
  129. "cache-control": "no-cache",
  130. "content-type": "text/event-stream; charset=utf-8"
  131. },
  132. "releaseAfterChunks": 3,
  133. "chunks": [
  134. {
  135. "offsetMs": 0,
  136. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-sidebar-stop-status-race\",\"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"
  137. },
  138. {
  139. "offsetMs": 0,
  140. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  141. },
  142. {
  143. "offsetMs": 0,
  144. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_COMPACT_TIMELINE_SUMMARY\"}}\n\n"
  145. },
  146. {
  147. "offsetMs": 0,
  148. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" done\"}}\n\n"
  149. },
  150. {
  151. "offsetMs": 0,
  152. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  153. },
  154. {
  155. "offsetMs": 0,
  156. "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"
  157. },
  158. {
  159. "offsetMs": 0,
  160. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  161. }
  162. ]
  163. }
  164. }
  165. ]
  166. }