conversation-session-model-provider-restart-recovery.json 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-provider-restart-recovery",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-model-provider-restart-recovery.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "model-provider-restart-title",
  8. "description": "重启恢复 case 的标题生成固定响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不属于模型恢复语义。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  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\":\"model-provider-restart-title\",\"object\":\"chat.completion\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"title\\\":\\\"Model restart\\\"}\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":32,\"completion_tokens\":8,\"total_tokens\":40}}"
  27. }
  28. },
  29. {
  30. "id": "model-provider-restart-title-anthropic",
  31. "description": "重启恢复 case 在启动 Anthropic transport 下的标题响应。",
  32. "metadata": {
  33. "kind": "common",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "重启窗口可能在 seed provider 水合前先恢复启动 provider transport。"
  37. },
  38. "match": {
  39. "method": "POST",
  40. "pathIncludes": "/messages",
  41. "bodyIncludes": ["Generate a concise title"]
  42. },
  43. "response": {
  44. "statusCode": 200,
  45. "statusMessage": "OK",
  46. "headers": {
  47. "content-type": "application/json; charset=utf-8"
  48. },
  49. "body": "{\"id\":\"model-provider-restart-title-anthropic\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Model restart\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":32,\"output_tokens\":8}}"
  50. }
  51. },
  52. {
  53. "id": "model-provider-restart-r01",
  54. "description": "I25 重启保留可用 上游 模型。",
  55. "metadata": {
  56. "kind": "main",
  57. "timingPolicy": "fast-text",
  58. "source": "synthetic",
  59. "syntheticReason": "核心断言是请求模型,响应仅用于稳定收口。"
  60. },
  61. "maxMatches": 1,
  62. "match": {
  63. "method": "POST",
  64. "pathIncludes": "/chat/completions",
  65. "lastUserMessageIncludes": ["E2E_MODEL_PROVIDER_RESTART_R01"],
  66. "bodyExcludes": ["Generate a concise title"]
  67. },
  68. "response": {
  69. "statusCode": 200,
  70. "statusMessage": "OK",
  71. "headers": {
  72. "content-type": "text/event-stream; charset=utf-8"
  73. },
  74. "body": "data: {\"id\":\"model-provider-restart-r01\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"model-provider-restart-r01\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
  75. }
  76. },
  77. {
  78. "id": "model-provider-restart-r01-anthropic",
  79. "description": "I25 在启动 Anthropic transport 下保留可用 上游 模型。",
  80. "metadata": {
  81. "kind": "main",
  82. "timingPolicy": "fast-text",
  83. "source": "synthetic",
  84. "syntheticReason": "case 验证 provider/model,允许重启恢复阶段使用启动 transport。"
  85. },
  86. "maxMatches": 1,
  87. "match": {
  88. "method": "POST",
  89. "pathIncludes": "/messages",
  90. "lastUserMessageIncludes": ["E2E_MODEL_PROVIDER_RESTART_R01"],
  91. "bodyExcludes": ["Generate a concise title"]
  92. },
  93. "response": {
  94. "statusCode": 200,
  95. "statusMessage": "OK",
  96. "text": {
  97. "id": "model-provider-restart-r01-anthropic",
  98. "inputTokens": 96,
  99. "outputTokens": 8,
  100. "text": "upstream-e2e-ok"
  101. }
  102. }
  103. },
  104. {
  105. "id": "model-provider-restart-r02",
  106. "description": "I26 重启保留 Plan Highspeed。",
  107. "metadata": {
  108. "kind": "main",
  109. "timingPolicy": "fast-text",
  110. "source": "synthetic",
  111. "syntheticReason": "核心断言是请求模型,响应仅用于稳定收口。"
  112. },
  113. "maxMatches": 1,
  114. "match": {
  115. "method": "POST",
  116. "pathIncludes": "/chat/completions",
  117. "lastUserMessageIncludes": ["E2E_MODEL_PROVIDER_RESTART_R02"],
  118. "bodyExcludes": ["Generate a concise title"]
  119. },
  120. "response": {
  121. "statusCode": 200,
  122. "statusMessage": "OK",
  123. "headers": {
  124. "content-type": "text/event-stream; charset=utf-8"
  125. },
  126. "body": "data: {\"id\":\"model-provider-restart-r02\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2-highspeed-e2e\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"model-provider-restart-r02\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2-highspeed-e2e\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
  127. }
  128. },
  129. {
  130. "id": "model-provider-restart-r03",
  131. "description": "I27 的旧 Start Plan 选择失效后回退 Configured Default。",
  132. "metadata": {
  133. "kind": "main",
  134. "timingPolicy": "fast-text",
  135. "source": "synthetic",
  136. "syntheticReason": "核心断言是失效 Recent 回退后的真实请求模型,响应仅用于稳定收口。"
  137. },
  138. "maxMatches": 1,
  139. "match": {
  140. "method": "POST",
  141. "pathIncludes": "/chat/completions",
  142. "lastUserMessageIncludes": ["E2E_MODEL_PROVIDER_RESTART_R03"],
  143. "bodyExcludes": ["Generate a concise title"]
  144. },
  145. "response": {
  146. "statusCode": 200,
  147. "statusMessage": "OK",
  148. "headers": {
  149. "content-type": "text/event-stream; charset=utf-8"
  150. },
  151. "body": "data: {\"id\":\"model-provider-restart-r03\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"model-provider-restart-r03\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
  152. }
  153. },
  154. {
  155. "id": "model-provider-restart-r04",
  156. "description": "I28 的已删除模型选择失效后回退 Configured Default。",
  157. "metadata": {
  158. "kind": "main",
  159. "timingPolicy": "fast-text",
  160. "source": "synthetic",
  161. "syntheticReason": "核心断言是失效 Recent 回退后的真实请求模型,响应仅用于稳定收口。"
  162. },
  163. "maxMatches": 1,
  164. "match": {
  165. "method": "POST",
  166. "pathIncludes": "/chat/completions",
  167. "lastUserMessageIncludes": ["E2E_MODEL_PROVIDER_RESTART_R04"],
  168. "bodyExcludes": ["Generate a concise title"]
  169. },
  170. "response": {
  171. "statusCode": 200,
  172. "statusMessage": "OK",
  173. "headers": {
  174. "content-type": "text/event-stream; charset=utf-8"
  175. },
  176. "body": "data: {\"id\":\"model-provider-restart-r04\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"model-provider-restart-r04\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
  177. }
  178. }
  179. ]
  180. }