conversation-session-model-unavailable-reselect.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-unavailable-reselect",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-model-unavailable-reselect.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "model-unavailable-reselect-title",
  8. "description": "模型失效重选 case 内的标题生成固定响应,避免严格 case-local replay 依赖其他 case。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是本 case 的产品语义,只需要稳定返回,防止标题请求误命中业务 fixture。"
  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\": \"chatcmpl-model-unavailable-reselect-title\", \"object\": \"chat.completion\", \"created\": 0, \"model\": \"glm-5.2\", \"choices\": [{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"{\\\"title\\\":\\\"Model Unavailable\\\"}\"}, \"finish_reason\": \"stop\"}], \"usage\": {\"prompt_tokens\": 64, \"completion_tokens\": 8, \"total_tokens\": 72}}"
  27. }
  28. },
  29. {
  30. "id": "model-unavailable-reselect-primary-main",
  31. "description": "MUR01 先用即将下架的 Provider 建立 active session,为删除 Provider 后的失效横幅提供前置状态。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "核心断言在 Provider 下架后的横幅与发送门禁,不在首发回复内容;seed 响应只需稳定完成。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/chat/completions",
  42. "lastUserMessageIncludes": ["E2E_MODEL_UNAVAILABLE_PRIMARY"],
  43. "bodyIncludes": ["E2E_MODEL_UNAVAILABLE_PRIMARY", "upstream-e2e-ok", "glm-5.2"],
  44. "bodyExcludes": ["Generate a concise title"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "statusMessage": "OK",
  49. "headers": {
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "body": "data: {\"id\":\"chatcmpl-model-unavailable-reselect-primary-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-unavailable-reselect-primary-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-unavailable-reselect-primary-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":128,\"completion_tokens\":12,\"total_tokens\":140}}\n\ndata: [DONE]\n\n"
  53. }
  54. },
  55. {
  56. "id": "model-unavailable-reselect-prior-error-main",
  57. "description": "MUR01 在 Provider 下架前先制造一次不可重试的 400 终态,留下一条历史投影错误,验证模型失效横幅与投影错误横幅的显示顺序和各自的关闭。",
  58. "metadata": {
  59. "kind": "main",
  60. "timingPolicy": "fault-stream",
  61. "source": "synthetic",
  62. "syntheticReason": "真实 provider 的 400 不可稳定复现;需要一条确定的非重试失败来验证两条横幅互不遮蔽、关闭不串线。"
  63. },
  64. "maxMatches": 1,
  65. "match": {
  66. "method": "POST",
  67. "pathIncludes": "/chat/completions",
  68. "lastUserMessageIncludes": ["E2E_MODEL_UNAVAILABLE_PRIOR_ERROR"],
  69. "bodyIncludes": ["E2E_MODEL_UNAVAILABLE_PRIOR_ERROR"],
  70. "bodyExcludes": ["Generate a concise title"]
  71. },
  72. "response": {
  73. "statusCode": 400,
  74. "statusMessage": "Bad Request",
  75. "headers": {
  76. "content-type": "application/json; charset=utf-8"
  77. },
  78. "body": "{\"error\": {\"message\": \"synthetic prior failure before provider removal\", \"type\": \"invalid_request_error\", \"code\": \"e2e_model_unavailable_prior_error\"}}"
  79. }
  80. },
  81. {
  82. "id": "model-unavailable-reselect-recovered-main",
  83. "description": "MUR01 重选可用 Provider 后再次发送,验证横幅消失后会话可以继续。",
  84. "metadata": {
  85. "kind": "main",
  86. "timingPolicy": "fast-text",
  87. "source": "synthetic",
  88. "syntheticReason": "核心断言是重选后发送恢复并进入新一轮;响应只需稳定完成。"
  89. },
  90. "maxMatches": 1,
  91. "match": {
  92. "method": "POST",
  93. "pathIncludes": "/chat/completions",
  94. "lastUserMessageIncludes": ["E2E_MODEL_UNAVAILABLE_RECOVERED"],
  95. "bodyIncludes": ["E2E_MODEL_UNAVAILABLE_RECOVERED", "upstream-e2e-ok", "glm-5.2"],
  96. "bodyExcludes": ["Generate a concise title"]
  97. },
  98. "response": {
  99. "statusCode": 200,
  100. "statusMessage": "OK",
  101. "headers": {
  102. "content-type": "text/event-stream; charset=utf-8"
  103. },
  104. "body": "data: {\"id\":\"chatcmpl-model-unavailable-reselect-recovered-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-unavailable-reselect-recovered-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-unavailable-reselect-recovered-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":128,\"completion_tokens\":12,\"total_tokens\":140}}\n\ndata: [DONE]\n\n"
  105. }
  106. },
  107. {
  108. "id": "model-unavailable-reselect-final-main",
  109. "description": "MUR01 第二次下架后再次重选可用 Provider 并发送,验证关闭记录只绑定被关闭的选择、重选后会话仍可继续。",
  110. "metadata": {
  111. "kind": "main",
  112. "timingPolicy": "fast-text",
  113. "source": "synthetic",
  114. "syntheticReason": "核心断言是第二个 Provider 下架后横幅重新出现、再次重选后发送恢复;响应只需稳定完成。"
  115. },
  116. "maxMatches": 1,
  117. "match": {
  118. "method": "POST",
  119. "pathIncludes": "/chat/completions",
  120. "lastUserMessageIncludes": ["E2E_MODEL_UNAVAILABLE_FINAL"],
  121. "bodyIncludes": ["E2E_MODEL_UNAVAILABLE_FINAL", "upstream-e2e-ok", "glm-5.2"],
  122. "bodyExcludes": ["Generate a concise title"]
  123. },
  124. "response": {
  125. "statusCode": 200,
  126. "statusMessage": "OK",
  127. "headers": {
  128. "content-type": "text/event-stream; charset=utf-8"
  129. },
  130. "body": "data: {\"id\":\"chatcmpl-model-unavailable-reselect-final-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-unavailable-reselect-final-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-model-unavailable-reselect-final-main\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"glm-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":128,\"completion_tokens\":12,\"total_tokens\":140}}\n\ndata: [DONE]\n\n"
  131. }
  132. }
  133. ]
  134. }