conversation-session-r3-stale-generation.json 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-stale-generation",
  4. "spec": "./test/e2e/conversation-session/remote/connection/conversation-session-r3-stale-generation.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-stale-title",
  8. "description": "标题",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于断言"
  14. },
  15. "maxMatches": 8,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": ["Generate a concise title", "E2E_R3_STALE_GENERATION"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"r3-stale-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"R3 stale generation\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":8,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "r3-stale-slow",
  31. "description": "旧链路扣留后显式完成,最终标记只能经新代际恢复",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "controlled-stream",
  35. "source": "synthetic",
  36. "syntheticReason": "通过闸门将 Source 完成放在旧链路仍被扣留时,避免只扣住心跳或依赖45秒竞争。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_R3_STALE_GENERATION_SLOW"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "statusMessage": "OK",
  48. "headers": {
  49. "cache-control": "no-cache",
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "chunks": [
  53. {
  54. "offsetMs": 0,
  55. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-stale-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  56. },
  57. {
  58. "offsetMs": 250,
  59. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  60. },
  61. {
  62. "offsetMs": 500,
  63. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_STALE_STREAMING \"}}\n\n"
  64. },
  65. {
  66. "offsetMs": 600,
  67. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_STALE_COMPLETE\"}}\n\n"
  68. },
  69. {
  70. "offsetMs": 700,
  71. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  72. },
  73. {
  74. "offsetMs": 800,
  75. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  76. },
  77. {
  78. "offsetMs": 900,
  79. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  80. }
  81. ],
  82. "releaseAfterChunks": 3
  83. }
  84. },
  85. {
  86. "id": "r3-stale-next",
  87. "description": "换代并释放旧链路后继续新回合",
  88. "metadata": {
  89. "kind": "main",
  90. "timingPolicy": "fast-text",
  91. "source": "synthetic",
  92. "syntheticReason": "验证新代际仍能完成携带原任务历史的模型请求"
  93. },
  94. "maxMatches": 4,
  95. "match": {
  96. "method": "POST",
  97. "pathIncludes": "/messages",
  98. "bodyIncludes": ["E2E_R3_STALE_GENERATION_NEXT"],
  99. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  100. },
  101. "response": {
  102. "statusCode": 200,
  103. "text": {
  104. "id": "r3-stale-next",
  105. "inputTokens": 64,
  106. "outputTokens": 8,
  107. "text": "R3_STALE_NEXT_REPLY"
  108. }
  109. }
  110. },
  111. {
  112. "id": "r3-stale-main",
  113. "description": "建立任务的首回合",
  114. "metadata": {
  115. "kind": "main",
  116. "timingPolicy": "fast-text",
  117. "source": "synthetic",
  118. "syntheticReason": "为旧代际恢复保留确定性任务历史"
  119. },
  120. "maxMatches": 12,
  121. "match": {
  122. "method": "POST",
  123. "pathIncludes": "/messages",
  124. "bodyIncludes": ["E2E_R3_STALE_GENERATION_"],
  125. "bodyExcludes": [
  126. "Generate a concise title",
  127. "CRITICAL: Respond with TEXT ONLY",
  128. "E2E_R3_STALE_GENERATION_SLOW"
  129. ]
  130. },
  131. "response": {
  132. "statusCode": 200,
  133. "text": {
  134. "id": "r3-stale-main",
  135. "inputTokens": 64,
  136. "outputTokens": 8,
  137. "text": "R3_STALE_GENERATION_REPLY"
  138. }
  139. }
  140. }
  141. ]
  142. }